cancel
Showing results for 
Search instead for 
Did you mean: 

Problems creating a new action!!

rcortesr
Star Contributor
Star Contributor
Hi,

I have created a new Actions for a document in the Browse screen (in web-client-config-actions.xml):
 <action-group id="document_browse">
            <show-link>false</show-link>
            <style-class>inlineAction</style-class>
           
            <action idref="edit_doc_http" />
            <action idref="edit_doc_webdav" />
            <action idref="edit_doc_cifs" />
            <action idref="checkout_doc" />
            <action idref="checkin_doc" />
            <action idref="details_doc" />
            <action idref="preview_doc" />
            <action idref="cat_doc" /> <!– new action –>
</action-group>

With this action I want to add a category to a document. The code of this action is the following:
 <action id="cat_doc">
            <label-id>etiquetar</label-id>
            <image>/images/icons/category_small.gif</image>
            <action-listener>#{BrowseBean.setupContentAction}</action-listener>
            <action>addCategory</action>
</action>

When I click the icon does not appear to me nothing.
Somebody knows what is the problem?

Thanks
5 REPLIES 5

kevinr
Star Contributor
Star Contributor
You specify the following JSF navigation action:

<action>addCategory</action>
The issue here is that this JSF navigation case can only be launched from the categories jsp page. As per the faces-config-navigation.xml:

   <!– Categories screen action outcomes –>
   <navigation-rule>
      <from-view-id>/jsp/categories/*</from-view-id>
      <navigation-case>
         <from-outcome>addCategory</from-outcome>
         <to-view-id>/jsp/categories/new-category.jsp</to-view-id>
      </navigation-case>
      …
The from-view-id element specifies the match for the source jsp pages that can launch the addCategory page. You can change this to:

      <from-view-id>/jsp/*</from-view-id>
But you may find that the dialog does not work outside of the categories list screen (it is expecting some context).

Thanks,

Kevin

rcortesr
Star Contributor
Star Contributor
Hi,

Now I have launched link-category.jsp from my button. When click the button apears to me the following errors:
javax.faces.FacesException: Cannot get value for expression '#{WizardManager.title}'

caused by:
org.apache.jasper.JasperException: Cannot get value for expression '#{WizardManager.title}'

caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{WizardManager.title}'

caused by:
javax.faces.el.EvaluationException: org.alfresco.web.bean.wizard.WizardManager

caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.wizard.WizardManager, property: title

caused by:
java.lang.reflect.InvocationTargetException

caused by:
java.lang.NullPointerException

I think that I need to set the title of the document.
How I can do it?

Thanks.

kevinr
Star Contributor
Star Contributor
Your action needs to launch the web-client wizard framework correctly using the 'wizard:' prefix:

<action>wizard:addCategory</action>

Thanks,

Kevin

rcortesr
Star Contributor
Star Contributor
Your action needs to launch the web-client wizard framework correctly using the 'wizard:' prefix:

<action>wizard:addCategory</action>

Thanks,

Kevin

I have resolved the problem with addCategory.
My problem appears when I use link-category.jsp
This is my navigation rule:
   <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>linkCat</from-outcome>
         <to-view-id>/jsp/actions/link-category.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

This is my web client:
         <action id="cat_doc">
            <label-id>etiquetar</label-id>
            <image>/images/icons/category_small.gif</image>
            <action-listener>#{BrowseBean.setupContentAction}</action-listener>
            <action>linkCat</action>
         </action>

I have use your solution but the problem persists.

Thanks.

gavinc
Champ in-the-making
Champ in-the-making
The problem is that you are trying to use a page designed to be used within a wizard outside of a wizard.

The page does not have the correct context setup to work properly, hence the error.

Your best bet is to either copy the JSP to your own folder and adjust your navigation rule to call that or you could use the edit-category.jsp page in the /jsp/dialog folder.