GCube Document Library
From Gcube Wiki
Design Overview
The ContentManagementLibrary (CML) is a library that works on top of the Content Manager. This library offers a simpler way for client to access documents in the d4science system. The major change in the ContentManager is the document model (more generic, more extensible), the CML reduces the development costs for using this new feature.
Document Model
Implementation Overview
The CML is composed by tree types of access interfaces:
- the CMReader is used to read document from a collection. it offers methods to get a document or part of it (Metadata, Annotations, Parts, Alternatives);
- the CMWriter is used to add document or update it or a part of it;
- the CMView is used to get documents from a specific view of a collection.
F.A.Q.
- Running the examples I get the following exception:
[main] FATAL contexts.GHNClientContext - [0.0s] GHNClientContext: gHN could not complete initialisation java.io.FileNotFoundException: null/config/GHNConfig.xml (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.gcube.common.core.contexts.GHNContext.configureGHN(GHNContext.java:314) at org.gcube.common.core.contexts.GHNClientContext.configureGHN(GHNClientContext.java:35) at org.gcube.common.core.contexts.GHNClientContext.initialise(GHNClientContext.java:27) at org.gcube.common.core.contexts.GHNContext.<clinit>(GHNContext.java:252) at org.gcube.common.core.utils.calls.WSCall.getInitQuery(WSCall.java:55) at org.gcube.common.core.utils.calls.WSCall.getInitQuery(WSCall.java:25) at org.gcube.common.core.utils.calls.GCUBECall.<init>(GCUBECall.java:72) at org.gcube.common.core.utils.calls.GCUBECall.<init>(GCUBECall.java:84) at org.gcube.common.core.utils.calls.WSCall.<init>(WSCall.java:43) at org.gcube.contentmanagement.contentmanager.stubs.calls.BaseCall.<init>(BaseCall.java:25) at org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall.<init>(ManagerCall.java:24) at org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall.<init>(ManagerCall.java:35) at org.gcube.contentmanagement.contentmanager.stubs.calls.ReadManagerCall.<init>(ReadManagerCall.java:97) at org.gcube.contentmanagement.contentmanagerlibrary.CMReader.<init>(CMReader.java:62) at org.gcube.contentmanager.contentmanagerlibrary.GetDocumentsWithProjections.main(GetDocumentsWithProjections.java:34) Exception in thread "main" java.lang.NullPointerException at org.gcube.common.core.utils.calls.WSCall.getInitQuery(WSCall.java:55) at org.gcube.common.core.utils.calls.WSCall.getInitQuery(WSCall.java:25) at org.gcube.common.core.utils.calls.GCUBECall.<init>(GCUBECall.java:72) at org.gcube.common.core.utils.calls.GCUBECall.<init>(GCUBECall.java:84) at org.gcube.common.core.utils.calls.WSCall.<init>(WSCall.java:43) at org.gcube.contentmanagement.contentmanager.stubs.calls.BaseCall.<init>(BaseCall.java:25) at org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall.<init>(ManagerCall.java:24) at org.gcube.contentmanagement.contentmanager.stubs.calls.ManagerCall.<init>(ManagerCall.java:35) at org.gcube.contentmanagement.contentmanager.stubs.calls.ReadManagerCall.<init>(ReadManagerCall.java:97) at org.gcube.contentmanagement.contentmanagerlibrary.CMReader.<init>(CMReader.java:62) ...
In this case you have to configure your eclipse running configuration properly [1].
- Trying to get the document content I get this exception:
Exception in thread "main" java.net.MalformedURLException: unknown protocol: sms at java.net.URL.<init>(URL.java:574) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at org.gcube.contentmanagement.contentmanagerlibrary.model.GCubeDocument.getContent(GCubeDocument.java:227) ...