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

Can we get Alfresco webscript ticket from cmis session object?

$
0
0

Hi,

I am using Alfresceo v5.0.1 and cmis in my project.
I want to call Alfresco webscript. I saw some online and noticed we need ticket for that.

I wonder is there is any way to get ticket from alfresco session object or alfresco/service/api ?

Regards,
Archi


LoadRunner upload time is high when compared to the manual response time

$
0
0

We are working on performance testing of Alfresco where the user can upload files (PDF/DOCX etc), download files, Edit offline (Kind of checkout), upload new version (kind of check in new version). Loadrunner is being used as the performance testing tool.

We have an issue here – With a single user, the response times provided by the tool for upload & upload new version transactions are too high when compared to manual response time (taken via stop clock).

For example –
• Upload of 512 MB PDF file via script is taking 470 seconds at an average whereas while uploading manually via IE or Chrome, we are getting 147 seconds.

1. Can anyone please help here what is going wrong?
2. How the "boundary" is getting generated? Do it has any significance with respect to the response times.

Below is the script that we are using for upload.

web_add_header("Content-Type","multipart/form-data; boundary=----------ei4ae0ae0ei4cH2Ef1cH2Ij5cH2cH2");

web_submit_data("upload",
"Action=https://{URL}/share/proxy/alfresco/api/upload",
"Method=POST",
"EncType=multipart/form-data",
"RecContentType=application/json",
"Referer=https://{URL}/share/page/site/{SiteName}/documentlibrary",
"Snapshot=t18.inf",
"Mode=HTML",
ITEMDATA,
"Name=filedata", "Value=C:\\Alfresco\\{FileName_512MB}", "File=Yes", ENDITEM,
"Name=filename", "Value={FileName_10MB}", ENDITEM,
"Name=destination", "Value=null", ENDITEM,
"Name=siteId", "Value={SiteName}", ENDITEM,
"Name=containerId", "Value=documentLibrary", ENDITEM,
"Name=uploaddirectory", "Value=/", ENDITEM,
"Name=majorVersion", "Value=false", ENDITEM,
"Name=username", "Value=null", ENDITEM,
"Name=overwrite", "Value=false", ENDITEM,
"Name=thumbnails", "Value=doclib", ENDITEM,
LAST);

web_custom_request("activity",
"URL=https://{URL}/share/proxy/alfresco/slingshot/doclib/activity",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=https://{URL}/share/page/site/{SiteName}/documentlibrary",
"Snapshot=t19.inf",
"Mode=HTML",
"EncType=application/json",
"Body={\"site\":\"{SiteName}\",\"type\":\"file-added\",\"page\":\"document-details\",\"fileName\":\"{FilenameCorr}\",\"nodeRef\":\"workspace://SpacesStore/{c_noderef}\"}",
LAST);

Thanks,
Vinoth

moving folder

$
0
0

hello
when i try to move a folder to another from odoo i am using cmislib i have this bug :
i am using cmis:parentId
parentFolder = 'workspace://SpacesStore/945c820a-8fce-453b-98c4-521ba2df91d6'
Folder.updateProperties({u'cmis:parentId':parentFolder,})

File "/usr/local/lib/python2.7/dist-packages/cmislib-0.5.1-py2.7.egg/cmislib/model.py", line 1952, in updateProperties
**args)
File "/usr/local/lib/python2.7/dist-packages/cmislib-0.5.1-py2.7.egg/cmislib/model.py", line 297, in put
self._processCommonErrors(result)
File "/usr/local/lib/python2.7/dist-packages/cmislib-0.5.1-py2.7.egg/cmislib/model.py", line 318, in _processCommonErrors
raise InvalidArgumentException(error.status, error.url)
InvalidArgumentException: Error 400 at http://192.168.1.8:8080/alfresco/cmisatom/96d978c6-e387-4b95-a74d-1e5d6fc5fa22/entry?id=workspace%3A%2F%2FSpacesStore%2F945c820a-8fce-453b-98c4-521ba2df91d6*

any help please

Cmis query: ordering multivalue property

$
0
0

Hello,

It's possible use a multivalue custom property like:

<property name="sm:area">
<type>d:text</type>
<multiple>true</multiple>
<index enabled="true">
<tokenised>both</tokenised>
</index>
</property>

