cancel
Showing results for 
Search instead for 
Did you mean: 

Extract Edit Category tool

mesa2e
Champ in-the-making
Champ in-the-making
Hi,

I need to extract Categorizing tool from the view details panel to the Content Items panel, so..in the actions group.
I copy the following code from document_details.jsp to browse.jsp:

<div style="padding:4px"></div>

<hSmiley TongueanelGroup id="category-panel-facets">
<f:facet name="title">
<rSmiley TongueermissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
<a:actionLink id="titleLink3b" value="#{msg.change_category}" showLink="false" image="/images/icons/Change_details.gif"
action="editCategories" actionListener="#{DocumentDetailsBean.setupCategoriesForEdit}" />
</rSmiley TongueermissionEvaluator>
</f:facet>
</hSmiley TongueanelGroup>
<aSmiley Tongueanel label="#{msg.category}" id="category-panel" facetsId="category-panel-facets" progressive="true"
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" rendered="#{DocumentDetailsBean.categorised}"
expanded='#{DocumentDetailsBean.panels["category-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<hSmiley SurprisedutputText id="category-overview" value="#{DocumentDetailsBean.categoriesOverviewHTML}"
escape="false" />
</aSmiley Tongueanel>
<aSmiley Tongueanel label="#{msg.category}" id="no-category-panel" progressive="true"
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
rendered="#{DocumentDetailsBean.categorised == false}"
expanded='#{DocumentDetailsBean.panels["category-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<hSmiley SurprisedutputText id="no-category-msg" value="#{msg.not_in_category}<br/><br/>"
escape="false"/>
<rSmiley TongueermissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="eval_cat">
<a:actionLink id="make-classifiable" value="#{msg.allow_categorization}"
action="#{DocumentDetailsBean.applyClassifiable}"
rendered="#{DocumentDetailsBean.locked == false}" />
</rSmiley TongueermissionEvaluator>
</aSmiley Tongueanel>


The application returns the following error:

javax.faces.el.EvaluationException: Cannot get value for expression '#{DocumentDetailsBean.categorised}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property categorised of base of type : org.alfresco.web.bean.DocumentDetailsBean
caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.DocumentDetailsBean, property: categorised
caused by:
java.lang.reflect.InvocationTargetException
caused by:
java.lang.NullPointerException

Any ideas?

Thanks and regards,
Elena.
1 REPLY 1

dgenard
Champ on-the-rise
Champ on-the-rise
Unfortunately, it's not so simple.

DocumentDetailsBean is not known on browse.jsp.
You may try to extend the browse.jsp backing bean (named BrowseBean) to add method related to categories. Look at http://wiki.alfresco.com/wiki/Adding_a_Custom_Dialog for a related example.

But editing categories directly from browse.jsp will probably won't be easy without JSF knowledge…

Denis