Custom action on CMIS plugin checkout file

Having trouble installing Oxygen? Got a bug to report? Post it all here.
cherryj
Posts: 3
Joined: Mon Dec 09, 2019 6:38 pm

Custom action on CMIS plugin checkout file

Post by cherryj »

Hello ,
We are trying to implement SVN as CMIS server. For this , we are trying to implement custom action (checkout from a SVN repository)when user clicks "check out" in the contextual menu on a file in CMIS explorer.

We implemented traverse and checkout of SVN features using java methods and are able to invoke it from a CMIS client tool named Apache workbench. However when we try to do the same from CMIS plugin , it does not invoke the "checkout" method.
Is there anything different to keep in mind for Oygen XML CMIS plugin to hookup the checkout action to method ?
Ours project is based on filebridge project by apache opencmis

Thanks,
Joseph
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Custom action on CMIS plugin checkout file

Post by alex_jitianu »

Hi Joseph,

Let's make sure I understand this correctly. You want to keep your documents in a SVN server and interact with them through a CMIS interface, like the sample OpenCMIS FileShare Repository does. You test this implementation through the CMIS Workbench. Did I understand it correctly?

As far as I know, both the Apache CMIS Workbench and Oxygen CMIS plugin use the Apache Chemistry OpenCMIS client libraries:

Code: Select all

		<dependency>
			<groupId>org.apache.chemistry.opencmis</groupId>
			<artifactId>chemistry-opencmis-client-impl</artifactId>
			<version>1.1.0</version>
		</dependency>
One thing to consider is that Oxygen CMIS plugin supports only ATOM Pub bindings. Do you have implementations for this binding? Anyway, the source code for the plugin is open source on github, so you can look right at, if you want, it to understand how it works.

Best regards,
Alex
cherryj
Posts: 3
Joined: Mon Dec 09, 2019 6:38 pm

Re: Custom action on CMIS plugin checkout file

Post by cherryj »

Thanks for you response ,Alex ! . Yes, you are right and i was able to make it work :D

However , i got stuck with another issue in CMIS plugin. Will you be able to help me with this?
I pick an object ( a document) in CMIS plugin and choose "check in " from the context menu . Plugin sends the filepath to the server in some garbled form( i thought it is base64 encoding. But it is not ) whereas workbench seems to send unencoded path string to the file and works fine.

Thanks,
Joseph
cherryj
Posts: 3
Joined: Mon Dec 09, 2019 6:38 pm

Re: Custom action on CMIS plugin checkout file

Post by cherryj »

Forgot to mention that this is what is see as objectId for the doc passed to implementation code : 77+977+9LQ==
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Custom action on CMIS plugin checkout file

Post by alex_jitianu »

Hi Joseph,

I gues that your extension, on the server is the one that receives the path like that, right? On the client side, you can enable logging on the http client. I did that myself and I didn't see anything being sent in an encrypted way. Here is what I did:
1. I've created the file {oxygenInstallDir}/log4j.properties with this content:

Code: Select all

log4j.rootCategory= info, R2

log4j.category.org.apache.http.impl.conn=debug
log4j.category.org.apache.http.impl.client=debug
log4j.category.org.apache.http.client=debug
log4j.category.org.apache.http.wire=debug
log4j.category.org.apache.http=debug

log4j.appender.R2=org.apache.log4j.RollingFileAppender
log4j.appender.R2.File=${user.home}/Desktop/oxygenLog/oxygen.log
log4j.appender.R2.MaxFileSize=12000KB
log4j.appender.R2.MaxBackupIndex=20
log4j.appender.R2.layout=org.apache.log4j.PatternLayout
log4j.appender.R2.layout.ConversionPattern=%r %p [ %t ] %c - %m%n
2. Start Oxygen and perform the Check In action. The log contains bits like this:

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
    xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
    xmlns:app="http://www.w3.org/2007/app">
    <atom:author>
        <atom:name>admin</atom:name>
    </atom:author>
    <atom:id>http://chemistry.apache.org/ODZiMWNhNDAtYWIzYy00NjZmLWIwYmMtNTU0Y2M2ZmY3ZjEw</atom:id>
    <atom:published>2018-07-13T09:34:09.01+03:00</atom:published>
    <atom:title>topics</atom:title>
    <app:edited>2019-12-17T08:38:02.391+02:00</app:edited>
    <atom:updated>2019-12-17T08:38:02.391+02:00</atom:updated>
    <cmisra:object>
        <cmis:properties>
            <cmis:propertyId propertyDefinitionId="cmis:objectId" displayName="Object Id"
                localName="objectId" queryName="cmis:objectId">
                <cmis:value>86b1ca40-ab3c-466f-b0bc-554cc6ff7f10</cmis:value>
            </cmis:propertyId>
            <cmis:propertyId propertyDefinitionId="alfcmis:nodeRef" displayName="Alfresco Node Ref"
                localName="nodeRef" queryName="alfcmis:nodeRef">
                <cmis:value>workspace://SpacesStore/86b1ca40-ab3c-466f-b0bc-554cc6ff7f10</cmis:value>
            </cmis:propertyId>
            <cmis:propertyString propertyDefinitionId="cmis:path" displayName="Path"
                localName="path" queryName="cmis:path">
                <cmis:value>/Sites/first-site/documentLibrary/dita/flowers/topics</cmis:value>
            </cmis:propertyString>
So the path is being sent plainly, like:

Code: Select all

            
            <cmis:propertyString propertyDefinitionId="cmis:path" displayName="Path"
                localName="path" queryName="cmis:path">
                <cmis:value>/Sites/first-site/documentLibrary/dita/flowers/topics</cmis:value>
            </cmis:propertyString>
perhaps there are additional layers on the server side that do that to the path?

Best regards,
Alex
Post Reply