to use the property for order by in a query?

"SELECT  * FROM sm:prop order by  sm:area asc"
thank you

create folder using rest

$
0
0

I want to create a folder using CMIS rest api, the cmisaction : createFolder is unsupported,
Ant ideas ?

How to check read permission for sites and documents with CMIS

$
0
0

Hello,

I'm starting to use the openCMIS java api to access my alfresco repository and there is something that I don't understand about rights management.
the openCMIS api allows me to query and list the content of a private site even though the user specified for the session isn't a member of this site.

I also used the openCMIS workbench to test my repository and when I try to access to the private site and its content, I get a "permission denied" popup but if I click again on the site, I still can see its content and its properties.

Is there a way to prevent this behaviour? When I query for content using openCMIS, I would like to retrieve only the content for which the session user has read permission.

I'm using alfresco Community - 5.1.0 (r122274-b3) and openCMIS 0.13

Regards :)

edit: I restarted the server and the workbench and the queries and listing now returns the right elements.

5.1.x

Cmis checkin problem

$
0
0

Hi,

I am using widows server 2008 and alfresco Community - 5.0.0 (d r99759-b2). I have a constraint that I cannot use any library. Please suggest the solution and please update the file cmis-article given in sticky post for latest versions. Since you all well versed with the product but as a new comer it becomes very difficult when http urls are changing for every versions

I am using curl to post the request

curl -X POST -uadmin:admin "http://localhost:8080/alfresco/cmisatom/9e576c92-0890-4a49-af4f-eb2acdd478e7/c
hildren?id=workspace://SpacesStore/41c1dd8a-74ed-481f-907c-e0b18fcc7429&versioni
ngState=major" -H "Content-Type: application/atom+xml" -d @/createFile.atom.xml

I have tried the other way too

curl -X POST -uadmin:admin "http://localhost:8080/alfresco/cmisatom/9e576c92-0890-4a49-af4f-eb2acdd478e7/c
hildren?id=workspace://SpacesStore/41c1dd8a-74ed-481f-907c-e0b18fcc7429&versioni
ngState=major" -H "Content-Type: application/atom+xml" -d createFile.atom.xml

Content of file createFile.atom.xml is

<?xml version="1.0" encoding="utf-8"?>

sample-a.txt
A sample whitepaper named Sample A

d2luZG93cwlhZG1pbmlzdHJhdG9yCWFkbWluQDEyMw0Kc3FsCXNhCXB3ZEAxMjMNCg0Kd2luLXB1cHQyOWhoMTg3

cmis:document

I am getting below error
Apache Chemistry OpenCMIS - invalidArgument errorHTTP Status 400 - invalidArgumentInvalid XML!
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Invalid XML!
at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:95)
at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:226)
at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:173)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.repo.webdav.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:252)
at sun.reflect.GeneratedMethodAccessor614.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy275.doFilter(Unknown Source)
at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.CmisSecurityContextCleanerFilter.doFilter(CmisSecurityContextCleanerFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2139)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2045)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134)
at org.apache.chemistry.opencmis.commons.impl.XMLUtils.next(XMLUtils.java:228)
at org.apache.chemistry.opencmis.server.impl.atompub.AtomEntryParser.parse(AtomEntryParser.java:223)
at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$Create.serve(ObjectService.java:96)
at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)
... 41 more

5.0.d

----
Regards,
Avtansh Sharma
TechMahindra

404 entity with id x not found

$
0
0

Hi :)

I've installed alfresco community edition and I'm testing the Core REST api directly on my web browser.

Given a user called 'Gary' (created with Share), I tested the following urls which work:

  • /people/Gary
  • /people/Gary/activities
  • /people/Gary/favorite-sites

However, the following ones :

  • /people/Gary/networks
  • /people/Gary/favorites
  • /people/Gary/site-membership-requests

they return a 404 error with the message "briefSummary": "02240034 The entity with id: Gary was not found".

These last 3 urls only work for the user 'admin'.

I tried with another standard user and results are the same.

Is this normal?

Thanks :)

5.1.x

Cmis-article update

$
0
0

Hi Jeff,

