cancel
Showing results for 
Search instead for 
Did you mean: 

Change content's properties shown when browsing spaces?

zinformatica
Champ in-the-making
Champ in-the-making
Hello there

I'd like to know, whether it is posible or not to change the displayed properties for contents shown when you are browsing through spaces in Alfresco, and if it is possible, where should i change that?

I've been looking through the jsp files and the web client xml files, with no luck

Thanks a lot
Nicolás
9 REPLIES 9

armedia
Champ in-the-making
Champ in-the-making
If your looking to modify the default properties displayed for the content, you can take a hack on browse.jsp.

zinformatica
Champ in-the-making
Champ in-the-making
Are you sure? can you give me an example of what should I add in that file in order to view another content propertie?
Thanks!
Nicolás

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Can you say first what do you  want to change?
Then we will give you solution or pointers how to do that.

zinformatica
Champ in-the-making
Champ in-the-making
When I browse for content in Alfresco web interface, i want to see just below the icon of each file stored in alfresco, the following properties asociated with that content:
Content's title
Content's author(s)
And show our own defined modification date instead of Alfresco Content model's modification date

Thanks!
Nicolás

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
well you just change jsp/browse.jsp

find column and put

r.title
r.author
r.customdate

jayjayecl
Confirmed Champ
Confirmed Champ
r.customDate
won't probably work as easily, as there are no propertyResolvers defined for this property.
To display custom metadata, either you user r.properties["my:customprop"], either you fork BrowseBean.java to define and add new propertyResolvers to the content items displayed.
Hope this helps

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Well, you override BrowseBean and add property resolover.

addPropertyResolver("createdsort", resolverCreated);

public NodePropertyResolver resolverCreated = new NodePropertyResolver() {
   @SuppressWarnings("deprecation")
   public Object get(Node node) {
   
   return node.getProperties().get("created");
   

   }

    };
I did not know that does not work like that. hire is solution.
and you can use other one with properties part.

also for date use :
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />

zinformatica
Champ in-the-making
Champ in-the-making
well you just change jsp/browse.jsp

find column and put

r.title
r.author
r.customdate

Sorry for my ignorance, but still don´t get it, there are various "columns" lite these in browse.jsp:


<%– Primary column for icons view mode –%>
<a:column id="col11" primary="true" style="padding:2px;text-align:left;vertical-align:top;" rendered="#{BrowseBean.browseViewMode == 'icons'}">
<f:facet name="large-icon">
<a:actionLink id="col11-act1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.fileType32}" showLink="false" styleClass="inlineAction" />
</f:facet>
<a:actionLink id="col11-act2" value="#{r.name}" href="#{r.url}" target="new" styleClass="header" />
<r:lockIcon id="col11-lock" value="#{r.nodeRef}" align="absmiddle" />
<h:outputLabel id="col11-lang" value="#{r.lang}" styleClass="langCode" rendered="#{r.lang != null}"/>
<r:nodeInfo id="col11-info" value="#{r.id}">
<h:graphicImage id="col11-img" url="/images/icons/popup.gif" styleClass="popupImage" width="16" height="16" />
</r:nodeInfo>
</a:column>

what should I edit?
thanks
Nicolás

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Well that code is:

<%– Primary column for icons view mode –%>
<a:column id="col11" primary="true" style="padding:2px;text-align:left;vertical-align:top;" rendered="#{BrowseBean.browseViewMode == 'icons'}">
//render column if view mode is icons
<f:facet name="large-icon">
//facet large icon , this is icon on the left .
<a:actionLink id="col11-act1" value="#{r.name}" href="#{r.url}" target="new" image="#{r.fileType32}" showLink="false" styleClass="inlineAction" />
//as you see you only see image not link, becaues of show link false
</f:facet>
<a:actionLink id="col11-act2" value="#{r.name}" href="#{r.url}" target="new" styleClass="header" />
//this is where name is shown
<r:lockIcon id="col11-lock" value="#{r.nodeRef}" align="absmiddle" />
//lock icon
<h:outputLabel id="col11-lang" value="#{r.lang}" styleClass="langCode" rendered="#{r.lang != null}"/>
<r:nodeInfo id="col11-info" value="#{r.id}">
<h:graphicImage id="col11-img" url="/images/icons/popup.gif" styleClass="popupImage" width="16" height="16" />
</r:nodeInfo>
//this is info


after I have explained you all parts of primary column let me tell you what you have to do:
you have to find column in witch created date is shown , copy paste it, change the id's and shange value part in that column using 2 ways , one with overriding Browse bean and other with properties part.
This way you would add columnt.


find the code that looks like this:
                                                 <a:column id="col6" style="text-align:left" //YOU CHANGE ID'S, BECAUSE JSF ERRORS
                        rendered="#{BrowseBean.browseViewMode == 'details'}">//ALSO PAY ATENCION ON RENDERED PART OF COLUMN
                        <f:facet name="header">
                           <a:sortLink id="col6-sort" label="#{msg.created}"
                              value="createdsort" styleClass="header" />
                        </f:facet>
                        <h:outputText id="col6-txt" value="#{r.created}">YOU CHANGE THIS PART, VALUE PART TO SHOW YOUR CUSTOM PROPERTIE
                           <a:convertXMLDate type="both" //THIS IS USED TO CONVERT DATE TO NICE DATE TIME FORMAT
                              pattern="#{msg.date_time_pattern}" />//DATE_TIME_PATTERN IS USED FROM MESSAGES FOR CURRENT LANGUAGE.
                        </h:outputText>
                     </a:column>

i hope that you will be able to manage your problem.