Quantcast
Channel: Alfresco Forums - Alfresco API
Viewing all 252 articles
Browse latest View live

howto create filelink types with CMIS API

$
0
0

I need to create filelinks in alfresco 5.x.

Formerly with alfresco_4 I was using WebServices, with java code like

          CMLCreate create =new CMLCreate("1", parentRef,null,null,null,"{http://www.alfresco.org/model/application/1.0}filelink", contentProps);
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);

Now with Alfresco 5 those WebServices are obsoletes and have to use CMIS to to same thing.
I found lot of explanations and/or examples on how to create/upload files in alfresco using CMIS API, but no one telling me how to create filelink object types.

While listing existing contents in some of my directoires in the repository with

     folder.getDescendants(-1);

I found the WebServiceFactory created links to be of type "I:app:filelink"
(notice the "l:" before "app")
What's that ??

Any help to achieve by program the creation of a filelink object using CMIS API should be appreciated.

Bernard

5.0.d


CmisSession.query immediately after createDocument does not find the document

$
0
0

CmisSession.query immediately after createDocument operation does not find the document
Same query in CMIS workbench retrieves the result
Same query issued after few seconds retrieves

It appeared to be a CmisSession cache problem

So I changed my query issuing statement as below. Still does not seem to work...

OperationContext operationContext = cmisSession.createOperationContext();
operationContext.setCacheEnabled(false);
ItemIterable<QueryResult> results = cmisSession.query(cmisQuery,false, operationContext);

The same code after a few seconds retrieve the expected results and work...

My initial session creation logic is...

Map<String, String> parameter =new HashMap<String, String>();
parameter.put(SessionParameter.USER,this.user);
parameter.put(SessionParameter.PASSWORD,this.password);
parameter.put(SessionParameter.ATOMPUB_URL,this.host);
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
 
repositories = sessionFactory.getRepositories(parameter);
cmisRepository = repositories.get(0);
 
parameter.put(SessionParameter.REPOSITORY_ID, cmisRepository.getId());
cmisSession = sessionFactory.createSession(parameter);

How to retrieve content via REST

$
0
0

I'd like to retrieve some content via REST but specifying a particular version, or other data

I can get the content
http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html

This returns exactly what I want (the content of 'fragment.html'), but I'd like to be able to specify a particular version (or other such metadata), for example return version 1.0 of file or version 1.1 of the file

Is this possible?

I see there's another way of doing this
http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&statement=select * from cmis:document where cmis:name='fragment.html'

but it return only the metadata of file 'fragment.html', not the content, and i can't include cmis:versionLabel in the where clause

5.1.x

Help on CMIS Query using IN_TREE condition

$
0
0

Using Alfresco Community edition 5.0.d

I am using CMIS 1.1 Atom Pub URL: http://test-alfresco:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom

My libraries

<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-api</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-impl</artifactId>
<version>0.13.0</version>
</dependency>

In Alfresco Share, I verified the id of the folder. The folder that I am talking about is the documentLibrary folder under a specific site. On the documentLibrary folder, if I see view properties, or even if I see the browser URL, I see this below.

http://test-alfresco:8080/share/page/context/mine/folder-details?nodeRef=workspace://SpacesStore/6c3fd5c2-1a69-48a6-8d04-d39339ba53ec

Also, in my code using CMIS API, if I get the CmisObject of this documentLibrary folder, it has this id 6c3fd5c2-1a69-48a6-8d04-d39339ba53ec

Using the Share App, I see all the documents under this folder, but under some sub folders.

However, if I construct my query using the above id with the IN_TREE clause, I do not get these documents (images) in the results.
I tried CMIS workbench to cross check. I am glad it behaves the same way as my code.

My CMIS workbench query is

SELECT doc.*, salo.* FROM cmis:document AS doc JOIN salo:documentProperties AS salo ON doc.cmis:objectId = salo.cmis:objectId  
WHERE IN_TREE(doc,'workspace://SpacesStore/6c3fd5c2-1a69-48a6-8d04-d39339ba53ec')
AND (salo.salo:lo_key =163) AND (salo.salo:lo_category ='Test')

