2017-07-07 3 views
0

私はopenfisを使用してAlfrescoリポジトリ(5.1e)に添付ファイル付きのフォルダ(カスタムタイプ)を作成しています。フォルダが正常に作成されますが、文書の作成のために(CMIS:ドキュメント - センチ:コンテンツ):カスタムアルフレコフォルダ内にcmis:documentを作成できません

によって引き起こさ:添付ファイルとして、私は次の例外を取得していますorg.apache.chemistry.opencmis.commons.exceptions.CmisConstraintExceptionを: 'cmis:document'タイプのオブジェクトをこのフォルダに追加することはできません! at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:514)[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0] at org .apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:717)[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0] at org.apache。 org.apache.chemistry.opencmisの[chemistry-opencmis-client-bindings-1.0.0.jar:1.0.0] .client.runtime.SessionImpl.createDocument(SessionImpl.java:1197)[化学 - opencmis-client-impl-1.0.0.jar:1.0.0] at org.apache.chemistry.opencmis.client.runtime.FolderImpl。 createDocument(FolderImpl.java:88)[chemistry-opencmis-client-impl-1.0.0.jar :1.0.0] at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:471)[chemistry-opencmis-client-impl-1.0.0.jar:1.0.0] at com.salviol.frops.common.ejbs.DcmIntegrationEJB.createDocument(DcmIntegrationEJB.java:208)[frops-common-ejb-0.0.1.jar:] at com.salviol.frops.common.ejbs.DcmIntegrationEJB.createCase( DotImageAccessorImpl.invoke0(ネイティブメソッド)[rt.jar:1.8.0_40] at sun.reflect.NativeMethodAccessorImpl。 invoke(NativeMethodAccessorImpl.java:62)[rt.jar:1.8.0_40] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[rt.jar:1.8.0_40] at java.lang.reflect。 Method.invoke(Method.java:497)[rt.jar:1.8.0_ (InterceptorContext.java:309) at org.jboss.invocation。 WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory $ 1.processInvocation(UserInterceptorFactory.java:63) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java :309) at org.jboss.invocation.InterceptorContext $ Invocation.proceed(InterceptorContext.java:407) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)[wildfly-weld- 8.1.0.Final.jar:8.1.0.Final](Jsr299BindingsInterceptor.java:93)[wildfly-weld-8.1.0.Final.jar:8.1.0.Final] at org.jboss.as.ee .component.interceptors.UserInterceptorFactory $ 1.processInvocation(UserInterceptorFactory.java:63) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java: 53) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory $ 1.processInvocation(UserInterceptorFactory.java:63) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss .as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)[wildfly- org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(ja-jp、 SBInvocationInterceptor。java:47)[wildfly-jpa-8.1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.InterceptorContext $ Invocation.proceed(InterceptorContext.java:407) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)[weld-core-impl-2.1.2.Final.jar:2014-01- 09 09:23] at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)[wildfly-weld-8.1.0.Final.jar:8.1.0.Final] at org。 jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)[wildfly-ee-8。 1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor。 org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocationでorg.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) でprocessInvocation(ComponentDispatcherInterceptor.java:53) (NonPooledEJBComponentInstanceAssociatingInterceptor.java:5 9)[wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.ejb3.tx .CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:251)wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final] ... 174より

ここでは、ソースコード(メソッド)であります

private Document createDocument(Session cmisSession, Folder parentFolder, byte[] file, String fileName, String fileType) { 

Document document = null; 

try { 

Map<String, Object> docProperties = new HashMap<String, Object>();  
docProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document"); 
docProperties.put(PropertyIds.NAME, fileName); 

    ContentStream contentStream = cmisSession.getObjectFactory().createContentStream(fileName, file.length, fileType, new ByteArrayInputStream(file)); 

     document = parentFolder.createDocument(docProperties, contentStream, null); 

    } catch (CmisContentAlreadyExistsException ccaee) { 
     document = (Document) cmisSession.getObjectByPath(parentFolder.getPath() + "/" + fileName);    
    } 

    return document; 
} 

私はバージョニング(状態MAJORとNONE)を試みましたが、問題はまだあります。作成されたフォルダには標準のアクセス許可があります(inherit = "true"、各サイトユーザーには適切なアクセス許可が付与されています)。

Cmisの制約には誰も同じ問題がありましたか?

答えて

1

これはあなたのドキュメントについてではなく、あなたのフォルダに関するものです。 エラーの原因となっているコードを見てください。原因が不安定になります。 cmis:allowedChildObjectTypeIdsという名前のプロパティがあり、それはあなたが後にしているものです。

モデルはどのように定義されていますか?

public void checkChildObjectType(CMISNodeInfo folderInfo, String childType) 
    { 
     TypeDefinitionWrapper targetType = folderInfo.getType(); 
     PropertyDefinitionWrapper allowableChildObjectTypeProperty = targetType 
       .getPropertyById(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS); 
     List<String> childTypes = (List<String>) allowableChildObjectTypeProperty.getPropertyAccessor().getValue(
       folderInfo); 

     if ((childTypes == null) || childTypes.isEmpty()) 
     { 
      return; 
     } 

     if (!childTypes.contains(childType)) 
     { 
      throw new CmisConstraintException("Objects of type '" + childType + "' cannot be added to this folder!"); 
     } 
    } 
+0

こんにちは。カスタムモデルはalfresco repo側で定義され、cm:フォルダータイプ(カスタムプロパティ、アスペクト、アソシエーションを含む)を拡張するカスタムタイプを含みます。 cmis:allowedChildObjectTypeIds、alfresco repo side(カスタムモデル)、またはcmis作成フォルダの追加プロパティを追加する場所はどこですか? –

関連する問題