chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AJ Weber <>
Subject Re: Question about Alfresco Aspects
Date Wed, 13 Jul 2016 12:22:56 GMT
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.


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

View raw message