Hello,

Sorry for asking too many questions.
The method execute in the XContent implementation class I have created,
which has parameters: com.sun.star.ucb.Command aCommand, int CommandId,
com.sun.star.ucb.XCommandEnvironment Environment

now aCommand object has three attributes:
Name,handle,argument

So if trying to get Metadata. we use command as getPropertyValues.
"getPropertyValues" is the name of the command,
argument -> which property to get.
What is handle?

Also what is commandid? Any enumeration to represent various commandids?



On Sun, Jun 2, 2013 at 12:06 PM, Ariel Constenla-Haile
<arie...@apache.org>wrote:

>
> Hi Rajath,
>
> On Sun, Jun 02, 2013 at 09:58:56AM +0530, Rajath Shashidhara wrote:
> > Hello,
> >
> > Now that I have added a UNO Object of IDL type Content, there are some
> > methods that need to be implemented.
> > Out of which, com.sun.star.ucb.XContentIdentifier getIdentifier() is one
> of
> > them.
> > I have read the api reference for XContentIdentifier.
> >
> > It needs XComponentContext as an argument for its constructor.
>
> XContentIdentifier is a class, it does not have constructor.
>
> http://www.openoffice.org/api/docs/common/ref/com/sun/star/ucb/XContentIdentifier.html
>
>
> > That can be obtained from the argument to the constructor of my UCP
> class.
> > But, my question is what is identifier?
> > Is it the name of the file/folder ?
> > Also, the second method, getContentProviderScheme()
> > does it refer to the way of writing the path as cmis://<path> ?
>
> At the beginning you can simply use the default implementation. Try the
> following macro in an office installation without your extension, it
> will return cmis as schema is the identifier starts with cmis://
>
>
> REM  *****  BASIC  *****
>
> Option Explicit
>
> Sub Main
>     Dim aMap as Object
>     aMap =
> com.sun.star.container.EnumerableMap.create("string","com.sun.star.ucb.XContentIdentifier")
>
>     Dim oUCB as Object
>     oUCB = CreateUnoService("com.sun.star.ucb.UniversalContentBroker")
>
>     Dim sIds()
>     sIds = Array(_
>         "file:///tmp",_
>         "http://www.openoffice.org",_
>         "ftp://d...@openoffice.org/test/dummy",_
>         "cmis://cmis.alfresco.com:80/cmisatom/" )
>     Dim sId$
>     For Each sId in sIds
>         aMap.put( sId, oUCB.createContentIdentifier( sId ) )
>     Next
>
>     Dim oEnum as Object
>     oEnum = aMap.createElementEnumeration(false)
>     While oEnum.hasMoreElements()
>         Dim oPair as Object
>         oPair = oEnum.nextElement()
>         MsgBox "URL: " + oPair.First + Chr(13) + _
>                 "Content ID: " + oPair.Second.getContentIdentifier() +
> Chr(13) + _
>                 "Content Scheme: " +
> oPair.Second.getContentProviderScheme()
>     Wend
> End Sub
>
>
> If you want to implement the content identifier yourself, just create
> a class that implements XContentIdentifier.
>
> And simply reuse the XContentIdentifier you get in queryContent():
>
>     public XContent queryContent(XContentIdentifier xIdentifier) throws
> IllegalIdentifierException {
>         if (!isValidIdentifier(xIdentifier)) {
>             throw new IllegalIdentifierException();
>         }
>         // Check if a content with given XContentIdentifier already exists
>         // TODO implement a cache mechanism, for example a hash map
>         // Key: xIdentifier.getContentIdentifier()
>         // Value: xIdentifier
>         XContent xRet = queryExistingContent(xIdentifier);
>         if (xRet != null) {
>             return xRet;
>         }
>
>         CMISContent aContent = new CMISContent(m_xContext, xIdentifier);
>         // cache the new content
>         registerNewContent(aContent);
>
>         return aContent;
>     }
>
>
> 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