Anand
Good points. I still didnt probably give you the right requirement.
I have a ejb in the app. server which returns a xml string . This ejb is
called by rmi/iiop from the Portlet class. Now I'm looking
at using this xml string as an input to the xsl. If you see the portlet
definition, it takes a vm uri. I'm not sure why should I use
a vm ? Appreciate any of your inputs on this. Thanks
- Shan
At 01:05 PM 5/2/2002 +0530, anand wrote:
>What you are asking is what i think is being done.....
>You saw how to configure your xsl portlet.Now
>see if you are using a portlet which uses xsl for outputing
>then it would be like this
>
><portlet-entry name="Shan" hidden="false" type="ref"
> parent="XSL" application="false">
> <meta-info>
> <title>Shan</title>
> </meta-info>
> <url>/shan/servlet/shan/template/shan.vm</url>
> </portlet-entry>
>
> If you not you are calling the parent as XSL and specifying
>that this should take input from the url.So the url will be outputing
>xml and that will serve as the input for xsl.I am sorry i missed this.
>Hope it is clear now....Enjoy
>
>-Anand
>
>Shan Gopalakrishnan wrote:
>
>>also Anand, where are u specifying the xml input to the xsl portlet.
>>I see the xsl file is mentioned.
>> <parameter name="stylesheetURL" value="/shan/xsl/shan.xsl"
>> hidden="false"> but how about the xml file?
>>probably i'm missing something.
>>
>>
>>At 12:27 PM 5/2/2002 +0530, anand wrote:
>>
>>>Hai Shan,
>>>1. This is how you you place your XSL in portels.xreg
>>>
>>><portlet-entry name="XSL" hidden="false" type="abstract"
>>>application="false">
>>>
>>><classname>org.apache.jetspeed.portal.portlets.ShanXSLPortlet</classname>
>>> <parameter name="host" value="localhost" hidden="false"/>
>>> <parameter name="port" value="8080" hidden="false"/>
>>> <parameter name="stylesheetURL" value="/shan/xsl/shan.xsl"
>>> hidden="false">
>>> <security role="admin"/>
>>> </parameter>
>>> </portlet-entry>
>>>
>>>2.Say your vm/jsp will output a xml and this will be the input to
>>> your xsl.This sample vm shows how to output the form.....
>>>
>>><shan>
>>> <shan_form>
>>> <action>/shan/portal/pane0/ShanPortal</action>
>>> <method>post</method>
>>> <onsubmit>return validate(this)</onsubmit>
>>> <input type="text" name="searchstring" display="" value=""/>
>>> <input type="submit" name="search" value="search" />
>>> <input type="hidden" name="nodeId" value="$nodeId" />
>>> <input type="hidden" name="userId" value="$userId" />
>>> </shan_form>
>>></shan>
>>>
>>>3.If your vm is outputing in such a way then you can
>>> use the below sample of xsl.....
>>>
>>><xsl:template match="shan/shan_form">
>>> <form name="{name}" action="{action}" method="{method}"
>>> onSubmit="{onsubmit}" enctype="{enctype}">
>>> <table>
>>> <xsl:for-each select="input">
>>> <xsl:variable name="type" select="@type" />
>>> <!-- TYPE AREA -->
>>> <xsl:if test="$type='area'">
>>> <tr>
>>> <td> <b><xsl:value-of
>>> select='@display' /></b>
>>> </td>
>>> <td>
>>> <textarea name="{@name}" rows="{@rows}" cols="{@cols}">
>>> <xsl:for-each select="value">
>>> <xsl:value-of select="." />
>>> </xsl:for-each>
>>> </textarea>
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>> <!-- DISPLAY -->
>>>
>>> <xsl:if test="$type='display'">
>>> <tr>
>>> <td>
>>> <b><xsl:value-of select='@display' /></b>
>>> </td>
>>> <td>
>>> <xsl:value-of select='@value' />
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>>
>>> <!-- SELECT -->
>>>
>>> <xsl:if test="$type='select'">
>>> <tr>
>>> <td colspan='2'>
>>> <select name='{@name}' size='{@size}'
>>> multiple="{@multiple}">
>>> <xsl:for-each select="option">
>>> <xsl:variable name ="selected" select="@selected" />
>>> <xsl:if test= "$selected = 'selected'">
>>> <option value ='{@value}' selected='{selected}'>
>>> <xsl:value-of select='@display' />
>>> </option>
>>> </xsl:if>
>>> <xsl:if test= "$selected = 'notselected'">
>>> <option value ='{@value}'>
>>> <xsl:value-of select='@display' />
>>> </option>
>>> </xsl:if>
>>> </xsl:for-each>
>>> </select>
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>>
>>> <!-- DROP DOWN -->
>>>
>>> <xsl:if test="$type='dropdown'">
>>> <tr>
>>> <td> <b><xsl:value-of
>>> select='@display' /></b>
>>> </td>
>>> <td>
>>> <select name='{@name}' size='{@size}'>
>>> <xsl:for-each select="option">
>>> <xsl:variable name="type" select="@selected" />
>>> <xsl:if test="$type='true'">
>>> <option value='{@value}' selected='{@selected}'>
>>> <xsl:value-of select="." />
>>> </option>
>>> </xsl:if>
>>> <xsl:if test="$type='false'">
>>> <option value='{@value}'>
>>> <xsl:value-of select="." />
>>> </option>
>>> </xsl:if> </xsl:for-each>
>>> </select>
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>>
>>> <!-- TYPE FILE -->
>>>
>>>
>>> <xsl:if test="$type='file'">
>>> <tr>
>>> <td>
>>> <b><xsl:value-of select='@display' /></b>
>>> </td>
>>> <td>
>>> <input name='{@name}' type='{@type}' value='{@value}' />
>>> </td>
>>> </tr>
>>> </xsl:if>
>>> <xsl:if test="$type='text'">
>>> <tr>
>>> <td>
>>> <b><xsl:value-of select='@display' /></b>
>>> </td>
>>> <td>
>>> <input name='{@name}' type='{@type}'
>>> value='{@value}' maxlength='{@maxlength}' size='{@size}'/>
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>> <!-- TYPE CHECK BOX -->
>>>
>>> <xsl:if test="$type='checkbox'">
>>> <tr>
>>> <td>
>>> <b><xsl:value-of select='@display' /></b>
>>> </td>
>>> <td>
>>> <xsl:variable name="checked" select="@checked" />
>>> <xsl:if test="$checked='true'">
>>> <input name='{@name}' type='{@type}'
>>> value='{@value}' checked='{@checked}' />
>>> </xsl:if>
>>> <xsl:if test="$checked='false'">
>>> <input name='{@name}' type='{@type}'
>>> value='{@value}' />
>>> </xsl:if> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>> <!-- TYPE HIDDEN -->
>>>
>>> <xsl:if test="$type='hidden'">
>>> <tr>
>>> <td colspan='2'>
>>> <input name='{@name}' type='{@type}'
>>> value='{@value}' />
>>> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>> <!-- TYPE SUBMIT and TYPE CANCEL -->
>>>
>>> <xsl:if test="$type='submit'">
>>> <tr>
>>> <td align="right">
>>> <input name='{@name}' type='{@type}'
>>> value='{@value}' />
>>>
>>></td>
>>>
>>> <td align="left">
>>> <input name='cancel' type='button' value='Cancel'
>>> onClick='javascript:history.back(1)' /> </td>
>>> </tr>
>>> </xsl:if>
>>>
>>> </xsl:for-each>
>>> </table>
>>> </form>
>>> </xsl:template>
>>>
>>>These examples may not be perfect to your use but this is some kind
>>>of sample and i guess this will help you.All the Best.
>>>
>>>-Anand
>>>
>>>
>>>
>>>--
>>>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]>
>>
>>
>
>
>
>--
>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]>