cancel
Showing results for 
Search instead for 
Did you mean: 

Taglibs and browse.jsp extension

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all!

I need to extend the browse.jsp to change the way some special content is opened.
This is a common page for all the spaces and content, so I need to be able to identify when the content of my own type is shown.

Easily, I got the way to identify the parent space containing the current spaces and content, using:
<c:set value="${NavigationBean.currentNode.type}" var="tipoExp"/>
<c:set value="${tipoExp == '{http://www.sos.com/model/content/1.0}mySpace'}" var="folderMySpace"/>

On the other hand, through the "r" variable i can retrieve the properties of the spaces that are drawn in the JSP: ${r.type}
Because of:
<%– Spaces List –%>
<a:richList id="spacesList" binding="#{BrowseBean.spacesRichList}" viewMode="#{BrowseBean.browseViewMode}" pageSize="#{BrowseBean.pageSizeSpaces}"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{BrowseBean.nodes}" var="r">


But in the bottom part of the JSP, after this tag:
<%– Content list –%>
<a:richList id="contentRichList" binding="#{BrowseBean.contentRichList}" viewMode="#{BrowseBean.browseViewMode}" pageSize="#{BrowseBean.pageSizeContent}"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
value="#{BrowseBean.content}" var="r">

"r" variable is still refering to the space object!! ${r.name} will show the last space's name that has been drawn instead of the content name. Although, the following tags use correctly this variable:
<a:actionLink id="col10-act1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.fileType16}" showLink="false" styleClass="inlineAction" />

Please, how can I identify each content type of the documents that are rendered??
I would need to specify an actionLink or another according to the document's type.

Many thanks!
9 REPLIES 9

tara_b
Champ in-the-making
Champ in-the-making
I'm also interested in this, as i would like to display the Author in the 'Icon View', but #{r.author} does not exist.

jayjayecl
Confirmed Champ
Confirmed Champ
"r.nodes" refers to subspaces, and "r.content" refers to content items.

Try r.properties.author (or r.properties['cm:author'])

tara_b
Champ in-the-making
Champ in-the-making
Thanks for your reply.

I've tried many different combinations but i still cant see anything for author. This is what i have currently:

<%– Author column for all view modes –%>
<a:column id="col13" style="text-align:left" rendered="#{BrowseBean.browseViewMode == 'icons'}">
<f:facet name="header">
<a:sortLink id="col13-sort" label="#{msg.author}" value="author" styleClass="header"/>
</f:facet>
<h:outputText id="col13-txt" value="#{r.properties.author}" />
</a:column>

If i write the following i see "Author: " , so it is picking up the file.

<%– Author column for all view modes –%>
<a:column id="col13" style="text-align:left" rendered="#{BrowseBean.browseViewMode == 'icons'}">
<f:facet name="header">
<a:sortLink id="col13-sort" label="#{msg.author}" value="author" styleClass="header"/>
</f:facet>
<h:outputText id="col13-txt" value="Author: #{r.properties.author}" />
</a:column>

Do you have any other suggestions? Thanks!

tara_b
Champ in-the-making
Champ in-the-making
<hSmiley SurprisedutputText id="col13-txt" value="#{r.properties[\"cm:author\"]}" />

This worked!

I'm now trying to get properties from my custom content model Smiley Happy

tara_b
Champ in-the-making
Champ in-the-making
Custom content model is done using:

<h:outputText id="col13-txt" value="#{r.properties[\"mx:keywords\"]}" />

Smiley Happy

jayjayecl
Confirmed Champ
Confirmed Champ
Tara_B,

you could have avoid escaping the double quotes by using what I said :


(or r.properties['cm:author'])

sergi_l
Champ on-the-rise
Champ on-the-rise
But… what about the document type?

Following the Tara_B example, how could I show or hide the "cm:author" property according to the document type? 
That's what I need and I have no idea how to get it.

<c:set value="${currentDocumentType == '{http://www.sos.com/model/content/1.0}myDocTypeA'}" var="typeA"/>

<c:if test="${typeA}">
<hSmiley SurprisedutputText id="col13-txt" value="#{r.properties[\"cm:author\"]}" />
</c:if>
<c:if test="${!typeA}">
<hSmiley SurprisedutputText id="col13-txt" value="#{r.properties[\"mx:keywords\"]}" />
</c:if>

How to get the document type of each document that is being drawn??
Many thanks!
Sergi

jayjayecl
Confirmed Champ
Confirmed Champ
I think you'd rather customize the "BrowseBean.java" class (implementing your own), and write a little bit of code in getContent method

It will be much easier

tara_b
Champ in-the-making
Champ in-the-making
(or r.properties['cm:author'])

Oh yes, you're right. I did try that from your last post, but at the time i didnt have any author information inputted into my model!  :lol: