You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex Romayev <ro...@yahoo.com> on 2004/01/16 23:19:44 UTC

[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


coplet attributes

Posted by Philippe Guillard <pg...@soociety.com>.
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: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 <lt...@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
> 
> 


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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
Huummm. I think that the portal-object-model action is missing in the
news/news-news-item.portlet pattern

<map:match pattern="news/news-news-item.portlet">
<map:aggregate ...>
	blah blah
</map:aggregate>
<map:transform src="portal/xslt/news/join-with-people.xsl"/>
<!-- begin insert here -->
<map:act type="portal-object-model">
<map:parameter name="portalName" value="portal" />
</map:act>
<!-- end insert -->
<map:transform src="portal/xslt/news/news-item.xsl">
blah blah
<map:transform ...
<map:act ...
<map:transform ...
<map:serialize ...
</map:match>

Laurent Trillaud

> -----Message d'origine-----
> De : Alex Romayev [mailto:romayev@yahoo.com]
> Envoyé : mardi 20 janvier 2004 15:29
> À : users@cocoon.apache.org
> Objet : RE: [portal] Linking to portal pages
> 
> Hi Laurent,
> 
> Thanks again for your help,
> -Alex
> 
> ==========================================
> copletinstancedata/portal.xml:
> 
> The calling coplet:
> 
> <coplet-instance-data id="news-summary-1"
> name="standard">
>   <coplet-data>news-summary</coplet-data>
> </coplet-instance-data>
> 
> The coplet being called, requires news-id parameter
> (no default):
> <coplet-instance-data id="news-item-1"
> name="standard">
>   <coplet-data>news-item</coplet-data>
>   <attribute>
>     <name>news-id</name>
>     <value
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="java:java.lang.String"></value>
>   </attribute>
> </coplet-instance-data>
> 
> ======================================
> portlets.xmap:
> 
> <map:match pattern="home/news-summary.portlet">
>   <map:generate
> src="cocoon://site/home/news-summary.resource"/>
>   <map:transform
> src="portal/styles/html/portlets/home/news-summary.xsl">
>     <map:parameter name="use-request-parameters"
> value="true"/>
>   </map:transform>
>   <map:act type="locale">
>     <map:transform type="i18n">
>       <map:parameter name="locale" value="{locale}"/>
>     </map:transform>
>   </map:act>
>   <map:transform type="portal-coplet" />
>   <map:serialize type="xml"/>
> </map:match>
> 
> 
> <map:match pattern="news/news-news-item.portlet">
>   <map:aggregate element="module">
>     <map:part
> src="cocoon://site/content/news.processed.xml"/>
>     <map:part
> src="cocoon://site/content/family.processed.xml"/>
>   </map:aggregate>
>   <map:transform
> src="portal/xslt/news/join-with-people.xsl"/>
>   <map:transform src="portal/xslt/news/news-item.xsl">
>     <map:parameter name="news-id"
> value="{coplet:attributes/news-id}"/>
>   </map:transform>
>   <map:transform
> src="portal/styles/html/portlets/home/news-summary.xsl"/>
>   <map:act type="locale">
>     <map:transform type="i18n">
>       <map:parameter name="locale" value="{locale}"/>
>     </map:transform>
>   </map:act>
>   <map:transform type="portal-coplet" />
>   <map:serialize type="xml"/>
> </map:match>
> 
> ===============================================
> news-summary.xsl
> 
> <cl:links>
>   <cl:link layout="maintab" value="3"
> path="aspectDatas/tab"/>
>   <cl:link layout="newstab" value="2"
> path="aspectDatas/tab"/>
>   <cl:link coplet="news-item-1" value="{@id}"
> path="parameters/news-id"/>
>   <cl:content>Read more</cl:content>
> </cl:links>
> 
> ============================================


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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
Alex
If you pipeline is call from a coplet with the cocoon pseudo protocol, you
don't need this action, because the portal object model is already in
memory.
This action is useful only if you need to access coplet attributes from
another pipeline. You need to say which coplet instance you will use.
Bookmark a portal is not a piece of cake. Hopefully the new portal engine,
comes since Dec 2003, comes with a powerful bookmark/history feature.
History, here, is the capability to retrieved a previous page viewed, with
the following URL http://localhost:8080/MyWebSite/portal/bookmark?history=n,
where n the portal-action number.
On each page viewed the portal store all coplets attributes. For example, if
you have a coplet that display a document based on a docId, put in in
attribute, instead of read it from the request parameter. If you go backward
your history, you will see the right coplet content.
Laurent

> Hi Laurent,
> 
> I can probably convert my coplets to be inside a
> single match -- I was hoping to awoid rework and stick
> with my old model.  By the way, can you explain how
> portal-object-model action works?  Also you have
> mentioned something about portal history in one of
> your previous e-mails, what is it?


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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
Hi Laurent,

I can probably convert my coplets to be inside a
single match -- I was hoping to awoid rework and stick
with my old model.  By the way, can you explain how
portal-object-model action works?  Also you have
mentioned something about portal history in one of
your previous e-mails, what is it?

Thanks,
-Alex

--- Laurent Trillaud <lt...@jouve.fr> wrote:
> Alex
> IMO it's easier is you put your coplet inside only
> one match, because you
> will not have to use the portal-object-model action.
> Therefore, your match will become
> <!-- <resource>.<style>.coplet -->
> <map:match pattern="*.*.coplet">
>   <map:generate src="{1}.resource">
>   <map:trasform src="{1}2{2}.xsl">
>     <map:parameter name="news-id"
>     value="{coplet:parameters/news-id}"/>
>   <map:trasform src="{2}-links.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
> Hope that will be useful.
> Laurent



=====
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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
Alex
IMO it's easier is you put your coplet inside only one match, because you
will not have to use the portal-object-model action.
Therefore, your match will become
<!-- <resource>.<style>.coplet -->
<map:match pattern="*.*.coplet">
  <map:generate src="{1}.resource">
  <map:trasform src="{1}2{2}.xsl">
    <map:parameter name="news-id"
    value="{coplet:parameters/news-id}"/>
  <map:trasform src="{2}-links.xsl"/>
  <map:serialize type="xml"/>
</map:match>
Hope that will be useful.
Laurent

> -----Message d'origine-----
> De : Alex Romayev [mailto:romayev@yahoo.com]
> Envoyé : jeudi 22 janvier 2004 15:32
> À : users@cocoon.apache.org
> Objet : RE: [portal] Linking to portal pages
> 
> Laurent,
> 
> Let me explain what I'm trying to achieve.  I am
> porting my site from the old portal-fw to the new
> portal engine.  I have implemented my coplets in two
> steps:
> 
> 1. Match on *.<style>.coplet, for example
> <map:match *.related.coplet>
>  <map:generate src="{1}.resource">
>  <map:trasform src="related-links.xsl"/>
>  <map:serialize type="xml"/>
> </map:match>
> 
> This allows me to appy the same style to multiple
> sources.
> 
> 2. Match on *.resource and generate xml expected for
> the style (notice that I'm pulling my news-id from the
> request):
> <map:match related-news.resource>
>  <map:generate src="news.xml">
>  <map:trasform src="news2related.xsl">
>    <map:parameter name="news-id"
> value="{request-param:news-id}"/>
>  <map:serialize type="xml"/>
> </map:match>
> 
> Does this make sense?
> 
> Thanks,
> -Alex
> 
> --- Laurent Trillaud <lt...@jouve.fr> wrote:
> > Alex
> > I'm not sure to understand what your problem is.
> > When you declare a coplet attribute in the
> > copletinstancedata dir, it's like
> > a local variable where the scope is the coplet
> > itself.
> > Laurent
> >
> > > -----Message d'origine-----
> > > De : Alex Romayev [mailto:romayev@yahoo.com]
> > > Envoyi : mardi 20 janvier 2004 17:08
> > > @ : users@cocoon.apache.org
> > > Objet : RE: [portal] Linking to portal pages
> > >
> > > OK, I'm almost there!
> > >
> > > The reason for the error was that I was using
> > > "parameters/news-id" rather than
> > "attributes/news-id".
> > >
> > > Now one question: easier to show with an example:
> > >
> > > This works:
> > >
> > > <map:match pattern="news-item.portlet">
> > >   <map:generate src="news.xml"/>
> > >   <map:transform src="filter-news-item.xsl">
> > >     <map:parameter name="news-id"
> > > value="{coplet:attribute/news-id}/>
> > >   </map:transform>
> > >   <map:transform src="news-item2html.xsl"/>
> > >   <map:serialize type="xml/>
> > > </map:match>
> > >
> > > However, this does't (notice, that the attribute
> > is
> > > being used by another pipeline, which is called by
> > the
> > > coplet pipeline):
> > >
> > > <map:match pattern="news-item.portlet">
> > >   <map:generate src="cocoon:/news-item.resouce"/>
> > >   <map:transform src="news-item2html.xsl"/>
> > >   <map:serialize type="xml/>
> > > </map:match>
> > >
> > > <map:match pattern="news-item.resource">
> > >   <map:generate src="news.xml"/>
> > >   <map:transform src="filter-news-item.xsl">
> > >     <map:parameter name="news-id"
> > > value="{coplet:attribute/news-id}/>
> > >   </map:transform>
> > >   <map:serialize type="xml/>
> > > </map:match>
> > >
> > > Any ideas?
> > >
> > > Thanks,
> > > -Alex
> > >
> > > --- Alex Romayev <ro...@yahoo.com> wrote:
> > > > Hi Laurent,
> > > >
> > > > Thanks again for your help,
> > > > -Alex
> > > >
> > > > ==========================================
> > > > copletinstancedata/portal.xml:
> > > >
> > > > The calling coplet:
> > > >
> > > > <coplet-instance-data id="news-summary-1"
> > > > name="standard">
> > > >   <coplet-data>news-summary</coplet-data>
> > > > </coplet-instance-data>
> > > >
> > > > The coplet being called, requires news-id
> > parameter
> > > > (no default):
> > > > <coplet-instance-data id="news-item-1"
> > > > name="standard">
> > > >   <coplet-data>news-item</coplet-data>
> > > >   <attribute>
> > > >     <name>news-id</name>
> > > >     <value
> > > >
> > >
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > > xsi:type="java:java.lang.String"></value>
> > > >   </attribute>
> > > > </coplet-instance-data>
> > > >
> > > > ======================================
> > > > portlets.xmap:
> > > >
> > > > <map:match pattern="home/news-summary.portlet">
> > > >   <map:generate
> > > > src="cocoon://site/home/news-summary.resource"/>
> > > >   <map:transform
> > > >
> > >
> >
> src="portal/styles/html/portlets/home/news-summary.xsl">
> > > >     <map:parameter name="use-request-parameters"
> > > > value="true"/>
> > > >   </map:transform>
> > > >   <map:act type="locale">
> > > >     <map:transform type="i18n">
> > > >       <map:parameter name="locale"
> > > > value="{locale}"/>
> > > >     </map:transform>
> > > >   </map:act>
> > > >   <map:transform type="portal-coplet" />
> > > >   <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > >
> > > > <map:match
> > pattern="news/news-news-item.portlet">
> > > >   <map:aggregate element="module">
> > > >     <map:part
> > > > src="cocoon://site/content/news.processed.xml"/>
> > > >     <map:part
> > > >
> > src="cocoon://site/content/family.processed.xml"/>
> > > >   </map:aggregate>
> > > >   <map:transform
> > > > src="portal/xslt/news/join-with-people.xsl"/>
> > > >   <map:transform
> > > > src="portal/xslt/news/news-item.xsl">
> > > >     <map:parameter name="news-id"
> > > > value="{coplet:attributes/news-id}"/>
> > > >   </map:transform>
> > > >   <map:transform
> > > >
> > >
> >
> src="portal/styles/html/portlets/home/news-summary.xsl"/>
> > > >   <map:act type="locale">
> > > >     <map:transform type="i18n">
> > > >       <map:parameter name="locale"
> > > > value="{locale}"/>
> > > >     </map:transform>
> > > >   </map:act>
> > > >   <map:transform type="portal-coplet" />
> > > >   <map:serialize type="xml"/>
> > > > </map:match>
> > > >
> > > > ===============================================
> > > > news-summary.xsl
> > > >
> > > > <cl:links>
> > > >   <cl:link layout="maintab" value="3"
> > > > path="aspectDatas/tab"/>
> > > >   <cl:link layout="newstab" value="2"
> > > > path="aspectDatas/tab"/>
> > > >   <cl:link coplet="news-item-1" value="{@id}"
> > > > path="parameters/news-id"/>
> > > >   <cl:content>Read more</cl:content>
> > > > </cl:links>
> > > >
> > > > ============================================
> > > >
> > > > --- Laurent Trillaud <lt...@jouve.fr> wrote:
> > > > > Alex
> > > > > Can you give snippets of your
> > > > > copletinstancedata/portal.xml file and your
> > > > > sitemap.xmap?
> > > > > Laurent
> > > > >
> > > > > > -----Message d'origine-----
> > > > > > De : Alex Romayev [mailto:romayev@yahoo.com]
> > > > > > Envoyi : mardi 20 janvier 2004 00:21
> > > > > > @ : users@cocoon.apache.org
> > > > > > Objet : RE: [portal] Linking to portal pages
> > > > > >
> > > > > > Laurent,
> > > > > >
> > > > > > I think I'm almost there, however I'm
> > getting an
> > > > > error
> > > > > > and I believe it is because I don't quite
> > > > > understand
> > > > > > your point #2 and making some mistake there.
> > > > The
> > > > > > error that I get is:
> > > > > >
> > > > > > org.apache.cocoon.ProcessingException:
> > Failed to
> > > > > > execute pipeline.:
> > > > > > org.apache.commons.jxpath.JXPathException:
> > > > > Exception
> > > > > > trying to set value with xpath
> > > > parameters/news-id;
> > > > > > Cannot set property /parameters/news-id,
> > path
> > > > does
> > > > > not
> > > > > > match a changeable location.
> > > > > >
> > > > > > Please see my comments below.
> > > > > >
> > > > > > Thanks,
> > > > > > -Alex
> > > > > >
> > > > > >
> > > > > > --- Laurent Trillaud <lt...@jouve.fr>
> > 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>
> > > > > >
> > > > > > OK, I did that -- my coplet instance is
> > named
> > > > > > "news-item-1" and the attribute "news-id".
> > I
> > > > also
> > > > > > noticed that the sample places the
> > attributes in
> > > > > > coplet definitions rather than coplet
> > instances,
> > > > > does
> > > > > > it matter?
> > > > > >
> > > > > > > 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.
> > > > > >
> > > > > > I'm not sure what you mean.  In my case I
> > have 2
> > > > > > coplet instances: news-list-1 and
> > news-item-1.
> > > > > Each
> > > > > > item in the news list needs to have a link
> > to
> > > > the
> > > > > > corresponding news item.  So I put the above
> > > > code
> > > > > in
> > > > > > the news-list-1 coplet and used the
> > > > > coplet-transformer
> > > > > > to generate the ancor tag.
> > > > > >
> > > > > > When I click on the generated link, I get
> > the
> > > > > "path
> > > > > > does not match a changeable location" error.
> > > > > >
> > > > > > 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>
> > > > > >
> > > > > > I think this is my case, since my news-list
> > > > coplet
> > > > > > needs to call news-item coplet.  Where do I
> > > > place
> > > > > > this?
> > > > > >
> > > > > > > 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]
> > > > > > > > Envoyi : 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
> > <lt...@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
> > > > > > >
> > > > > >
> > > > > >
> > > > > > =====
> > > > > > 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
> > > > >
> > > >
> > > >
> > > > =====
> > > > 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
> > > >
> > >
> > >
> > > =====
> > > 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
> >
> 
> 
> =====
> 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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
Laurent,