Can you please provide us updated article of http://xml.coverpages.org/Potts-Optaros-CMIS-Tutorial-200912.pdf
so that we can have easy way in going through cmis calls. I am having problems while check in/check out which I have mentioned in my earlier post and still having them with curl. I know it is very difficult to answer each and every query. Can you provide us updated document with the server used as cmis.alfresco.com/alfresco which is open test server available from alfresco.

5.0.d

----
Regards,
Avtansh Sharma
TechMahindra

Disabling MTOM for CMIS SOAP

$
0
0

In our ERP system, I have to support integration library using SAAJ, integrating with various Content Management systems using CMIS SOAP interface. That is really big chunk of legacy code that has been used in production for years.
We have several clients using Alfresco, and now suddenly (I think with version 5?) they cannot use integration because Alfresco CMIS SOAP api requires MTOM.
I still have not figured out how to make SAAJ use MTOM, if that is possible at all.
Is there any way to disable MTOM on Alfresco server and use old-fashioned SOAP with attachments?
Please don't tell me to use JAX-WS or REST, I am in no position to rewrite the whole integration library.

Thanks,
Boris

5.0

create a site in alfresco

$
0
0

hello,
i am trying to create a site in alfresco by using WEB SCRIPT
" POst http://localhost:8080/share/service/modules/create-site"
i tested this java code that generates no errors and seems to execute fine but when i check in the alfresco dashboard the site is not created

public class TestShareCreateSitePost {
 
public staticvoid main(String[] args)throws Exception {
System.out.println(createSite());
}
 
private staticString createSite(){
try{
DefaultHttpClient client =new DefaultHttpClient();
HttpPost post =new HttpPost(
"http://localhost:8080/share/page/dologin");
List<NameValuePair> nameValuePairs =new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("username","admin"));
nameValuePairs.add(new BasicNameValuePair("password","admin"));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
client.execute(post);
CookieStore cookieStore = client.getCookieStore();
client =new DefaultHttpClient();
client.setCookieStore(cookieStore);
post =new HttpPost(
"http://localhost:8080/share/service/modules/create-site");
post.setHeader("Content-Type","application/json");
post.setEntity(new StringEntity(createSiteParameters(
"JavaTest-001","Sito di test by JAVA","JavaTest-001"),
"UTF-8"));
ResponseHandler<String> responseHandler =new BasicResponseHandler();
String response = client.execute(post, responseHandler);
return response;
}catch(Exception e){
e.printStackTrace();
}
return"Error!";
}
 
private staticString createSiteParameters(String title,
String description,String shortName){
String site ="{\"visibility\":\"PUBLIC\", "
+"\"sitePreset\":\"site-dashboard\", "+"\"title\":\""
+ title +"\", "+"\"description\":\""+ description +"\", "
+"\"shortName\":\""+ shortName +"\"}";
System.out.println(site);
return site;
}
}

i have also made the modification to disable the CSRF filter but it didn't work also
can someone tell me what im i missing ?
thx
5.0

CMIS and workflows

CMIS Query with IN_FOLDER

$
0
0

HI !

I really don't understand why my query doesn't work.

SELECT cmis:versionSeriesId as id,cmis:name as name,cmis:contentStreamMimeType as type,cmis:creationDate as created_at,cmis:lastModificationDate as updated_at from cmis:document AS D where IN_FOLDER ( D,'workspace://SpacesStore/4cd9b8a9-c06a-4ab5-a231-356c3b40c6d1') OR IN_FOLDER ( D,'workspace://SpacesStore/b79cb920-c90b-4629-b8c0-0bdbc26fdf46') ORDER BY cmis:lastModificationDate DESC&succinct=true

If my query containts just one IN_FOLDER everything seems to be ok.

I exec this query with curl.

Which is the "best" solution to retrieve all documents in a folder and his sub-folders ?

I use a recursive function to do this.

Thx !

5.0.a

Alfresco CMIS query working with AND but not with OR

$
0
0

I'm trying to get search result in alfresco using cmis query.

The below query runs fine and returns result

SELECT * FROM my:content WHERE (cmis:name Like '%a%' And my:description Like '%a%')

whereas the same query with OR condition doesn't return any result.

SELECT * FROM my:content WHERE (cmis:name Like '%a%' OR my:description Like '%a%')

Please Help. Thanks in advance.

4.2.f
A

behaviour not triggered on property changed

