CMIS Metadata Update

We tried to make LogicalDOC as intuitive as possible, but an advice is always welcome.

Moderator: car031

Fabietto
Posts: 4
Joined: Thu Jan 25, 2018 7:06 pm

CMIS Metadata Update

Thu Jan 25, 2018 7:32 pm

Hi to all,
i'm tring to use LogicalDoc CE to store my work papers and i need to use the Content Management Interoperability Service to upload documents from third part scan software.

I'm using Apache Chemistry CMIS Workbench to make some tests before starting to store documents and everytime i try to update Metadata i receive that error:

Code: Select all

CMIS Exception: storage CMIS Error!
  Error Content: <html><head><title>Apache Chemistry OpenCMIS - storage error</title><style><!--H1 {font-size:24px;line-height:normal;font-weight:bold;background-color:#f0f0f0;color:#003366;border-bottom:1px solid #3c78b5;padding:2px;} BODY {font-family:Verdana,arial,sans-serif;color:black;font-size:14px;} HR {color:#3c78b5;height:1px;}--></style></head><body><h1>HTTP Status 500 - <!--exception-->storage<!--/exception--></h1><p><!--message-->CMIS Error!<!--/message--></p><hr noshade='noshade'/><!--stacktrace--><pre> org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: CMIS Error! at com.logicaldoc.cmis.LDRepository.catchError(LDRepository.java:1133) at com.logicaldoc.cmis.LDRepository.updateProperties(LDRepository.java:800) at com.logicaldoc.cmis.LDCmisService.updateProperties(LDCmisService.java:308) at org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.updateProperties(CmisServiceWrapper.java:984) at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$UpdateProperties.serve(ObjectService.java:538) at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:88) at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:225) at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:172) at com.logicaldoc.cmis.CmisServlet.service(CmisServlet.java:31) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:621) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: No a String, Long, Double, Date, Boolean or User value at com.logicaldoc.core.metadata.Attribute.setValue(Attribute.java:166) at com.logicaldoc.core.metadata.ExtensibleObject.setValue(ExtensibleObject.java:109) at com.logicaldoc.cmis.LDRepository.updateDocumentMetadata(LDRepository.java:1995) at com.logicaldoc.cmis.LDRepository.update(LDRepository.java:2088) at com.logicaldoc.cmis.LDRepository.updateProperties(LDRepository.java:796) ... 68 more </pre><!--/stacktrace--><hr noshade='noshade'/></body></html>

For example i tried to upate sourceAuthor from default LogicalDoc Template like in the screenshot below.

I'm a real newbie and i could't find a solution at now. Someone could help me please?
Attachments
workbench.JPG
workbench.JPG (218.54 KiB) Viewed 1167 times
shatzing
Posts: 78
Joined: Tue Jan 21, 2014 9:46 am

Re: CMIS Metadata Update

Fri Jan 26, 2018 3:15 pm

Hi Fabietto,
You can update a custom attribute, of if the document has such attribute.
In practice the document (in Logicaldoc) must have assigned a template (in italian "classe documentale") that contains that attribute.
Which version of LogicalDOC Community are you testing?
Fabietto
Posts: 4
Joined: Thu Jan 25, 2018 7:06 pm

Re: CMIS Metadata Update

Fri Jan 26, 2018 4:23 pm

Hi shatzing,
first of all, thx for your help!

I'm actually testing LogicalDoc CE 7.7.3 with embedded Mysql database pulled from docker hub.

As you can see from the screenshot below, i have set a template (classe documentale) for a specific folder (in this case the default template from logicaldoc) so every docs uploaded in that folder has the same template with the same attributes.

Uploading documents via CMIS works well, but if i append custom metadata, the results is the error in my first post.

I tried several combinations but the results is the same.
Attachments
error.JPG
error.JPG (184.74 KiB) Viewed 1134 times
ldoc_template.JPG
Updating custom metadata ldoc:ext_sourceType from "nota" to "notassssss"
ldoc_template.JPG (49.75 KiB) Viewed 1134 times
shatzing
Posts: 78
Joined: Tue Jan 21, 2014 9:46 am

Re: CMIS Metadata Update

Mon Jan 29, 2018 5:09 pm

Hi Fabietto,
I suppose it is something related to the field sourceDate.
Since this is a field of type Date you should fill-in with a date (even if it is non a required field)
You should pass it with format YYYY-MM-DD
Fabietto
Posts: 4
Joined: Thu Jan 25, 2018 7:06 pm

Re: CMIS Metadata Update

Tue Jan 30, 2018 1:03 pm

I've done some tests,
the results is:
- if i a use the default attribute "sourceData" to pass a data, it works, but i would prefere don't mix attributes from different templates so...
...if i create a custom data attributes "datadoc" i can't update it via cmis and i have always the same error...


But above all, is it possible to do a search based on metadata? For example, if I want to show all the documents in a range of dates based on the sourceData field, how can I do?
shatzing
Posts: 78
Joined: Tue Jan 21, 2014 9:46 am

Re: CMIS Metadata Update

Wed Jan 31, 2018 4:14 pm

Hi Fabietto,
mi suggestion is that you define your own Template (classe documentale) with the set of attributes that you think to use. You are not forced to use the default template, it is there only for legacy purpose.

You should use something like
SELECT * FROM cmis:document WHERE sourceDate > '2015-12-31'
Fabietto
Posts: 4
Joined: Thu Jan 25, 2018 7:06 pm

Re: CMIS Metadata Update

Thu Feb 01, 2018 11:37 pm

Hi shatzing,
I'm in a dead end ... the first time I upload the metadata it works, but then I always get the same error, even with the default metadata.
When i say the first time i say the very first document uploaded on LogicalDoc after a new installation.
I don't really known what is wrong....

works it rights for you?

Return to “Usage”

Who is online

Users browsing this forum: No registered users and 2 guests