Hi all, My need is to use cl:link to send a request parameter to another coplet that contains a XSP page, and XSP page to use it.. I found great the mail below. Problem is there "Be careful, to access to the MyCoplet-1 attributes this transformer (portal-coplet transformer) need to be call by the MyCoplet itself and with the cocoon protocol. If it's not the case use the portal action to 'load' it in memory."
I can't make serverpage take a source with cocoon protocol neither nor put a action before the generator in a pipeline... Maybe cl:link can just send parameter for use in XSL and there is another way? Thanks by advance! Phil On Mon, 2004-01-19 at 23:23, Laurent Trillaud wrote: > Alex > Yes, but it's a bad idea, because you haven't insurance about coplets > synchronization, and you will not have the benefit of the history record of > the portal. > The good design is to use coplet attributes. > 1. Declare an attributes in copletinstancedata/portal.xml > <coplet-instance-data id="MyCoplet-1" name="standard"> > <coplet-data>MyCoplet</coplet-data> > <attribute> > <name>MyAttribute</name> > <value xsi:type="java:java.lang.String">MyDefaultValue</value> > </attribute> > </coplet-instance-data> > 2. Use the portal-coplet transformer to set the attribute > <cl:links> > <cl:link layout="maintab" value="1" path="aspectDatas/tab"/> > <cl:link coplet="MyCoplet-1" value="MyValue" path="parameters/MyAttribute"/> > <cl:content>My News Page</cl:content> > </cl:links> > It will produce another event on the href > <a href="portal?portal-action=n&portal-event=m&portal-event=m+1> > My News Page</a> ********* here ************ > Be careful, to access to the MyCoplet-1 attributes this transformer need to > be call by the MyCoplet itself and with the cocoon protocol. If it's not the > case use the portal action to 'load' it in memory. > <map:act type="portal-object-model"> > <map:parameter name="portalName" value="portal" /> > <map:parameter name="CopletId" value="MyCoplet-1" /> > </map:act> ********* here ******** > 3. use it > Read value from the coplet input module. For example to use it with an xsl > <map:match pattern="MyCoplet.html"> > <map:generate src="MyData.xml" /> > <map:transform src="xml2html.xsl"> > <map:parameter name="MyParameter" value="{coplet:attributes/MyAttribute}"/> > </map:transform> > <map:serialize /> > </map:match> > > Laurent Trillaud > > > > -----Message d'origine----- > > De : Alex Romayev [mailto:[EMAIL PROTECTED] > > Envoyà : lundi 19 janvier 2004 15:31 > > à : [EMAIL PROTECTED] > > Objet : RE: [portal] Linking to portal pages > > > > Thanks Laurent -- that works great! > > > > Another question, is there a way to pass a request > > parameter with it, so that the anchor is something > > like: > > > > <a > > href="portal?portal-action=n&portal-event=m&news-id=x>My> > > News Page</a> > > > > Thanks, > > -Alex > > > > --- Laurent Trillaud <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Events in the new portal engine are very powerful > > > but totally misdocumented. > > > If you want a link to switch to a News tab in your > > > portal you need to create > > > an event to say to the maintab composite layout to > > > switch to is second > > > layout (0 based index) and send it to the portal. > > > Hoppefully, the portal-coplet transformer will do it > > > for you > > > <cl:links> > > > <cl:link layout="maintab" value="1" > > > path="aspectDatas/tab"/> > > > <cl:content>My News Page</cl:content> > > > </cl:links> > > > will be replace by > > > <map:transform type="portal-coplet" /> > > > by an anchor > > > <a href="portal?portal-action=n&portal-event=m>My > > > News Page</a> > > > where n and m are auto-incremented integer. > > > > > > If the link can't be compute inside the portal, you > > > can use the bookmark > > > feature of the portal . The sample include with > > > cocoon use > > > it(portal/resources/bookmarks.xml). > > > Just write a link > > > <a > > > > > href="http://myserver/myproject/portal/bookmark?showtab=1"> > > > My News Page</a> and it will do the same thing. > > > > > > Laurent Trillaud > > > > > > > -----Message d'origine----- > > > > De : Alex Romayev [mailto:[EMAIL PROTECTED] > > > > Envoyi : vendredi 16 janvier 2004 23:20 > > > > @ : [EMAIL PROTECTED] > > > > Objet : [portal] Linking to portal pages > > > > > > > > Hi, > > > > > > > > I am porting my site from old portal-fw to the new > > > > portal engine. I was able to port all the coplets > > > and > > > > pages with any problems, however, I got really > > > stuck > > > > on events. I am clearly missing the point here, > > > so > > > > could someone at least point me in the right > > > direction > > > > (an example would be great!)? > > > > > > > > I need to create a links to my portal pages from > > > > within coplet content. For example, I used to > > > have > > > > News page, so I could use the following: > > > > > > > > <a href=portal/news>News</a> > > > > > > > > Now my News page is represented as a tab. How > > > would I > > > > generate the right link to this page? > > > > > > > > Thanks, > > > > -Alex > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > ===== > > Alex Romayev > > Software Architect > > http://www.romayev.com > > [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]