Let me explain what I'm trying to achieve.  I am
porting my site from the old portal-fw to the new
portal engine.  I have implemented my coplets in two
steps:

1. Match on *.<style>.coplet, for example 
<map:match *.related.coplet>
 <map:generate src="{1}.resource">
 <map:trasform src="related-links.xsl"/>
 <map:serialize type="xml"/>
</map:match>

This allows me to appy the same style to multiple
sources.

2. Match on *.resource and generate xml expected for
the style (notice that I'm pulling my news-id from the
request):
<map:match related-news.resource>
 <map:generate src="news.xml">
 <map:trasform src="news2related.xsl">
   <map:parameter name="news-id"
value="{request-param:news-id}"/>
 <map:serialize type="xml"/>
</map:match>

Does this make sense?

Thanks,
-Alex

--- Laurent Trillaud <lt...@jouve.fr> wrote:
> Alex
> I'm not sure to understand what your problem is.
> When you declare a coplet attribute in the
> copletinstancedata dir, it's like
> a local variable where the scope is the coplet
> itself.
> Laurent
> 
> > -----Message d'origine-----
> > De�: Alex Romayev [mailto:romayev@yahoo.com]
> > Envoy�: mardi 20 janvier 2004 17:08
> > ��: users@cocoon.apache.org
> > Objet�: RE: [portal] Linking to portal pages
> > 
> > OK, I'm almost there!
> > 
> > The reason for the error was that I was using
> > "parameters/news-id" rather than
> "attributes/news-id".
> > 
> > Now one question: easier to show with an example:
> > 
> > This works:
> > 
> > <map:match pattern="news-item.portlet">
> >   <map:generate src="news.xml"/>
> >   <map:transform src="filter-news-item.xsl">
> >     <map:parameter name="news-id"
> > value="{coplet:attribute/news-id}/>
> >   </map:transform>
> >   <map:transform src="news-item2html.xsl"/>
> >   <map:serialize type="xml/>
> > </map:match>
> > 
> > However, this does't (notice, that the attribute
> is
> > being used by another pipeline, which is called by
> the
> > coplet pipeline):
> > 
> > <map:match pattern="news-item.portlet">
> >   <map:generate src="cocoon:/news-item.resouce"/>
> >   <map:transform src="news-item2html.xsl"/>
> >   <map:serialize type="xml/>
> > </map:match>
> > 
> > <map:match pattern="news-item.resource">
> >   <map:generate src="news.xml"/>
> >   <map:transform src="filter-news-item.xsl">
> >     <map:parameter name="news-id"
> > value="{coplet:attribute/news-id}/>
> >   </map:transform>
> >   <map:serialize type="xml/>
> > </map:match>
> > 
> > Any ideas?
> > 
> > Thanks,
> > -Alex
> > 
> > --- Alex Romayev <ro...@yahoo.com> wrote:
> > > Hi Laurent,
> > >
> > > Thanks again for your help,
> > > -Alex
> > >
> > > ==========================================
> > > copletinstancedata/portal.xml:
> > >
> > > The calling coplet:
> > >
> > > <coplet-instance-data id="news-summary-1"
> > > name="standard">
> > >   <coplet-data>news-summary</coplet-data>
> > > </coplet-instance-data>
> > >
> > > The coplet being called, requires news-id
> parameter
> > > (no default):
> > > <coplet-instance-data id="news-item-1"
> > > name="standard">
> > >   <coplet-data>news-item</coplet-data>
> > >   <attribute>
> > >     <name>news-id</name>
> > >     <value
> > >
> >
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xsi:type="java:java.lang.String"></value>
> > >   </attribute>
> > > </coplet-instance-data>
> > >
> > > ======================================
> > > portlets.xmap:
> > >
> > > <map:match pattern="home/news-summary.portlet">
> > >   <map:generate
> > > src="cocoon://site/home/news-summary.resource"/>
> > >   <map:transform
> > >
> >
>
src="portal/styles/html/portlets/home/news-summary.xsl">
> > >     <map:parameter name="use-request-parameters"
> > > value="true"/>
> > >   </map:transform>
> > >   <map:act type="locale">
> > >     <map:transform type="i18n">
> > >       <map:parameter name="locale"
> > > value="{locale}"/>
> > >     </map:transform>
> > >   </map:act>
> > >   <map:transform type="portal-coplet" />
> > >   <map:serialize type="xml"/>
> > > </map:match>
> > >
> > >
> > > <map:match
> pattern="news/news-news-item.portlet">
> > >   <map:aggregate element="module">
> > >     <map:part
> > > src="cocoon://site/content/news.processed.xml"/>
> > >     <map:part
> > >
> src="cocoon://site/content/family.processed.xml"/>
> > >   </map:aggregate>
> > >   <map:transform
> > > src="portal/xslt/news/join-with-people.xsl"/>
> > >   <map:transform
> > > src="portal/xslt/news/news-item.xsl">
> > >     <map:parameter name="news-id"
> > > value="{coplet:attributes/news-id}"/>
> > >   </map:transform>
> > >   <map:transform
> > >
> >
>
src="portal/styles/html/portlets/home/news-summary.xsl"/>
> > >   <map:act type="locale">
> > >     <map:transform type="i18n">
> > >       <map:parameter name="locale"
> > > value="{locale}"/>
> > >     </map:transform>
> > >   </map:act>
> > >   <map:transform type="portal-coplet" />
> > >   <map:serialize type="xml"/>
> > > </map:match>
> > >
> > > ===============================================
> > > news-summary.xsl
> > >
> > > <cl:links>
> > >   <cl:link layout="maintab" value="3"
> > > path="aspectDatas/tab"/>
> > >   <cl:link layout="newstab" value="2"
> > > path="aspectDatas/tab"/>
> > >   <cl:link coplet="news-item-1" value="{@id}"
> > > path="parameters/news-id"/>
> > >   <cl:content>Read more</cl:content>
> > > </cl:links>
> > >
> > > ============================================
> > >
> > > --- Laurent Trillaud <lt...@jouve.fr> wrote:
> > > > Alex
> > > > Can you give snippets of your
> > > > copletinstancedata/portal.xml file and your
> > > > sitemap.xmap?
> > > > Laurent
> > > >
> > > > > -----Message d'origine-----
> > > > > De : Alex Romayev [mailto:romayev@yahoo.com]
> > > > > Envoyi : mardi 20 janvier 2004 00:21
> > > > > @ : users@cocoon.apache.org
> > > > > Objet : RE: [portal] Linking to portal pages
> > > > >
> > > > > Laurent,
> > > > >
> > > > > I think I'm almost there, however I'm
> getting an
> > > > error
> > > > > and I believe it is because I don't quite
> > > > understand
> > > > > your point #2 and making some mistake there.
> > > The
> > > > > error that I get is:
> > > > >
> > > > > org.apache.cocoon.ProcessingException:
> Failed to
> > > > > execute pipeline.:
> > > > > org.apache.commons.jxpath.JXPathException:
> > > > Exception
> > > > > trying to set value with xpath
> > > parameters/news-id;
> > > > > Cannot set property /parameters/news-id,
> path
> > > does
> > > > not
> > > > > match a changeable location.
> > > > >
> > > > > Please see my comments below.
> > > > >
> > > > > Thanks,
> > > > > -Alex
> > > > >
> > > > >
> > > > > --- Laurent Trillaud <lt...@jouve.fr>
> 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>
> > > > >
> > > > > OK, I did that -- my coplet instance is
> named
> > > > > "news-item-1" and the attribute "news-id". 
> I
> > > also
> > > > > noticed that the sample places the
> attributes in
> > > > > coplet definitions rather than coplet
> instances,
> > > > does
> > > > > it matter?
> > > > >
> > > > > > 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.
> > > > >
> > > > > I'm not sure what you mean.  In my case I
> have 2
> > > > > coplet instances: news-list-1 and
> news-item-1.
> > > > Each
> > > > > item in the news list needs to have a link
> to
> > > the
> > > > > corresponding news item.  So I put the above
> > > code
> > > > in
> > > > > the news-list-1 coplet and used the
> > > > coplet-transformer
> > > > > to generate the ancor tag.
> > > > >
> > > > > When I click on the generated link, I get
> the
> > > > "path
> > > > > does not match a changeable location" error.
> > > > >
> > > > > 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>
> > > > >
> > > > > I think this is my case, since my news-list
> > > coplet
> > > > > needs to call news-item coplet.  Where do I
> > > place
> > > > > this?
> > > > >
> > > > > > 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]
> > > > > > > Envoyi : 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
> <lt...@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
> > > > > >
> > > > >
> > > > >
> > > > > =====
> > > > > 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
> > > >
> > >
> > >
> > > =====
> > > 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
> > >
> > 
> > 
> > =====
> > 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
> 


