public class UpgradeContentAspects extends AbstractModuleComponent {
private NodeService nodeService;
private SearchService searchService;
private CheckOutCheckInService checkOutCheckInService;
private PermissionService permissionService;
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
public void setSearchService(SearchService searchService)
{
this.searchService = searchService;
}
public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
{
this.checkOutCheckInService = checkOutCheckInService;
}
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
@Override
protected void executeInternal() throws Throwable
{
info("Upgrade is being processing…", null);
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
DynamicNamespacePrefixResolver namespacePrefixResolver = new DynamicNamespacePrefixResolver(null);
//namespacePrefixResolver.registerNamespace(NamespaceService.SYSTEM_MODEL_PREFIX, NamespaceService.SYSTEM_MODEL_1_0_URI);
namespacePrefixResolver.registerNamespace(NamespaceService.CONTENT_MODEL_PREFIX, NamespaceService.CONTENT_MODEL_1_0_URI);
namespacePrefixResolver.registerNamespace(OldContentModel.LPR_CONTENT_PREFIX, OldContentModel.NAMESPACE);
NodeRef rootNodeRef = nodeService.getRootNode(storeRef);
//
// Upgrade Draft
//
ContentUpgrade(rootNodeRef, namespacePrefixResolver, CommunityConstante.STATUS_DRAFT);
//
// Upgrade Approval
//
ContentUpgrade(rootNodeRef, namespacePrefixResolver, CommunityConstante.STATUS_APPROVAL);
//
// Upgrade Approved
//
ContentUpgrade(rootNodeRef, namespacePrefixResolver, CommunityConstante.STATUS_APPROVED);
//
// Upgrade Archived
//
ContentUpgrade(rootNodeRef, namespacePrefixResolver, CommunityConstante.STATUS_ARCHIVED);
//
// Upgrade Quality
//
ContentUpgrade(rootNodeRef, namespacePrefixResolver, CommunityConstante.STATUS_QUALITY);
info("Upgrade completed.", null);
}
…
}
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<import resource="classpath:alfresco/module/upgradeContentAspects/context/service-context.xml" />
</beans>
# Upgrade Aspects module
module.id=upgradeContentAspects
module.title=upgrade Content Aspects AMP Project
module.description=Upgrade Content Aspects on repository
module.version=1.0
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Import the Alfresco nitty gritty –>
<!–import resource="classpath:alfresco/application-context.xml" /–>
<!– A simple module component that will be executed once –>
<bean id="upgradeContentAspect.upgradeComponent" class="org.alfresco.community.module.upgradecontent.UpgradeContentAspects" parent="module.baseComponent" >
<property name="moduleId" value="upgradeContentAspects" /> <!– See module.properties –>
<property name="name" value="upgradeComponent" />
<property name="description" value="An upgrade component" />
<property name="sinceVersion" value="1.0" />
<property name="appliesFromVersion" value="1.0" />
<property name="nodeService">
<ref bean="nodeService" />
</property>
<property name="searchService">
<ref bean="searchService" />
</property>
<property name="checkOutCheckInService">
<ref bean="checkOutCheckInService" />
</property>
<property name="permissionService">
<ref bean="permissionService" />
</property>
</bean>
</beans>
<property name="executeOnceOnly" value="false" />
cela forcerait a exécuter votre module à chaque redémarrage.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.