Suppression espace

cancel
Showing results for 
Search instead for 
Did you mean: 
hlander10
Member II

Suppression espace

Bonjour,

J'ai un espace A avec N espaces dessous, qui contiennent tous un aspect identique et des règles en javascript.

Je n'arrive jamais quelque soit la version d'alfresco a supprimer l'espace A, avec tous ce qu'il contient. J'obtiens :

Veuillez corriger les erreurs ci-dessous puis cliquez sur OK.
Impossible de supprimer l'Espace suite à une erreur système :

SI par contre je supprimer tous les règles une à une de l'ensemble des espaces alors ça fonctionne mais N = presque 30 espaces donc c'est très chi…..

Avez vous une idée ou suggestion.

Merci
10 Replies
jayjayecl
Active Member II

Re: Suppression espace

Pourriez-vous fournir la trace de logs (alfresco.log, catalina.out) qui apparait avec l'erreur ?
hlander10
Member II

Re: Suppression espace

Alfresci.log

09:21:37,343 ERROR [org.alfresco.web.ui.common.Utils] Impossible de supprimer l'Espace suite à une erreur système :
java.lang.IllegalArgumentException: Class {greg.model}sop has not been defined in the data dictionary
   at org.alfresco.repo.policy.ClassPolicyDelegate.get(ClassPolicyDelegate.java:102)
   at org.alfresco.repo.policy.ClassPolicyDelegate.get(ClassPolicyDelegate.java:87)
   at org.alfresco.repo.node.AbstractNodeServiceImpl.invokeBeforeCreateNode(AbstractNodeServiceImpl.java:242)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.pullNodeChildrenToSameStore(DbNodeServiceImpl.java:2227)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.moveNode(DbNodeServiceImpl.java:2162)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.archiveNode(DbNodeServiceImpl.java:1962)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.deleteNode(DbNodeServiceImpl.java:785)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:163)
   at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy9.deleteNode(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy9.deleteNode(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
   at $Proxy10.deleteNode(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy9.deleteNode(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy9.deleteNode(Unknown Source)
   at org.alfresco.web.bean.spaces.DeleteSpaceDialog.finishImpl(DeleteSpaceDialog.java:108)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:124)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:121)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:130)
   at org.alfresco.web.bean.dialog.DialogManager.finish(DialogManager.java:534)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy188.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy188.doFilter(Unknown Source)
   at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)
09:51:17,734 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Found script resource import: classpath:alfresco/extension/OS_commun.js
09:51:17,734 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Succesfully located script 'classpath:alfresco/extension/OS_commun.js'
09:51:17,734 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource 'classpath:alfresco/extension/OS_commun.js
09:51:17,734 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root
09:51:22,906 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Time to execute script: 5106.0483ms
09:51:57,343 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Found script resource import: classpath:alfresco/extension/OS_commun.js
09:51:57,343 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Succesfully located script 'classpath:alfresco/extension/OS_commun.js'
09:51:57,343 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource 'classpath:alfresco/extension/OS_commun.js
09:51:57,343 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root
christophes
Member II

Re: Suppression espace

J'ai déjà eu ce problème, c'est sans doute dû à la règle de contenu, essaye de la supprimer avant de supprimer l'espace.

Christophe
hlander10
Member II

Re: Suppression espace

Oui ça ok supprimer les règles quand qu'une ok mais j'ai un nombre important donc je veux pas les supprimer
christophes
Member II

Re: Suppression espace

Pour résoudre ce problème chez moi de façon à ne pas obliger mes utilisateurs à faire cette manip, j'ai développé un petit code java que voici :
import org.alfresco.model.ContentModel;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.rule.RuleService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.log4j.Logger;

/* TODO : desactiver cette classe lorsque le bug sera resolu par Alfresco
* voir https://issues.alfresco.com/jira/browse/ETWOTWO-738
*/

public class BeforeDeleteSpace implements NodeServicePolicies.BeforeDeleteNodePolicy {

   private static Logger logger = Logger.getLogger(BeforeDeleteSpace.class.getName());
   private PolicyComponent policyComponent;
   private NodeService nodeService;
   private DictionaryService dictionaryService;
   private RuleService ruleService;
   
   public void initialise() {
      logger.debug("Init for beforeDeleteNode");
      JavaBehaviour javaBehaviour = new JavaBehaviour(this, "beforeDeleteNode", NotificationFrequency.EVERY_EVENT); //ContentModel.ASPECT_ROOT
      this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "beforeDeleteNode"), ContentModel.TYPE_FOLDER, javaBehaviour);
      logger.debug("End of init");
   }
   
   @Override
   public void beforeDeleteNode(NodeRef nodeRef) {
      if(dictionaryService.isSubClass(nodeService.getType(nodeRef), ContentModel.TYPE_FOLDER)) {
         if(ruleService.hasRules(nodeRef)) {
            ruleService.removeAllRules(nodeRef);
         }
      }
   }

   public PolicyComponent getPolicyComponent() {
      return policyComponent;
   }

   public void setPolicyComponent(PolicyComponent policyComponent) {
      this.policyComponent = policyComponent;
   }

   public NodeService getNodeService() {
      return nodeService;
   }

   public void setNodeService(NodeService nodeService) {
      this.nodeService = nodeService;
   }

   public DictionaryService getDictionaryService() {
      return dictionaryService;
   }

   public void setDictionaryService(DictionaryService dictionaryService) {
      this.dictionaryService = dictionaryService;
   }

   public RuleService getRuleService() {
      return ruleService;
   }

   public void setRuleService(RuleService ruleService) {
      this.ruleService = ruleService;
   }
}
Il faut placer ce code dans un jar et le déclarer dans un fichier "-context.xml" comme suit :
<?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="beforeDeleteSpace" class="chemin.du.package.BeforeDeleteSpace" init-method="initialise">
      <property name="policyComponent">
         <ref bean="policyComponent"/>
      </property>
      <property name="nodeService">
         <ref bean="nodeService" />
      </property>
      <property name="dictionaryService">
         <ref bean="dictionaryService"/>
      </property>
      <property name="ruleService">
         <ref bean="ruleService" />
      </property>
   </bean>
</beans>
Le code supprime donc les règles de contenu (toutes) avant de supprimer l'espace. En espérant que ça t'aide…

Christophe
hlander10
Member II

Re: Suppression espace

Merci pour cette idée que je n'avais pas eu, je regarde ce code.

Encore un grand merci
hlander10
Member II

Re: Suppression espace

Question en plus

Peut on avoir plusieurs fichiers -context.xml
si oui comment car j'en ai deux pour bien différencier, et il n'en voit qu'un seul apparemment

Merci
christophes
Member II

Re: Suppression espace

Oui normalement, on peut avoir plusieurs fichiers "*-context.xml", soit placés dans shared (méthode conseillée) soit dans le chemin principal. C'est bizarre qu'il n'en charge qu'un… Je ne vois pas pourquoi il fait cela, désolé.

Christophe
hlander10
Member II

Re: Suppression espace

ils sont placés ici :
tomcat\shared\classes\alfresco\extension