=====
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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
Alex
I'm not sure to understand what your problem is.
When you declare a coplet attribute in the copletinstancedata dir, it's like
a local variable where the scope is the coplet itself.
Laurent

> -----Message d'origine-----
> De : Alex Romayev [mailto:romayev@yahoo.com]
> Envoyé : mardi 20 janvier 2004 17:08
> À : users@cocoon.apache.org
> Objet : RE: [portal] Linking to portal pages
> 
> OK, I'm almost there!
> 
> The reason for the error was that I was using
> "parameters/news-id" rather than "attributes/news-id".
> 
> Now one question: easier to show with an example:
> 
> This works:
> 
> <map:match pattern="news-item.portlet">
>   <map:generate src="news.xml"/>
>   <map:transform src="filter-news-item.xsl">
>     <map:parameter name="news-id"
> value="{coplet:attribute/news-id}/>
>   </map:transform>
>   <map:transform src="news-item2html.xsl"/>
>   <map:serialize type="xml/>
> </map:match>
> 
> However, this does't (notice, that the attribute is
> being used by another pipeline, which is called by the
> coplet pipeline):
> 
> <map:match pattern="news-item.portlet">
>   <map:generate src="cocoon:/news-item.resouce"/>
>   <map:transform src="news-item2html.xsl"/>
>   <map:serialize type="xml/>
> </map:match>
> 
> <map:match pattern="news-item.resource">
>   <map:generate src="news.xml"/>
>   <map:transform src="filter-news-item.xsl">
>     <map:parameter name="news-id"
> value="{coplet:attribute/news-id}/>
>   </map:transform>
>   <map:serialize type="xml/>
> </map:match>
> 
> Any ideas?
> 
> Thanks,
> -Alex
> 
> --- Alex Romayev <ro...@yahoo.com> wrote:
> > Hi Laurent,
> >
> > Thanks again for your help,
> > -Alex
> >
> > ==========================================
> > copletinstancedata/portal.xml:
> >
> > The calling coplet:
> >
> > <coplet-instance-data id="news-summary-1"
> > name="standard">
> >   <coplet-data>news-summary</coplet-data>
> > </coplet-instance-data>
> >
> > The coplet being called, requires news-id parameter
> > (no default):
> > <coplet-instance-data id="news-item-1"
> > name="standard">
> >   <coplet-data>news-item</coplet-data>
> >   <attribute>
> >     <name>news-id</name>
> >     <value
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:type="java:java.lang.String"></value>
> >   </attribute>
> > </coplet-instance-data>
> >
> > ======================================
> > portlets.xmap:
> >
> > <map:match pattern="home/news-summary.portlet">
> >   <map:generate
> > src="cocoon://site/home/news-summary.resource"/>
> >   <map:transform
> >
> src="portal/styles/html/portlets/home/news-summary.xsl">
> >     <map:parameter name="use-request-parameters"
> > value="true"/>
> >   </map:transform>
> >   <map:act type="locale">
> >     <map:transform type="i18n">
> >       <map:parameter name="locale"
> > value="{locale}"/>
> >     </map:transform>
> >   </map:act>
> >   <map:transform type="portal-coplet" />
> >   <map:serialize type="xml"/>
> > </map:match>
> >
> >
> > <map:match pattern="news/news-news-item.portlet">
> >   <map:aggregate element="module">
> >     <map:part
> > src="cocoon://site/content/news.processed.xml"/>
> >     <map:part
> > src="cocoon://site/content/family.processed.xml"/>
> >   </map:aggregate>
> >   <map:transform
> > src="portal/xslt/news/join-with-people.xsl"/>
> >   <map:transform
> > src="portal/xslt/news/news-item.xsl">
> >     <map:parameter name="news-id"
> > value="{coplet:attributes/news-id}"/>
> >   </map:transform>
> >   <map:transform
> >
> src="portal/styles/html/portlets/home/news-summary.xsl"/>
> >   <map:act type="locale">
> >     <map:transform type="i18n">
> >       <map:parameter name="locale"
> > value="{locale}"/>
> >     </map:transform>
> >   </map:act>
> >   <map:transform type="portal-coplet" />
> >   <map:serialize type="xml"/>
> > </map:match>
> >
> > ===============================================
> > news-summary.xsl
> >
> > <cl:links>
> >   <cl:link layout="maintab" value="3"
> > path="aspectDatas/tab"/>
> >   <cl:link layout="newstab" value="2"
> > path="aspectDatas/tab"/>
> >   <cl:link coplet="news-item-1" value="{@id}"
> > path="parameters/news-id"/>
> >   <cl:content>Read more</cl:content>
> > </cl:links>
> >
> > ============================================
> >
> > --- Laurent Trillaud <lt...@jouve.fr> wrote:
> > > Alex
> > > Can you give snippets of your
> > > copletinstancedata/portal.xml file and your
> > > sitemap.xmap?
> > > Laurent
> > >
> > > > -----Message d'origine-----
> > > > De : Alex Romayev [mailto:romayev@yahoo.com]
> > > > Envoyi : mardi 20 janvier 2004 00:21
> > > > @ : users@cocoon.apache.org
> > > > Objet : RE: [portal] Linking to portal pages
> > > >
> > > > Laurent,
> > > >
> > > > I think I'm almost there, however I'm getting an
> > > error
> > > > and I believe it is because I don't quite
> > > understand
> > > > your point #2 and making some mistake there.
> > The
> > > > error that I get is:
> > > >
> > > > org.apache.cocoon.ProcessingException: Failed to
> > > > execute pipeline.:
> > > > org.apache.commons.jxpath.JXPathException:
> > > Exception
> > > > trying to set value with xpath
> > parameters/news-id;
> > > > Cannot set property /parameters/news-id, path
> > does
> > > not
> > > > match a changeable location.
> > > >
> > > > Please see my comments below.
> > > >
> > > > Thanks,
> > > > -Alex
> > > >
> > > >
> > > > --- Laurent Trillaud <lt...@jouve.fr> 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>
> > > >
> > > > OK, I did that -- my coplet instance is named
> > > > "news-item-1" and the attribute "news-id".  I
> > also
> > > > noticed that the sample places the attributes in
> > > > coplet definitions rather than coplet instances,
> > > does
> > > > it matter?
> > > >
> > > > > 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.
> > > >
> > > > I'm not sure what you mean.  In my case I have 2
> > > > coplet instances: news-list-1 and news-item-1.
> > > Each
> > > > item in the news list needs to have a link to
> > the
> > > > corresponding news item.  So I put the above
> > code
> > > in
> > > > the news-list-1 coplet and used the
> > > coplet-transformer
> > > > to generate the ancor tag.
> > > >
> > > > When I click on the generated link, I get the
> > > "path
> > > > does not match a changeable location" error.
> > > >
> > > > 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>
> > > >
> > > > I think this is my case, since my news-list
> > coplet
> > > > needs to call news-item coplet.  Where do I
> > place
> > > > this?
> > > >
> > > > > 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]
> > > > > > Envoyi : 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 <lt...@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
> > > > >
> > > >
> > > >
> > > > =====
> > > > 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
> > >
> >
> >
> > =====
> > 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
> >
> 
> 
> =====
> 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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
OK, I'm almost there!

