I will add that I know of no reason to use the OpenCMIS Extension if you
are using CMIS 1.1 which understands aspects natively. CMIS calls them
secondary types. This gist may help: https://gist.github.com/jpotts/7242070

Jeff

On Wed, Jul 13, 2016 at 7:22 AM, AJ Weber <awe...@comcast.net> wrote:

> It would help if you provide a more complete code-snippet, but if you are
> CREATING a new document and wish to include Alfresco Aspects as part of the
> document's metadata, you do not need to cast the object at creation time...
>
> Construct your OBJECT_TYPE_ID with the type (for example cmis:document)
> plus any aspects you want to use at the outset, for example "cm:titled".
>
> To create a document you would set the other properties, and set
> PropertyIds.OBJECT_TYPE_ID to "D:cmis:document,P:cm:titled". (Don't forget
> Alfresco's additional prefixes such as "D:", "F:", "P:".)
>
>     props.put(PropertyIds.OBJECT_TYPE_ID, "D:cmis:document,P:cm:titled");
>
>
> Again, I don't know what you're actually trying to do because you have
> only given us one line of code.  The plural in your variable may mean
> nothing, or it may mean you're trying to cast an array/list to
> AlfrescoDocument, which would be incorrect as well.
>
> -AJ
>
>
>
> On 7/13/2016 3:25 AM, Florian Müller wrote:
>
>> Hi Alfrescians on this list,
>>
>> Can somebody please help Neza finding the latest Alfresco CMIS
>> documentation?!
>>
>> Thanks!
>>
>>
>> - Florian
>>
>>
>> Dear Florian,
>>>
>>> I hope this email finds you well.
>>> I am writing to request your help in the issue I have.
>>>
>>> I can successfully migrate documents from my sharepoint site to Alfresco
>>> using opencmis. But I want to apply aspects when uploading them in
>>> Alfresco.
>>>
>>> I read and was trying to use OpenCMIS extention, I had set the alfresco
>>> object  Factory in my repo like this:
>>>
>>> parameter.put(SessionParameter.OBJECT_FACTORY_CLASS,
>>> "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
>>>
>>> And I want to apply a custom aspect to my newly created documents. but
>>> before reaching there when I try to cast my docs to :
>>>  AlfrescoDocument alfDoc=(AlfrescoDocument) documentsToCreate;
>>>
>>> so that I call the aspects before creating the documents. it keeps
>>> throwing
>>> me an classCastException that my documents can not be casted into an
>>> alfresco documents.
>>>
>>> Is there any thing I am missing? I really want to apply one custom aspect
>>> type already created in our repo to all these new documents.
>>>
>>> Any advise all help will be highly appreciated as I am reaching at the
>>> final stage of my project.
>>>
>>> Regards,
>>> Neza
>>>
>>
>

Reply via email to