cancel
Showing results for 
Search instead for 
Did you mean: 

[Resolved] Custom properties of a document

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

:arrow: The Goal
I try to change the properties (details) pages for a document. I can do and it work if I change the /jsp/content/document-details.jsp.
I would like to set the path(s) which aim to "/jsp/content/document-details.jsp" to "/jsp/extension/document-details.jsp"

:arrow: How to do and my problem :
The documentation says that we have to modify the "faces-config.xml" http://wiki.alfresco.com/wiki/Customising_An_Alfresco_JSP#Overriding_the_navigation_rules, it doesn't work for me.

If I look the file to specified (/WEB-INF/faces-config-navigation.xml) comments shows information about "showDocDetails", which  could point to "/jsp/content/document-details.jsp" :
…<!– Browse screen action outcomes –>
   <navigation-rule>
      <from-view-id>/jsp/browse/browse.jsp</from-view-id>
      <!– showDocDetails and showSpaceDetails moved to /jsp/* above –>


:arrow: My conclusion :

I think that the specification of the path to "/jsp/content/document-details.jsp" has changed but not the documentation.

One people has done that like that : http://www.wowww.nl/wordpress/?p=69, but he also needs to change manualy the "/jsp/content/document-details.jsp" to works with recent version of Alfresco.  Annonce that he needs to change manualy :
I could not get Alfresco to see the new jsp in the extensions directory (alfresco.war\jsp\extension), so I just updated the original jsp (alfresco.war\jsp\content).
:arrow: One solution

I have search and find that the file giving the path is web-client-config-dialogs.xml. I can change inside this path and it works.

<dialog name="showDocDetails" page="/jsp/content/document-details.jsp" managed-bean="DocumentDetailsDialog"
                 icon="/images/icons/details_large.gif" title-id="details_of" description-id="documentdetails_description" show-ok-button="false"
                 error-message-id="empty_message" />
:arrow: Need confirmation
Do I create a web-client-config-dialogs-custom.xml in my module to specify that properties details are in "/jsp/extension/document-details.jsp".  :?:
Is This part of documentation depreciated http://wiki.alfresco.com/wiki/Customising_An_Alfresco_JSP#Overriding_the_navigation_rules :?:

Thanks
3 REPLIES 3

dranakan
Champ on-the-rise
Champ on-the-rise
From another post about this one :
are you patching Alfresco as an AMP module ?
Then (I know that won't solve your problem), best practices are not to edit faces-config-[repo/beans/navigation/…].xml files, but do your own configuration in faces-config-custom.xml (which is loaded last on bootstrap).

Yes I use inside a AMP module. I have used faces-config-custom.xml (in WEB-INF) and faces-config.xml (in the META-INF, inside the jar file).

dranakan
Champ on-the-rise
Champ on-the-rise
It's not like the documentation… but it's work.
If you have any problem to change navigation rules with an AMP module. Do it :

Example with workflow history from http://www.wowww.nl/wordpress/?p=69 (redirect the document's details to jsp "/jsp/extension/document-details.jsp")


:arrow: Faces-config-custom.xml
(nothing inside, I had problem with it. I put all content (managed beans) in the faces-config.xml. Documentation say to put managed beans in this file
empty

:arrow: Faces-config.xml
This one is in the JAR in directory "/META-INF/"
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
         <managed-bean>
      <managed-bean-name>HspWorkflowBean</managed-bean-name>
      <managed-bean-class>YOURPATH.beans.HspWorkflowBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
         <property-name>navigationBean</property-name>
         <value>#{NavigationBean}</value>
      </managed-property>
      <managed-property>
         <property-name>documentDetailsBean</property-name>
         <value>#{DocumentDetailsDialog}</value>
      </managed-property>
      <managed-property>
         <property-name>nodeService</property-name>
         <value>#{NodeService}</value>
      </managed-property>
      <managed-property>
         <property-name>workflowService</property-name>
         <value>#{WorkflowService}</value>
      </managed-property>
   </managed-bean>
</faces-config>

:arrow: Web-client-custom.xml (or web-client-config-custom.xml)
This file was not used in the woww's example.
<alfresco-config>
   <!–
      ******************************************************
      **************** Navigation rules *******************
      ******************************************************
   –>
   <config>
      <dialogs>
         <dialog name="showDocDetails" page="/jsp/extension/document-details.jsp"
            managed-bean="DocumentDetailsDialog" icon="/images/icons/details_large.gif"
            title-id="details_of" description-id="documentdetails_description"
            show-ok-button="false" error-message-id="empty_message" />
      </dialogs>
   </config>
   <config evaluator="node-type" condition="app:filelink">
      <navigation>
         <override from-view-id="/jsp/extension/document-details.jsp" to-view-id="/jsp/content/filelink-details.jsp" />
         <override from-outcome="showDocDetails" to-view-id="/jsp/content/filelink-details.jsp" />
         <override from-outcome="cancelEdit" to-view-id="/jsp/content/filelink-details.jsp" />
         <override from-outcome="finishEdit" to-view-id="/jsp/content/filelink-details.jsp" />
      </navigation>
   </config>
….

Works with Alfresco 3.0 Labs and Alfresco 3.2 CE. (I have done basic tests, just click on properties documents. Perhaps it's good idea to do more tests like coming on this page from another way…)

jayjayecl
Confirmed Champ
Confirmed Champ
Well done !

You're right, I totally forgot about this tricky part on "overriding beans / overriding navigation rules"