The reason for the error was that I was using
"parameters/news-id" rather than "attributes/news-id".

Now one question: easier to show with an example:

This works:

<map:match pattern="news-item.portlet">
  <map:generate src="news.xml"/>
  <map:transform src="filter-news-item.xsl">
    <map:parameter name="news-id"
value="{coplet:attribute/news-id}/>
  </map:transform>
  <map:transform src="news-item2html.xsl"/>
  <map:serialize type="xml/>
</map:match>

However, this does't (notice, that the attribute is
being used by another pipeline, which is called by the
coplet pipeline):

<map:match pattern="news-item.portlet">
  <map:generate src="cocoon:/news-item.resouce"/>
  <map:transform src="news-item2html.xsl"/>
  <map:serialize type="xml/>
</map:match>

<map:match pattern="news-item.resource">
  <map:generate src="news.xml"/>
  <map:transform src="filter-news-item.xsl">
    <map:parameter name="news-id"
value="{coplet:attribute/news-id}/>
  </map:transform>
  <map:serialize type="xml/>
</map:match>

Any ideas?

Thanks,
-Alex

--- Alex Romayev <ro...@yahoo.com> wrote:
> Hi Laurent,
> 
> Thanks again for your help,
> -Alex
> 
> ==========================================
> copletinstancedata/portal.xml:
> 
> The calling coplet:
> 
> <coplet-instance-data id="news-summary-1"
> name="standard">
>   <coplet-data>news-summary</coplet-data>
> </coplet-instance-data>
> 
> The coplet being called, requires news-id parameter
> (no default):
> <coplet-instance-data id="news-item-1"
> name="standard">
>   <coplet-data>news-item</coplet-data>
>   <attribute>
>     <name>news-id</name>
>     <value
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="java:java.lang.String"></value>
>   </attribute>    
> </coplet-instance-data>
> 
> ======================================
> portlets.xmap:
> 
> <map:match pattern="home/news-summary.portlet">
>   <map:generate
> src="cocoon://site/home/news-summary.resource"/>
>   <map:transform
>
src="portal/styles/html/portlets/home/news-summary.xsl">
>     <map:parameter name="use-request-parameters"
> value="true"/>
>   </map:transform>
>   <map:act type="locale">
>     <map:transform type="i18n">
>       <map:parameter name="locale"
> value="{locale}"/>
>     </map:transform>
>   </map:act>          
>   <map:transform type="portal-coplet" />          
>   <map:serialize type="xml"/>
> </map:match>
> 
> 
> <map:match pattern="news/news-news-item.portlet">
>   <map:aggregate element="module">
>     <map:part
> src="cocoon://site/content/news.processed.xml"/>
>     <map:part
> src="cocoon://site/content/family.processed.xml"/>
>   </map:aggregate>
>   <map:transform
> src="portal/xslt/news/join-with-people.xsl"/>
>   <map:transform
> src="portal/xslt/news/news-item.xsl">
>     <map:parameter name="news-id"
> value="{coplet:attributes/news-id}"/>
>   </map:transform>
>   <map:transform
>
src="portal/styles/html/portlets/home/news-summary.xsl"/>
>   <map:act type="locale">
>     <map:transform type="i18n">
>       <map:parameter name="locale"
> value="{locale}"/>
>     </map:transform>
>   </map:act>          
>   <map:transform type="portal-coplet" />          
>   <map:serialize type="xml"/>
> </map:match>
> 
> ===============================================
> news-summary.xsl
> 
> <cl:links>
>   <cl:link layout="maintab" value="3"
> path="aspectDatas/tab"/>
>   <cl:link layout="newstab" value="2"
> path="aspectDatas/tab"/>
>   <cl:link coplet="news-item-1" value="{@id}"
> path="parameters/news-id"/>
>   <cl:content>Read more</cl:content>
> </cl:links>
> 
> ============================================
> 
> --- Laurent Trillaud <lt...@jouve.fr> wrote:
> > Alex
> > Can you give snippets of your
> > copletinstancedata/portal.xml file and your
> > sitemap.xmap?
> > Laurent
> > 
> > > -----Message d'origine-----
> > > De�: Alex Romayev [mailto:romayev@yahoo.com]
> > > Envoy�: mardi 20 janvier 2004 00:21
> > > ��: users@cocoon.apache.org
> > > Objet�: RE: [portal] Linking to portal pages
> > > 
> > > Laurent,
> > > 
> > > I think I'm almost there, however I'm getting an
> > error
> > > and I believe it is because I don't quite
> > understand
> > > your point #2 and making some mistake there. 
> The
> > > error that I get is:
> > > 
> > > org.apache.cocoon.ProcessingException: Failed to
> > > execute pipeline.:
> > > org.apache.commons.jxpath.JXPathException:
> > Exception
> > > trying to set value with xpath
> parameters/news-id;
> > > Cannot set property /parameters/news-id, path
> does
> > not
> > > match a changeable location.
> > > 
> > > Please see my comments below.
> > > 
> > > Thanks,
> > > -Alex
> > > 
> > > 
> > > --- Laurent Trillaud <lt...@jouve.fr> 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>
> > > 
> > > OK, I did that -- my coplet instance is named
> > > "news-item-1" and the attribute "news-id".  I
> also
> > > noticed that the sample places the attributes in
> > > coplet definitions rather than coplet instances,
> > does
> > > it matter?
> > > 
> > > > 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.
> > > 
> > > I'm not sure what you mean.  In my case I have 2
> > > coplet instances: news-list-1 and news-item-1. 
> > Each
> > > item in the news list needs to have a link to
> the
> > > corresponding news item.  So I put the above
> code
> > in
> > > the news-list-1 coplet and used the
> > coplet-transformer
> > > to generate the ancor tag.
> > > 
> > > When I click on the generated link, I get the
> > "path
> > > does not match a changeable location" error.
> > > 
> > > 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>
> > > 
> > > I think this is my case, since my news-list
> coplet
> > > needs to call news-item coplet.  Where do I
> place
> > > this?
> > > 
> > > > 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]
> > > > > Envoyi : 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 <lt...@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
> > > >
> > > 
> > > 
> > > =====
> > > 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
> > 
> 
> 
> =====
> 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
> 


