How to split a cmis url into repository path and path with respect to repository? - sharepoint

I'm a GSoC'13 intern. I'm working on developing a CMIS UCP for Apache OpenOffice.
I wanted to know how to divide a url into its parts.
To fill the session parameters I need the url + path of the object in repo. separately.
Is there any other way?

If you know the path of an object, you can retrieve it using getObjectByPath, which is a method on org.apache.chemistry.opencmis.client.api.Session.
If you have an object and you want to know its path, you can call the object's getPaths() method, which returns a list of paths for the object (in repositories that support multi-filing, documents can have multiple paths, but folders can never be multi-filed).
The actual URL you would construct to navigate directly to the object using its path is repository-specific, unless you are using the browser binding (new in CMIS 1.1). But there aren't any production implementations of the CMIS 1.1 browser binding yet.

Related

Is there a way to configure the generate method name for grpc-node client?

I am hoping to use a grpc-node client to talk to a microservice built in Go using the go-micro framework. I am running into an issue where go-micro defines method names using periods (.) to separate namespaces and method names, whereas grpc-node slashes (/). Is there anyway to configure this pattern to have these two processes talk to each other?
The gRPC over HTTP/2 protocol documentation defines that the path is constructed as follows:
Path → ":path" "/" Service-Name "/" {method name}
with this additional note
Some gRPC implementations may allow the Path format shown above to be overridden, but this functionality is strongly discouraged. gRPC does not go out of its way to break users that are using this kind of override, but we do not actively support it, and some functionality (e.g., service config support) will not work when the path is not of the form shown above.
So, the Node gRPC client is following the specification, and the alternate format used by go-micro appears to be hard coded in their code generation plugin (here). I would consider that to be a bug.
That being said, there is a viable workaround to match that method name format in the Node gRPC library. When you load a .proto file in the Node each client constructor function has a service member which is a plain JavaScript object that describes the service. It is a map of method names to method definitions, and each method definition includes a path member. You can modify the path of each method to match the pattern that go-micro uses, then pass the resulting service object to grpc.makeGenericClientConstructor to get a new client constructor that connects to the modified service.

Nuxeo : Document or collection located in more than one location

Is it possible to have "Document" or "Collection" located in more than one location into the base ? For example, can i have "Document" or "Collection" linked to more than one folder ? From what i understand it is not possible.
What you look for is called a "Proxy". See NXDOC/Repository+Concepts.
A proxy is very much like a symbolic link on an Unix-like OS: a proxy
points to a document and will look like a document from the user point
of view:
The proxy will have the same metadata as the target document, The
proxy will hold the same files as the target documents (since file is
a special kind of metadata).
A proxy can point to a live document or to a version (check in
archived version).
Proxies are used to be able to see the same document from several
places without having to duplicate any data.
(...)
If a proxy can not hold metadata, it can hold security descriptors
(ACP/ACL). So a user may be able to see one proxy and not an other.

Using Apache Camel CMIS with Sharepoint 2013

I can successfully access Sharepoint 2013 AtomPub interface from Chrome REST clients, the following URL gives me the file I want:
http://ourintranet:100/personal/myname/_vti_bin/cmis/rest/5612e38e-a324-4030-9fee-7d05cd9053a4?getContentStream&objectId=4-512
However, using the same URL in the Camel CMIS route gets me HTTP 302 (File not found) and diverts me to an error page.
The route I tried is:
from("cmis:http://ourintranet:100/personal/myname/_vti_bin/cmis/rest/5612e38e-a324-4030-9fee-7d05cd9053a4?getContentStream&objectId=4-512")
.to("file:c:/myFolder")
Running Wireshark to see what is going on, it seems that Camel CMIS is not passing the query string part to the server, and may consider it options to the CMIS component (as per the component's usage guide).
So, what is the correct way of using Camel CMIS component with Sharepoint?
Have you tried adding parameter "query" to the uri like this
from("cmis:http://ourintranet:100/personal/myname/_vti_bin/cmis/rest/5612e38e-a324-4030-9fee-7d05cd9053a4?query=getContentStream&objectId=4-512")
.to("file:c:/myFolder")
According to http://camel.apache.org/cmis.html :
query | The cmis query to execute against the repository. If not specified, the consumer will retrieve every node from the content repository by iterating the content tree recursively

Obtaining list of folders from a webdav

I am trying to get a list of folders in an array from a remote webdav. I am using the PROPFIND method querying for property 'isfolder', which although it is not standard it is contemplated in 'Additional WebDAV Collection Properties'. Then, I will parse the XML response to build up the array. However, in the response, I get a 'Resource not found' for this property. I am using the query against an IIS server.
My question, which seems to be answered already with my results (need confirmation though), is:
-Doesn't IIS have 'isfolder' property by default?
Then, how can I include it?
And, is there a better way to get a list of folders from a webdav directory?
Many thanks in advance.
You don't need any custom properties. Just check the DAV:resourcetype property.

Create a document using only client-side code

Is it possible to create a document inside document library using just client-side javascript?
Just a simple text or xml file...
There are examples on how to create/delete a folder or delete a file, or update a document property. And you can do anything you want with list items.
But what if I need to create a document in a document or forms library with ECMAScript object model in SP2010, or calling web services via ajax in MOSS? Is it feasible?
Of course you can do it. You just need to have content of file as a Stream or byte[].
Use such code to create file in library.
ok, i found there are multiple ways to do it, though all of them are normally used in desktop apps, not in browser.
Here is the list:
RPC: Simple ajax POSTing to _vti_bin/_vti_aut/author.dll can do the job quickly if you don't need to set metadata or handle multiple content types
Copy Web Service: CopyIntoItems method of copy.asmx service accepts base64-encoded file body
HTTP PUT: You can simply PUT your file to the desired destination, though this method can by unsupported by some browsers

Resources