cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Trillaud" <ltrill...@jouve.fr>
Subject RE: [portal] Linking to portal pages
Date Mon, 19 Jan 2004 15:23:30 GMT
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>
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>
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:romayev@yahoo.com]
> Envoyé : lundi 19 janvier 2004 15:31
> À : users@cocoon.apache.org
> 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 <ltrillaud@jouve.fr> 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:romayev@yahoo.com]
> > > Envoyi : vendredi 16 janvier 2004 23:20
> > > @ : users@cocoon.apache.org
> > > 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:
> > users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail:
> > users-help@cocoon.apache.org
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail:
> > users-help@cocoon.apache.org
> >
> 
> 
> =====
> Alex Romayev
> Software Architect
> http://www.romayev.com
> romayev@yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message