=====
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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
Hi Laurent,

Thanks again for your help,
-Alex

==========================================
copletinstancedata/portal.xml:

The calling coplet:

<coplet-instance-data id="news-summary-1"
name="standard">
  <coplet-data>news-summary</coplet-data>
</coplet-instance-data>

The coplet being called, requires news-id parameter
(no default):
<coplet-instance-data id="news-item-1"
name="standard">
  <coplet-data>news-item</coplet-data>
  <attribute>
    <name>news-id</name>
    <value
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="java:java.lang.String"></value>
  </attribute>    
</coplet-instance-data>

======================================
portlets.xmap:

<map:match pattern="home/news-summary.portlet">
  <map:generate
src="cocoon://site/home/news-summary.resource"/>
  <map:transform
src="portal/styles/html/portlets/home/news-summary.xsl">
    <map:parameter name="use-request-parameters"
value="true"/>
  </map:transform>
  <map:act type="locale">
    <map:transform type="i18n">
      <map:parameter name="locale" value="{locale}"/>
    </map:transform>
  </map:act>          
  <map:transform type="portal-coplet" />          
  <map:serialize type="xml"/>
</map:match>


<map:match pattern="news/news-news-item.portlet">
  <map:aggregate element="module">
    <map:part
src="cocoon://site/content/news.processed.xml"/>
    <map:part