$
0
0

Hi all,

I'm trying to bind an Alfresco behaviour to a certain custom aspect preoperty change, but it isn't never triggered.

My aspect is defined as follows:

 <aspect name="sc:customAspect"><title>Custom Aspect</title><properties><property name="sc:customProperty"><type>d:text</type></property></properties></aspect>

I want my behaviour to be triggered when customProperty is changed, so my init method is:

 
    public void init(){ this.policyComponent.bindPropertyBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
                QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.ASPECT_CUSTOM_ASPECT),
                QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.PROP_CUSTOM_PROPERTY),new JavaBehaviour(this,"onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT)); }

And the onUpdateProperties method is never reached. If I change my init mthod to:

 
    public void init(){ this.policyComponent.bindClassBehaviour(NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
                QName.createQName(TcModel.NAMESPACE_TC_CONTENT_MODEL, TcModel.ASPECT_CUSTOM_ASPECT),new JavaBehaviour(this,"onUpdateProperties", NotificationFrequency.TRANSACTION_COMMIT)); }

It works, but the problem is that it enters in onUpdateProperties everyTime I change any property of the node.

How can I bind the behaviour in this case? Thank you!!

4.2

Create relationship using cmis

$
0
0

I want to make a rest call using rest CMIS rest call to create a relationship (association) between two files,
Does anyone know how to implement this ?

integrity check when adding a document

$
0
0

hello,

i am trying to add a document to alfresco with a java code :

public class AspectExample {
  private staticfinalString CM_TITLE ="cm:title";
  private staticfinalString CM_DESCRIPTION ="cm:description";
  private staticfinalString TEST_TITLE ="this is my title";
  private staticfinalString TEST_DESCRIPTION ="this is my description";
  private staticfinalString SERVICE_URL ="http://localhost:8080/alfresco/cmisatom";
  private staticfinalString USAGE ="java AspectExample <username> <password> <non-root folder path> <content name>";
  private staticfinalString NON_ROOT ="Specify a target base folder other than root"; 
  private Session session =null;
  private String user;
  private String password;
  private String folderPath;
  private String contentName; 
  public staticvoid main(String[] args)throws Exception {  
    	AspectExample ae =new AspectExample();
    	ae.setUser("admin");
    	ae.setPassword("admin");
    	ae.setFolderPath("/");
    	ae.setContentName("/home/yosri/gg.jpg");
    	ae.doExample();} 
  public void doExample(){
	createTestDoc(getFolderPath(), getContentName());return;} 
  public Session getSession(){if(this.session==null){// default factory implementation
		SessionFactory factory = SessionFactoryImpl.newInstance();
		Map<String, String> parameter =new HashMap<String, String>(); // user credentials
		parameter.put(SessionParameter.USER, getUser());
		parameter.put(SessionParameter.PASSWORD, getPassword()); // connection settings
		parameter.put(SessionParameter.ATOMPUB_URL, getServiceUrl()); 
		parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); // Set the alfresco object factory// Used when using the CMIS extension for Alfresco for working with aspects
		parameter.put(SessionParameter.OBJECT_FACTORY_CLASS,"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); 
		List<Repository> repositories = factory.getRepositories(parameter); this.session= repositories.get(0).createSession();}returnthis.session;} 
  public Folder getTestFolder(String folderPath)throws CmisObjectNotFoundException {
	Session session = getSession(); // Grab a reference to the folder where we want to create content
	Folder folder =null;try{
		folder =(Folder) session.getObjectByPath(folderPath);
		System.out.println("Found folder: "+ folder.getName()+"("+ folder.getId()+")");}catch(CmisObjectNotFoundException confe){
		Folder targetBaseFolder =null;String baseFolderPath = folderPath.substring(0, folderPath.lastIndexOf('/')+1);String folderName = folderPath.substring(folderPath.lastIndexOf('/')+1); //if this one is not found, we'll let the exception bubble up
		targetBaseFolder =(Folder) session.getObjectByPath(baseFolderPath); // Create a Map of objects with the props we want to set
		Map <String, Object> properties =new HashMap<String, Object>(); // Following sets the content type and adds the webable and productRelated aspects// This works because we are using the OpenCMIS extension for Alfresco
		properties.put(PropertyIds.OBJECT_TYPE_ID,"cmis:folder, P:cm:titled");
		properties.put(PropertyIds.NAME, folderName); 
		properties.put(CM_DESCRIPTION, TEST_DESCRIPTION);
		properties.put(CM_TITLE, TEST_TITLE); 
		folder = targetBaseFolder.createFolder(properties);
		System.out.println("Created folder: "+ folder.getName()+" ("+ folder.getId()+")");} return folder;} 
  public Document createTestDoc(String folderPath,String docName){// Grab a reference to the folder where we want to create content
	Folder folder = getTestFolder(folderPath); // Set up a name for the test documentString timeStamp =new Long(System.currentTimeMillis()).toString();String fileName = docName +" ("+ timeStamp +")"; // Create a Map of objects with the props we want to set
	Map <String, Object> properties =new HashMap<String, Object>(); // Following sets the content type and adds the webable and productRelated aspects// This works because we are using the OpenCMIS extension for Alfresco
	properties.put(PropertyIds.OBJECT_TYPE_ID,"cmis:document, P:cm:titled");
	properties.put(PropertyIds.NAME, fileName);
	properties.put(CM_DESCRIPTION, TEST_DESCRIPTION);
	properties.put(CM_TITLE, TEST_TITLE); // Set the content textString docText ="This is a sample document called "+ docName;byte[] content = docText.getBytes();
	InputStream stream =new ByteArrayInputStream(content);
	ContentStream contentStream =new ContentStreamImpl(fileName, BigInteger.valueOf(content.length),"text/plain", stream); // Create the document
	Document doc = folder.createDocument(
				   properties,
				   contentStream,
				   VersioningState.MAJOR);
	System.out.println("Created content: "+ doc.getName()+"("+ doc.getId()+")");
	System.out.println("Content Length: "+ doc.getContentStreamLength()); return doc;}<code>   
but when i run i got an integrity check exception and i dont know where is the problem  <code>
nvalid property value:
   Node: workspace://SpacesStore/f1455b0d-efdb-40aa-b727-7817e0d6d5a7
   Name:/home/yosri/gg.jpg(1460478193873)
   Type:{http://www.alfresco.org/model/content/1.0}content
   Property:{http://www.alfresco.org/model/content/1.0}name
   Constraint: 03120135 Value '/home/yosri/gg.jpg (1460478193873)' is not valid as a file name. This property must be a valid file name.at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:445)
	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:568)
	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:109)
	at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:650)
	at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:88)
	at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:443)
	at com.someco.cmis.examples.AspectExample.createTestDoc(AspectExample.java:145)
	at com.someco.cmis.examples.AspectExample.doExample(AspectExample.java:56)
	at com.someco.cmis.examples.AspectExample.main(AspectExample.java:52)<code>
