<config evaluator="aspect-name" condition="mon:aspect1" condition="mon:aspect2">
<property-sheet>
…
</property-sheet>
</config>
au lieu d'avoir simplement :<config evaluator="aspect-name" condition="mon:aspect1">
<property-sheet>
…
</property-sheet>
</config>
Le but de cela serait d'avoir un affichage différent des méta-données lorsque j'ai à la fois l'aspect1 et l'aspect2. <alfresco-config>
<plug-ins>
<evaluators>
<evaluator id="node-type" class="org.alfresco.web.config.NodeTypeEvaluator" />
<evaluator id="aspect-name" class="org.alfresco.web.config.AspectEvaluator" />
</evaluators>
<element-readers>
Et voici un exemple de classe:/**
* Evaluator that determines whether a given object has a particular aspect applied
*
* @author gavinc
*/
public final class AspectEvaluator implements Evaluator
{
/**
* Determines whether the given aspect is applied to the given object
*
* @see org.alfresco.config.evaluator.Evaluator#applies(java.lang.Object, java.lang.String)
*/
public boolean applies(Object obj, String condition)
{
boolean result = false;
if (obj instanceof Node)
{
Set aspects = ((Node)obj).getAspects();
if (aspects != null)
{
QName spaceQName = Repository.resolveToQName(condition);
result = aspects.contains(spaceQName);
}
}
return result;
}
}
Inspirez vous de cette exemple.Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.