Thanks,
I know I can add the information into the portlet .xreg file but I was
thinking that a single file for all portlets that needed the info would be
easier to maintain. It would be cool if you could do a link in the .xreg
file to other config files.

-----Original Message-----
From: David Sean Taylor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 9:43 AM
To: 'Jetspeed Users List'
Subject: RE: Reading a config file by many portlets


Put your configuration in the portlet registry, take the JavaWeb portlet
entry as an example:

    <portlet-entry name="JavaWeb" hidden="false" type="ref"
        parent="WebPagePortlet" application="false">
        <meta-info>
            <title>JavaSoft</title>
            <description>JavaSoft</description>
        </meta-info>
        <parameter name="dont_remove_applet" value="yes"
hidden="false"/>
        <url>http://java.sun.com/</url>
        <category>sites.companies.sun</category>
    </portlet-entry>

Parameters are name value pairs, and you can access them in your
portlet.init() (which is called only once) like this:

        this.getPortletConfig().getInitParameter(name)  // get a single
param
Or
        this.getPortletConfig().getInitParameters()   // get all the
params

> -----Original Message-----
> From: Casimiro Lovato-Winston [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 03, 2002 9:37 AM
> To: Jetspeed-User
> Subject: Reading a config file by many portlets
>
>
> Hello everybody,
> I am creating a portlet that needs to get a URL and the
> script referenced by that URL as it's content, then rewrite
> all form tags and outside references so that action
> attributes and HREFS are passed as parameters. Fortunately
> much of this was done by the good people at Pervasive
> Technology Labs and we have a working portlet that will do
> the URL rewriting and will do form posts (instead of letting
> the browser do it). What I want to do now is have a config
> file that in XML describes extensions (*.gif, *.tar) to URIs
> and whether or not the portlet should rewrite the anchor tags
> that reference them to open up in a new window or not. So <a
> href="http://www.blob.mil:8080/flogbert.html";>LINK</a> would
> be rewritten as <a
> href="http://myServer.com:8080?portletid=http://www.blob.mil:8
> 080/flogbert.h
> tml">LINK</a> but <a
> href="http://www.borg.org:9000/data/packageofstuff.tar";>DATA</
> a> would be written as <a
> href="http://www.borg.org:9000/data/packageofstuff.tar";
> target="blank">DATA</a> because the portlet would reference
> the config file that tells it that *.tar files are not to be
> rendered in the portlet. What would be the best way to
> reference such a file in jetspeed? I don't want to read a
> file everytime a portlet scans the html. Can I have the file
> read and persisted somewhere (I guess in Turbine) when
> jetspeed starts?
>
> Thaks for any ideas,
> Casey
>
>
> --
> To unsubscribe, e-mail:
> <mailto:jetspeed-user-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to