5.0

CMIS Query with ORDER BY

$
0
0

HI,
I'm afraid to ask another dumbass question...

After few hours of googling, I don't see anything about my error.

Why this cmis query works on Alfresco 5.1 but doesn't work on alfresco 5.0.0 ?????

<?php 
$curl = curl_init(); 
curl_setopt_array($curl, array(
  CURLOPT_PORT =>"8080",
  CURLOPT_URL =>"http://192.168.137.153:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?alf_ticket=TICKET_bdfd336aa4a28d7a0ccf3b0c29587f337d3c9de4&skipCount=0&maxItems=10",
  CURLOPT_RETURNTRANSFER =>true,
  CURLOPT_ENCODING =>"",
  CURLOPT_MAXREDIRS =>10,
  CURLOPT_TIMEOUT =>30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =>"POST",
  CURLOPT_POSTFIELDS =>"cmisaction=query&statement=SELECT%20cmis%3AversionSeriesId%20as%20id%2Ccmis%3Aname%20as%20name%2Ccmis%3AcontentStreamMimeType%20as%20type%2Ccmis%3AcreationDate%20as%20created_at%2Ccmis%3AlastModificationDate%20as%20updated_at%20from%20cmis%3Adocument%20AS%20D%20where%20IN_FOLDER(D%2C'4cd9b8a9-c06a-4ab5-a231-356c3b40c6d1')%20OR%20IN_FOLDER(D%2C'dab65306-35ea-4acb-9325-c53380c4a069')%20OR%20IN_FOLDER(D%2C'ad7a52d5-f6be-42cf-80bf-ffc140826efc')%20OR%20IN_FOLDER(D%2C'462c8eae-c40a-4865-aa4b-ad79a5c8597b')%20OR%20IN_FOLDER(D%2C'ea7266db-4184-4b78-94d0-be40947d14f8')%20OR%20IN_FOLDER(D%2C'1d739de1-4926-49aa-8072-eb433fcfedae')%20OR%20IN_FOLDER(D%2C'4688342f-39fa-490f-95b6-005476033f22')%20OR%20IN_FOLDER(D%2C'd99ab345-8833-498d-a84a-e83a23c87c85')%20OR%20IN_FOLDER(D%2C'dfa74b4e-3b69-425d-b34a-3625cfdff504')%20OR%20IN_FOLDER(D%2C'3ec1a679-0cff-4623-b000-aaaf4220bb68')%20OR%20IN_FOLDER(D%2C'88bc654b-4af0-4a2f-996a-c4336097c9f3')%20OR%20IN_FOLDER(D%2C'179def44-2733-41c2-a413-48f3ecaab24d')%20OR%20IN_FOLDER(D%2C'0a6c2258-09b4-401c-9c86-ff77a8370e8d')%20OR%20IN_FOLDER(D%2C'a54d5a67-8c89-419d-84cc-cce5d8f32786')%20OR%20IN_FOLDER(D%2C'8a7037da-9d8f-41ac-9438-91f22b2164c9')%20OR%20IN_FOLDER(D%2C'e585ec5c-927d-411c-b0d7-6cb917ef888a')%20OR%20IN_FOLDER(D%2C'b79cb920-c90b-4629-b8c0-0bdbc26fdf46')%20OR%20IN_FOLDER(D%2C'48e495c6-b467-45a4-aeac-04e70dc93f35')%20OR%20IN_FOLDER(D%2C'9878f2c9-2e00-45d4-92e7-13ec33a444af')%20OR%20IN_FOLDER(D%2C'0b214c61-6176-4c41-bcb5-a9986f37d3b8')%20OR%20IN_FOLDER(D%2C'4b7076a5-cb23-4c49-81e2-1c195c4cafe3')%20OR%20IN_FOLDER(D%2C'f055a4af-2842-4467-b33b-d305bccb285e')%20OR%20IN_FOLDER(D%2C'fe905450-7b33-4ff4-8dc9-a7fb984e954d')%20OR%20IN_FOLDER(D%2C'25257a64-83e4-4338-abae-9233ed469e12')%20OR%20IN_FOLDER(D%2C'e1a7755a-c5e4-4349-9393-10e8ed46ac2b')%20OR%20IN_FOLDER(D%2C'7a7bc61c-a43e-49be-adbd-8913b0a11e0a')%20OR%20IN_FOLDER(D%2C'cee526d4-cfdb-4f59-958d-9d5c8fde7187')%20OR%20IN_FOLDER(D%2C'f302d3c2-f753-4995-888b-c403b4a9733c')%20OR%20IN_FOLDER(D%2C'd8c02a53-1cf4-405e-9d52-78c61a6a0a85')%20OR%20IN_FOLDER(D%2C'4cfcd36f-5176-4229-81be-b150ffa52339')%20OR%20IN_FOLDER(D%2C'2420764f-c3e7-4dec-a284-56151d8ef16d')%20OR%20IN_FOLDER(D%2C'61714f1f-044c-4e3b-b3e5-00156843c16b')%20OR%20IN_FOLDER(D%2C'15b1ca1e-9aa1-4ecb-a288-069f5b9bcc50')%20OR%20IN_FOLDER(D%2C'b2d874de-84e5-4702-9ccc-b7a12863d6dd')%20OR%20IN_FOLDER(D%2C'e3cc2948-f2d7-4e0e-866f-494eab8e3d26')%20ORDER%20BY%20cmis%3AcreationDate&succinct=true",
  CURLOPT_HTTPHEADER => array("cache-control: no-cache","content-type: application/x-www-form-urlencoded","postman-token: 85e7c16e-a741-f6df-6ab8-29cd736f27b5"),)); 
