You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Neza Guillaine <gn...@gmail.com> on 2016/07/12 17:25:36 UTC

Question about Alfresco Aspects

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

Re: Question about Alfresco Aspects

Posted by Neza Guillaine <gn...@gmail.com>.
Dear OpenCMIS devs,

Is there any help you can provide me with? I have been googling around but
with no luck.
As previously stated, i wish to paginate my query result to give me 4100
results, I tried with pagination and operational context but it keeps
giving me only 2000 results.

and that happen only when i add the context stream of documents in my while
loop.
Plz any help will be much appreciated

On Tue, Jul 12, 2016 at 5:25 PM, Neza Guillaine <gn...@gmail.com> wrote:

> 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
>

Re: Question about Alfresco Aspects

Posted by Jeff Potts <je...@gmail.com>.
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 <aw...@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
>>>
>>
>

Re: Question about Alfresco Aspects

Posted by AJ Weber <aw...@comcast.net>.
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 Mller 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


Re: Question about Alfresco Aspects

Posted by Florian Müller <fm...@apache.org>.
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