src="cocoon://site/content/family.processed.xml"/>
  </map:aggregate>
  <map:transform
src="portal/xslt/news/join-with-people.xsl"/>
  <map:transform src="portal/xslt/news/news-item.xsl">
    <map:parameter name="news-id"
value="{coplet:attributes/news-id}"/>
  </map:transform>
  <map:transform
src="portal/styles/html/portlets/home/news-summary.xsl"/>
  <map:act type="locale">
    <map:transform type="i18n">
      <map:parameter name="locale" value="{locale}"/>
    </map:transform>
  </map:act>          
  <map:transform type="portal-coplet" />          
  <map:serialize type="xml"/>
</map:match>

===============================================
news-summary.xsl

<cl:links>
  <cl:link layout="maintab" value="3"
path="aspectDatas/tab"/>
  <cl:link layout="newstab" value="2"
path="aspectDatas/tab"/>
  <cl:link coplet="news-item-1" value="{@id}"
path="parameters/news-id"/>
  <cl:content>Read more</cl:content>
</cl:links>

============================================

--- Laurent Trillaud <lt...@jouve.fr> wrote:
> Alex
> Can you give snippets of your
> copletinstancedata/portal.xml file and your
> sitemap.xmap?
> Laurent
> 
> > -----Message d'origine-----
> > De�: Alex Romayev [mailto:romayev@yahoo.com]
> > Envoy�: mardi 20 janvier 2004 00:21
> > ��: users@cocoon.apache.org
> > Objet�: RE: [portal] Linking to portal pages
> > 
> > Laurent,
> > 
> > I think I'm almost there, however I'm getting an
> error
> > and I believe it is because I don't quite
> understand
> > your point #2 and making some mistake there.  The
> > error that I get is:
> > 
> > org.apache.cocoon.ProcessingException: Failed to
> > execute pipeline.:
> > org.apache.commons.jxpath.JXPathException:
> Exception
> > trying to set value with xpath parameters/news-id;
> > Cannot set property /parameters/news-id, path does
> not
> > match a changeable location.
> > 
> > Please see my comments below.
> > 
> > Thanks,
> > -Alex
> > 
> > 
> > --- Laurent Trillaud <lt...@jouve.fr> 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>
> > 
> > OK, I did that -- my coplet instance is named
> > "news-item-1" and the attribute "news-id".  I also
> > noticed that the sample places the attributes in
> > coplet definitions rather than coplet instances,
> does
> > it matter?
> > 
> > > 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.
> > 
> > I'm not sure what you mean.  In my case I have 2
> > coplet instances: news-list-1 and news-item-1. 
> Each
> > item in the news list needs to have a link to the
> > corresponding news item.  So I put the above code
> in
> > the news-list-1 coplet and used the
> coplet-transformer
> > to generate the ancor tag.
> > 
> > When I click on the generated link, I get the
> "path
> > does not match a changeable location" error.
> > 
> > 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>
> > 
> > I think this is my case, since my news-list coplet
> > needs to call news-item coplet.  Where do I place
> > this?
> > 
> > > 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]
> > > > Envoyi : 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 <lt...@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
> > >
> > 
> > 
> > =====
> > 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
> 


