Hello Ariel,

So if a document of unsupported type is selected for editing,
The UCB will automatically reject it / display an error message.
I don't have to do the filtering then?


On Thu, May 2, 2013 at 3:03 AM, Ariel Constenla-Haile <arie...@apache.org>wrote:

> Hi Rajath,
>
> On Wed, May 01, 2013 at 09:04:55PM +0530, Rajath Shashidhara wrote:
> > Hi Ariel,
> >
> > Thanks.
> >
> > As far as I have understood:
> > A CMIS is a repository to store files and folders.
> > I have to make a UCP which integrates into the existing UCB that provides
> > editing access to files stored in the the CMIS repository by implementing
> > XContentProvider interface.
>
> Not only editing access, but access in general, as the content might be
> read-only.
>
> > The things that I have to take care is the connection to the cmis
> > repository, permissions to access files, querying content from the files,
> > browsing through the repository to display the file hierarchy, etc.
>
> The last one is not your responsibility. The UCB will query your UCP for
> content X, using Apache Chemistry you will retrieve information about
> content X (the mime, if it is a folder or a file, etc.), and then the
> UCB will execute commands on the content.
>
> Browsing the repository will happen in the file picker (menu File
> - Open), this will end up calling your UCP to provide UCB-contents and
> execute commands on it (if the UCB-content is a folder, the UCB-content
> will be asked to list its contents; etc.).
>
> > I browsed through some of the devguides of Apache Chemistry. The code was
> > not too complex. I was able to follow the code - I could find the
> functions
> > required to implement the above functions i the example code.
>
> Yes, Apache Chemistry comes with clear examples, that show most of what
> you will need to use. The hard part to understand is OpenOffice API ;)
>
> > But one thing I have not understood is:
> > A cmis repository can contains documents/folders/relationships/policies.
>
> Yes, you will represent the CMIS repository as a root folder with a set of
> documents and folders, something like the FTP-content provider in the
> diagram from
>
> http://wiki.openoffice.org/wiki/Documentation/DevGuide/UCB/Universal_Content_Broker
>
> > But there is no mention about the kind/format of document for which the
> > support is required.
>
> The UCP is the lowest level, that means you know nothing about if a CMIS
> content can be "handled" by OpenOffice, that is, if OpenOffice can open
> it and display its contents to the user, this depends on a filter being
> available, but the UCP knows nothing about filters: you simply provide
> contents and execute commands on them.
>
> Answering your doubt above, you will have to support handling everything
> in the CMIS repository that can be represented as a folder or
> a file/document.
>
> > Is it something like a openoffice format document is residing in the
> > repository and I have to connect the already existing editing tools of
> > openoffice to that file?
>
> No, it is something at a lower level: if a CMIS content represents
> a file/document and the user is trying to open it, the UCB will execute
> an "open" command on the CMIS-content; for you, this means only to
> provide the document's content as an stream, but you don't know if
> OpenOffice can handle it, this isn't your responsibility.
>
> > Do I have to deal with MIME Type of files to identify openoffice
> supported
> > files?
>
> The MIME type will be one of the properties you have to provide about
> a content. But you don't make any assumption about what OpenOffice will
> do with it, you simply don't care ;)
>
> The list of properties and commands an UCB-content should support are
> listed at
> http://www.openoffice.org/api/docs/common/ref/com/sun/star/ucb/Content.html
> In trunk this documentation looks a little better:
>
> http://svn.apache.org/viewvc/openoffice/trunk/main/offapi/com/sun/star/ucb/Content.idl?revision=1460358&view=markup#72
> Though the trunk sdk does not work, you can get it only to read the
> docs.
>
> > I think I'm short of information and understanding to write a good
> > application.
>
> The UCB API is rather "complex". You may get a general understanding of
> how it works by playing with some AOO Basic code:
> http://people.apache.org/~arielch/api/UCB_demo.odt
> this code uses the WebDav UCP, you need a Developer Snapshot from
> a recent trunk, because it does not work on 3.4.1; but you can change
> the URLs and make them point to files on the local file system: the code
> is the same for all UCB contents.
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>



-- 
Rajath S,
M.Sc(Hons.) Physics,
Birla Institute of Technology and Science - Pilani,
Pilani

Reply via email to