$response = curl_exec($curl);
$err = curl_error($curl); 
curl_close($curl); if($err){
  echo "cURL Error #:" . $err;}else{
  echo $response;}

error :

{
"exception":"runtime",
"message":"0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON",
"stacktrace":"org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: 0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON\n\tat org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:99)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)\n\tat com.sun.proxy.$Proxy288.query(Unknown Source)\n\tat org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.query(ConformanceCmisServiceWrapper.java:1157)\n\tat org.apache.chemistry.opencmis.server.impl.browser.DiscoveryService$Query.serve(DiscoveryService.java:76)\n\tat org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)\n\tat org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.dispatch(CmisBrowserBindingServlet.java:355)\n\tat org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.service(CmisBrowserBindingServlet.java:234)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\n\tat org.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:180)\n\tat org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:418)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:600)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:380)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:261)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.access$101(PublicApiRepositoryContainer.java:26)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer$2.doWork(PublicApiRepositoryContainer.java:99)\n\tat org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)\n\tat org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:95)\n\tat org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)\n\tat org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)\n\tat org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)\n\tat org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)\n\tat org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)\n\tat org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2378)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.lang.Thread.run(Unknown Source)\nCaused by: org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.postQuery(SolrQueryHTTPClient.java:616)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.postSolrQuery(SolrQueryHTTPClient.java:559)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:520)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:51)\n\tat org.alfresco.repo.search.impl.solr.DbOrIndexSwitchingQueryLanguage.executeQuery(DbOrIndexSwitchingQueryLanguage.java:214)\n\tat org.alfresco.repo.search.impl.solr.SolrOpenCMISQueryServiceImpl.query(SolrOpenCMISQueryServiceImpl.java:89)\n\tat sun.reflect.GeneratedMethodAccessor711.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\tat java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)\n\tat com.sun.proxy.$Proxy133.query(Unknown Source)\n\tat org.alfresco.opencmis.CMISConnector.query(CMISConnector.java:2918)\n\tat org.alfresco.opencmis.AlfrescoCmisServiceImpl.query(AlfrescoCmisServiceImpl.java:2373)\n\tat sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\tat java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\n\tat org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)\n\tat org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)\n\tat org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisStreamInterceptor.invoke(AlfrescoCmisStreamInterceptor.java:72)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisServiceInterceptor.invoke(AlfrescoCmisServiceInterceptor.java:101)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:83)\n\t... 48 more\n"
}

