Hi Moin users,

we are running a moinmoin wiki within our company. Recently the wiki is also 
linked from within our intranet and is running within a Iframe. Now I am facing 
the problem that when the wiki is called from the Intranet page I would like to 
omit the header line with the logo. But if the wiki is called in standalone 
mode I would like to show the logo.

We are running moinmoin version 1.93 on IIS using the isap_wsgi handler.

My idea to accomplish the desired behavior is the following:

- when initially called by the intranet a separate parameter 
?displaymode=iframe is supplied to the wiki url
- some kind of wsgi middleware takes this parameter and stores it as separate 
environ variable for example environ["displaymode"]=iframe
- if moinmoin detects this additional environment parameter it stores it in the 
user's session 
- the theme checks within the user's session context for the parameter and 
decides whether to display the header with the logo

I already accomplished to set the environ parameter on wsgi level within the 
isapi_wsgi handler script.

class modifyApp(object):

        def __init__(self,app):
                self.app=app
                self.output=file("c:/temp/wsgi.log","a",0)

        def __call__(self, environ, start_response):
                #extract displaymode from queryString
                query=cgi.parse_qs(environ["QUERY_STRING"])
                if query.has_key("displaymode"):
                        environ["DISPLAYMODE"]=query.get("displaymode")[0]
                        self.output.write("%s \n" % environ["DISPLAYMODE"])

                return self.app(environ,start_response)

# The entry points for the ISAPI extension.
def __ExtensionFactory__():
        #add path to sys.paht where wikiconfig.py can be found
        sys.path.insert(0, 'c:/inetpub/moin')
        ## new way to instantiate in 1.9
        moinmoinApp = make_application(shared=True) 
        wrappedApp = modifyApp(moinmoinApp)
        return isapi_wsgi.ISAPIThreadPoolHandler(wrappedApp)

What I would like to know is:

- what do you think about this approach, would it be feasible?
- how do I store the additional parameter within the user's session?

It would be great if you could assist me in implementing such a behavior.

Many Thanks,

mark
_______________________________________________________________________________________

Dialog Semiconductor GmbH
Neue Str. 95
D-73230 Kirchheim
Managing Director: Dr. Jalal Bagherli
Chairman of the Supervisory Board: Gregorio Reyes
Commercial register: Amtsgericht Stuttgart: HRB 231181
UST-ID-Nr. DE 811121668


Legal Disclaimer: This e-mail communication (and any attachment/s) is 
confidential and 
contains proprietary information, some or all of which may be legally 
privileged. It is 
intended solely for the use of the individual or entity to which it is 
addressed. Access 
to this email by anyone else is unauthorized. If you are not the intended 
recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken in 
reliance
on it, is prohibited and may be unlawful.

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Moin-user mailing list
Moin-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to