If I remove the IN_TREE clause, query brings all the documents. All these documents are under one of the folders under this documentLibrary folder. I verified this using Alfresco Share.

Appreciate your help

CMIS to find SmartFolders

$
0
0

Hi

I create a SmartFolder on alfresco server but when i found folders the SmartFolder that i created was not returned.

The query that i use is:

"select cmis:objectId, cmis:name, cmis:path, cmis:description from cmis:folder where in_folder (???) order by cmis:name"

Is there some possible to return SmartFolder using CMIS query?

Thanks

5.1.x

PHP CMIS

$
0
0

I have an external portal created from php whose purpose is to show the status of a document queried via tracking number(a custom field) I've been trying to figure out how to do it and honestly, I am quite confused on how. can anyone point me into the right direction? tried searching in google.. I am confused.

5.1.x

Query for cmis:secondaryObjectTypeIds

$
0
0

Hi.

I would like to know if there's any way to query for cmis:secondaryObjectTypeIds from cmis:document.

I know its values can be obtained with a simple SELECT * FROM cmis:document, but I only want this property and I'm trying to maximize performance (though I'm not really sure if it would have any significant improvement, but I would like to try). I know that a simple "SELECT cmis:secondaryObjectTypeIds FROM cmis:document" doesn't work because it's a multi-valued property, so what it's the way to do it? Or the only way it's through a "SELECT *"?

5.1.x

海归回国就业WECHAT/QQ1907661723办理加拿大英属哥伦比亚大学毕业证成绩单文凭学历认证University of British Columbia

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大英属哥伦比亚大学毕业证成绩单文凭学历认证University of British Columbia


海归回国就业WECHAT/QQ1907661723办理加拿大英属哥伦比亚大学毕业证成绩单文凭学历认证University of British Columbia

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大英属哥伦比亚大学毕业证成绩单文凭学历认证University of British Columbia

海归回国就业WECHAT/QQ1907661723办理加拿大西三一大学毕业证成绩单文凭学历认证Trinity Western University

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大西三一大学毕业证成绩单文凭学历认证Trinity Western University

海归回国就业WECHAT/QQ1907661723办理加拿大菲莎河谷大学毕业证成绩单文凭学历认证University ofthe Fraser Valley

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大菲莎河谷大学毕业证成绩单文凭学历认证University ofthe Fraser Valley

海归回国就业WECHAT/QQ1907661723办理加拿大卡里布大学毕业证成绩单文凭学历认证University College of the Cariboo

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大卡里布大学毕业证成绩单文凭学历认证University College of the Cariboo

海归回国就业WECHAT/QQ1907661723办理加拿大费雷泽大学毕业证成绩单文凭学历认证University College of the Fraser Valley

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大费雷泽大学毕业证成绩单文凭学历认证University College of the Fraser Valley

海归回国就业WECHAT/QQ1907661723办理加拿大卡尔加里大学毕业证成绩单文凭学历认证University of Calgary

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大卡尔加里大学毕业证成绩单文凭学历认证University of Calgary

海归回国就业WECHAT/QQ1907661723办理加拿大卡尔加里大学毕业证成绩单文凭学历认证University of Calgary

$
0
0

海归回国就业WECHAT/QQ1907661723办理加拿大卡尔加里大学毕业证成绩单文凭学历认证University of Calgary


howto create filelink types with CMIS API

$
0
0

I need to create filelinks in alfresco 5.x.

Formerly with alfresco_4 I was using WebServices, with java code like

          CMLCreate create =new CMLCreate("1", parentRef,null,null,null,"{http://www.alfresco.org/model/application/1.0}filelink", contentProps);
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] result = WebServiceFactory.getRepositoryService().update(cml);

Now with Alfresco 5 those WebServices are obsoletes and have to use CMIS to to same thing.
I found lot of explanations and/or examples on how to create/upload files in alfresco using CMIS API, but no one telling me how to create filelink object types.

While listing existing contents in some of my directoires in the repository with

     folder.getDescendants(-1);

