04-21-2006 06:10 PM
<tag>
<name>hasAspectEvaluator</name>
<tag-class>com.tsgrp.alfresco.web.ui.common.tag.evaluator.HasAspectEvaluatorTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>binding</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>condition</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
public class HasAspectEvaluator extends BaseEvaluator
{
/**
* the string condition to match value against
*/
private String condition = null;
/**
* Evaluate against the component attributes. Return true to allow the inner
* components to render, false to hide them during rendering.
*
* @return true to allow rendering of child components, false otherwise
*/
public boolean evaluate()
{
FacesContext context = FacesContext.getCurrentInstance();
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
boolean result = false;
try
{
result = nodeService.hasAspect((NodeRef)getValue(), Repository.resolveToQName(getCondition()));
}
catch (Exception err)
{
// return default value on error
s_logger.debug("HasAspectEvaluator error : " + getValue());
}
return result;
}
/**
* @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
*/
public void restoreState(FacesContext context, Object state)
{
Object values[] = (Object[]) state;
// standard component attributes are restored by the super class
super.restoreState(context, values[0]);
this.condition = (String) values[1];
}
/**
* @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
*/
public Object saveState(FacesContext context)
{
Object values[] = new Object[2];
// standard component attributes are saved by the super class
values[0] = super.saveState(context);
values[1] = this.condition;
return (values);
}
public String getCondition()
{
ValueBinding vb = getValueBinding("condition");
if (vb != null)
{
this.condition = (String) vb.getValue(getFacesContext());
}
return this.condition;
}
public void setCondition(String condition)
{
this.condition = condition;
}
}
17:04:39,536 ERROR [[localhost].[/connectsite].[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /jsp/browse/browse.jsp(675,4) Unable to find setter method for attribute: condition
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
at org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2709)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2857)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2176)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1685)
<t:hasAspectEvaluator value="#{r}" condition="tsg:faxDoc">
<r:permissionEvaluator value="#{r}" allow="ChangePermissions">
<a:actionLink value="#{msg.manage_content_users}" image="/images/icons/invite.gif"
action="dialog:manageContentUsers" actionListener="#{BrowseBean.setupContentAction}">
<f:param name="id" value="#{r.id}"/>
</a:actionLink>
</r:permissionEvaluator>
</t:hasAspectEvaluator>
04-24-2006 04:29 AM
04-24-2006 04:30 AM
04-24-2006 02:19 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.