If I remove all the "OR IN_FOLDER" conditions then it works on alfresco 5.0.0 ...

5.0

A document has a cmis:contentStreamFileName value of null, I have never seen this, is it a bug?

$
0
0

Dear all,

In out-of-the-box Alfresco Community 5.1.e I stumble upon this very rare case of a document with a null cmis:contentStreamFileName

Is it an Alfresco bug?
If it is not a bug, in what cases is this supposed to happen?
I uploaded this file via CMIS. All other files seem to have a cmis:contentStreamFileName.

Thanks a lot!
Nicolas Raoul
CmisSync - Aegif

5.1.x
CMIS

Apache CMIS PHP versioning

$
0
0

Hi,

I'm using the Apache Chemistry CMIS PHP client to upload documents from a local folder to Alfresco. Here's the PHP code I'm currently using:

require_once('cmis_repository_wrapper.php');require_once('cmis_service.php'); $repo_url="http://127.0.0.1:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom";$repo_username="user";$repo_password="pass"; $client=new CMISService($repo_url,$repo_username,$repo_password); $repo_folder="/alfrescoFolder";$source_folder="localFolder/";$source_files=array_diff(scandir("$source_folder",1),array('..','.'));$myfolder=$client->getObjectByPath($repo_folder); foreach($source_filesas$file){
    try{$upload=$client->createDocumentFromSource($myfolder->id,$file,"$source_folder/$file");}
    catch(Exception $e){echo"Error";}}

This script works fine and documents are uploaded without problem, however, I don't know how to create versions of existing documents. For example, let's say I have a document in my Alfresco repository named "example.txt". Well, if I try to upload a document from my local folder with the same name, I get an error. I want to be able to specify that the document I'm uploading is a new version of an existing document. Does anyone know how I can do that? Any help will be appreciated.

Thanks.

5.1.x
Viewing all 252 articles
Browse latest View live