I found the WebServiceFactory created links to be of type "I:app:filelink"
(notice the "l:" before "app")
What's that ??

Any help to achieve by program the creation of a filelink object using CMIS API should be appreciated.

Bernard

5.0.d

CmisSession.query immediately after createDocument does not find the document

$
0
0

CmisSession.query immediately after createDocument operation does not find the document
Same query in CMIS workbench retrieves the result
Same query issued after few seconds retrieves

It appeared to be a CmisSession cache problem

So I changed my query issuing statement as below. Still does not seem to work...

OperationContext operationContext = cmisSession.createOperationContext();
operationContext.setCacheEnabled(false);
ItemIterable<QueryResult> results = cmisSession.query(cmisQuery,false, operationContext);

The same code after a few seconds retrieve the expected results and work...

My initial session creation logic is...

Map<String, String> parameter =new HashMap<String, String>();
parameter.put(SessionParameter.USER,this.user);
parameter.put(SessionParameter.PASSWORD,this.password);
parameter.put(SessionParameter.ATOMPUB_URL,this.host);
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
 
repositories = sessionFactory.getRepositories(parameter);
cmisRepository = repositories.get(0);
 
parameter.put(SessionParameter.REPOSITORY_ID, cmisRepository.getId());
cmisSession = sessionFactory.createSession(parameter);

How to retrieve content via REST

$
0
0

I'd like to retrieve some content via REST but specifying a particular version, or other data

I can get the content
http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/Sites/TEST/fragment.html

This returns exactly what I want (the content of 'fragment.html'), but I'd like to be able to specify a particular version (or other such metadata), for example return version 1.0 of file or version 1.1 of the file

Is this possible?

I see there's another way of doing this
http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&statement=select * from cmis:document where cmis:name='fragment.html'

but it return only the metadata of file 'fragment.html', not the content, and i can't include cmis:versionLabel in the where clause

5.1.x

Help on CMIS Query using IN_TREE condition

$
0
0

Using Alfresco Community edition 5.0.d

I am using CMIS 1.1 Atom Pub URL: http://test-alfresco:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom

My libraries

<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-api</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-impl</artifactId>
<version>0.13.0</version>
</dependency>

In Alfresco Share, I verified the id of the folder. The folder that I am talking about is the documentLibrary folder under a specific site. On the documentLibrary folder, if I see view properties, or even if I see the browser URL, I see this below.

http://test-alfresco:8080/share/page/context/mine/folder-details?nodeRef=workspace://SpacesStore/6c3fd5c2-1a69-48a6-8d04-d39339ba53ec

Also, in my code using CMIS API, if I get the CmisObject of this documentLibrary folder, it has this id 6c3fd5c2-1a69-48a6-8d04-d39339ba53ec

Using the Share App, I see all the documents under this folder, but under some sub folders.

However, if I construct my query using the above id with the IN_TREE clause, I do not get these documents (images) in the results.
I tried CMIS workbench to cross check. I am glad it behaves the same way as my code.

My CMIS workbench query is

SELECT doc.*, salo.* FROM cmis:document AS doc JOIN salo:documentProperties AS salo ON doc.cmis:objectId = salo.cmis:objectId  
WHERE IN_TREE(doc,'workspace://SpacesStore/6c3fd5c2-1a69-48a6-8d04-d39339ba53ec')
AND (salo.salo:lo_key =163) AND (salo.salo:lo_category ='Test')

If I remove the IN_TREE clause, query brings all the documents. All these documents are under one of the folders under this documentLibrary folder. I verified this using Alfresco Share.

Appreciate your help

CMIS to find SmartFolders

$
0
0

Hi

I create a SmartFolder on alfresco server but when i found folders the SmartFolder that i created was not returned.

The query that i use is:

"select cmis:objectId, cmis:name, cmis:path, cmis:description from cmis:folder where in_folder (???) order by cmis:name"

Is there some possible to return SmartFolder using CMIS query?

Thanks

5.1.x
Viewing all 252 articles
Browse latest View live