=====
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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
Alex
Can you give snippets of your copletinstancedata/portal.xml file and your
sitemap.xmap?
Laurent

> -----Message d'origine-----
> De : Alex Romayev [mailto:romayev@yahoo.com]
> Envoyé : mardi 20 janvier 2004 00:21
> À : users@cocoon.apache.org
> Objet : RE: [portal] Linking to portal pages
> 
> Laurent,
> 
> I think I'm almost there, however I'm getting an error
> and I believe it is because I don't quite understand
> your point #2 and making some mistake there.  The
> error that I get is:
> 
> org.apache.cocoon.ProcessingException: Failed to
> execute pipeline.:
> org.apache.commons.jxpath.JXPathException: Exception
> trying to set value with xpath parameters/news-id;
> Cannot set property /parameters/news-id, path does not
> match a changeable location.
> 
> Please see my comments below.
> 
> Thanks,
> -Alex
> 
> 
> --- Laurent Trillaud <lt...@jouve.fr> 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>
> 
> OK, I did that -- my coplet instance is named
> "news-item-1" and the attribute "news-id".  I also
> noticed that the sample places the attributes in
> coplet definitions rather than coplet instances, does
> it matter?
> 
> > 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.
> 
> I'm not sure what you mean.  In my case I have 2
> coplet instances: news-list-1 and news-item-1.  Each
> item in the news list needs to have a link to the
> corresponding news item.  So I put the above code in
> the news-list-1 coplet and used the coplet-transformer
> to generate the ancor tag.
> 
> When I click on the generated link, I get the "path
> does not match a changeable location" error.
> 
> 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>
> 
> I think this is my case, since my news-list coplet
> needs to call news-item coplet.  Where do I place
> this?
> 
> > 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]
> > > Envoyi : 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 <lt...@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
> >
> 
> 
> =====
> 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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
Laurent,

