chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: Implementing getContent method
Date Tue, 19 Aug 2014 09:18:30 GMT
Hi Muhammed,

Have you set the content properties cmis:contentStreamFileName,
cmis:contentStreamId, cmis:contentStreamMimeType, and cmis:contentStreamLength?

If not, the server will not generate a link to the document content and the
client cannot do anything without the link.


- Florian


> Hi Florian,
> 
> I found Content URL field but it says *(not avaible).*
> 
> 
> 
> 2014-08-19 11:35 GMT+03:00 Florian Müller <fmui@apache.org>:
> 
> > Hi Muhammed,
> >
> > To narrow down your problem try the following:
> > * Select the document in the Workbench.
> > * Switch to the "Object" tab an the right hand side.
> > * There you should find a Content URL. Copy it and open it with a web
> > browser.
> >
> > Does the web browser download/show the content or does it show an error
> > message
> > and a stack trace (if you haven't turned it off)?
> >
> > - Florian
> >
> >
> > >
> > > Hi Jorge,
> > >
> > > Other methods that I implemented work fine. For instance,
> > >
> > > @Override
> > >     public ObjectData getObject(String repositoryId, String objectId,
> > > String filter, Boolean includeAllowableActions,
> > >             IncludeRelationships includeRelationships, String
> > > renditionFilter, Boolean includePolicyIds,
> > >             Boolean includeAcl, ExtensionsData extension) {
> > >         System.out.println("Hello getObject!");
> > >         return objectService.getObject(repositoryId, objectId, filter,
> > > includeAllowableActions,
> > >                 includeRelationships, renditionFilter, includePolicyIds,
> > > includeAcl, extension);
> > >     }
> > >
> > > This method writes the console,
> > >
> > > 2014-08-19 11:21:46,893 DEBUG [http-nio-8080-exec-106]
> > > org.apache.chemistry.opencmis.server.shared.Dispatcher: gridfs / id, GET
> > ->
> > > org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$GetObject
> > > Hello getObject!
> > > Hello getObject!
> > >
> > > But I did not implement all service methods. I extend AbstractCmisService
> > > and override these methods,
> > >
> > > getRepositoryInfos()
> > > getTypeChildren()
> > > getTypeDefinition()
> > > getChildren()
> > > getObjectParents()
> > > getObject()
> > > createFolder()
> > > createDocument()
> > > deleteObjectOrCancelCheckOut()
> > > getContentStream() (does not work)
> > >
> > >
> > > 2014-08-19 11:19 GMT+03:00 <Jorge.MARTIN-CUERVO@ext.ec.europa.eu>:
> > >
> > > > Hello,
> > > >
> > > > Looks like the client is not reaching the
> > ObjectService.getContentStream()
> > > > method of the server,
> > > > this exception is because the client receives a null.
> > > >
> > > > The other services are working well? I mean Repository, Navigation and
> > > > other Object service methods.
> > > >
> > > > Regards.
> > > >
> > > > Jorge MARTIN CUERVO
> > > >
> > > > European Commission
> > > > DG TRADE
> > > > Unit A4
> > > > CHAR 02/077
> > > > B-1049 Brussels/Belgium
> > > > +32 2 298 86 27
> > > > jorge.martin-cuervo@ext.ec.europa.eu
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Muhammed Olgun [mailto:mh.olgun@gmail.com]
> > > > Sent: Tuesday, August 19, 2014 9:40 AM
> > > > To: dev@chemistry.apache.org
> > > > Subject: Implementing getContent method
> > > >
> > > > Hi,
> > > >
> > > > I'm trying to implement OpenCMIS server. I implemented some methods.
> > They
> > > > work fine but there is a problem with getContentStream method.
> > > >
> > > > @Override
> > > >     public ContentStream getContentStream(String repositoryId, String
> > > > objectId,         String streamId, BigInteger offset, BigInteger
> > length,
> > > > ExtensionsData extension) {
> > > >         System.out.println(objectId);
> > > >         return objectService.getContentStream(repositoryId, objectId,
> > > > streamId, offset, length, extension);
> > > >     }
> > > >
> > > > This is my getContentStream method. When I try to download a file from
> > > > OpenCMIS Workbench I got this error and also I cant see ObjectID from
> > the
> > > > console. I think this means I can't even call getContentStream method
> > and I
> > > > don't know why because other methods work fine.
> > > >
> > > > > 10:28:55 ERROR hemistry.opencmis.workbench.ClientHelper:
> > > > IllegalArgumentException: No content!
> > > > java.lang.IllegalArgumentException: No content!
> > > > at
> > > >
> > > >
> > org.apache.chemistry.opencmis.workbench.ClientHelper.createTempFileFromDocument(ClientHelper.java:320)
> > > > at
> > > >
> > > >
> > org.apache.chemistry.opencmis.workbench.ClientHelper.open(ClientHelper.java:286)
> > > > at
> > > >
> > > >
> > org.apache.chemistry.opencmis.workbench.FolderTable.doAction(FolderTable.java:201)
> > > > at
> > > >
> > > >
> > org.apache.chemistry.opencmis.workbench.FolderTable.access$000(FolderTable.java:62)
> > > > at
> > > >
> > > >
> > org.apache.chemistry.opencmis.workbench.FolderTable$3.mouseClicked(FolderTable.java:134)
> > > > at
> > java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
> > > > at java.awt.Component.processMouseEvent(Component.java:6530)
> > > > at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
> > > > at java.awt.Component.processEvent(Component.java:6292)
> > > > at java.awt.Container.processEvent(Container.java:2234)
> > > > at java.awt.Component.dispatchEventImpl(Component.java:4883)
> > > > at java.awt.Container.dispatchEventImpl(Container.java:2292)
> > > > at java.awt.Component.dispatchEvent(Component.java:4705)
> > > > at
> > java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
> > > > at
> > java.awt.LightweightDispatcher.processMouseEvent(Container.java:4542)
> > > > at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
> > > > at java.awt.Container.dispatchEventImpl(Container.java:2278)
> > > > at java.awt.Window.dispatchEventImpl(Window.java:2739)
> > > > at java.awt.Component.dispatchEvent(Component.java:4705)
> > > > at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
> > > > at java.awt.EventQueue.access$400(EventQueue.java:97)
> > > > at java.awt.EventQueue$3.run(EventQueue.java:697)
> > > > at java.awt.EventQueue$3.run(EventQueue.java:691)
> > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > at
> > > >
> > > >
> > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
> > > > at
> > > >
> > > >
> > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
> > > > at java.awt.EventQueue$4.run(EventQueue.java:719)
> > > > at java.awt.EventQueue$4.run(EventQueue.java:717)
> > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > at
> > > >
> > > >
> > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
> > > > at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
> > > > at
> > > >
> > > >
> > java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
> > > > at
> > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
> > > > at
> > > >
> > > >
> > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
> > > > at
> > java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
> > > > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
> > > > at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
> > > >
> > > > Muhammet
> > > >
> >

Mime
View raw message