02-21-2011 05:24 AM
package org.alfresco.sample
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase
Puis j'ai défini la classe (en reprenant exactement la même que sur le lien).02-21-2011 11:49 AM
02-22-2011 04:34 AM
package org.alfresco.sample;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
public class TagActionExecuter extends ActionExecuterAbstractBase
{
public static final String NAME = "tag";
private NodeService nodeService;
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
if (this.nodeService.exists(actionedUponNodeRef) == true)
{
// add the aspect if it is not already present on the node
QName tagAspect = QName.createQName("extension.tags", "taggable");
if (this.nodeService.hasAspect(actionedUponNodeRef, tagAspect) == false)
{
this.nodeService.addAspect(actionedUponNodeRef, tagAspect, null);
}
}
}
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
// there are no parameters
}
}
02-23-2011 05:39 AM
package org.alfresco.sample;
import java.util.List;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
public class TagActionExecuter extends ActionExecuterAbstractBase {
public static final String NAME = "tag";
private NodeService nodeService;
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
if (this.nodeService.exists(actionedUponNodeRef) == true)
{
// add the aspect if it is not already present on the node
QName tagAspect = QName.createQName("extension.tags", "taggable");
if (this.nodeService.hasAspect(actionedUponNodeRef, tagAspect) == false)
{
this.nodeService.addAspect(actionedUponNodeRef, tagAspect, null);
}
}
}
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
// there are no parameters
}
}
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="tag" class="org.alfresco.sample.TagActionExecuter" parent="action-executer" >
<property name="nodeService">
<ref bean="nodeService" />
</property>
</bean>
</beans>
02-23-2011 11:13 AM
public String getJSPPath()
{
return "/jsp/extension/tag.jsp";
}
Ma question doit être très simple et clair pour qqu'un qui a déja fait ça: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.