I think I'm almost there, however I'm getting an error
and I believe it is because I don't quite understand
your point #2 and making some mistake there.  The
error that I get is:

org.apache.cocoon.ProcessingException: Failed to
execute pipeline.:
org.apache.commons.jxpath.JXPathException: Exception
trying to set value with xpath parameters/news-id;
Cannot set property /parameters/news-id, path does not
match a changeable location.

Please see my comments below.

Thanks,
-Alex


--- Laurent Trillaud <lt...@jouve.fr> 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>

OK, I did that -- my coplet instance is named
"news-item-1" and the attribute "news-id".  I also
noticed that the sample places the attributes in
coplet definitions rather than coplet instances, does
it matter?

> 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. 

I'm not sure what you mean.  In my case I have 2
coplet instances: news-list-1 and news-item-1.  Each
item in the news list needs to have a link to the
corresponding news item.  So I put the above code in
the news-list-1 coplet and used the coplet-transformer
to generate the ancor tag.

When I click on the generated link, I get the "path
does not match a changeable location" error.

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>

I think this is my case, since my news-list coplet
needs to call news-item coplet.  Where do I place
this?

> 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 <lt...@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
> 


=====
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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
Hi Laurent,

Thanks very much for your help.  This makes sense. 
I'm going to play around with it.

Thanks,
-Alex

--- Laurent Trillaud <lt...@jouve.fr> 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>
> 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 <lt...@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
> 


=====
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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
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 <lt...@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


RE: [portal] Linking to portal pages

Posted by Alex Romayev <ro...@yahoo.com>.
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 <lt...@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]
> > Envoy�: 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


RE: [portal] Linking to portal pages

Posted by Laurent Trillaud <lt...@jouve.fr>.
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]
> Envoyé : 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