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

Cmis - Comments from node

$
0
0

Hi

i don't find how to get children from a node in Alfresco with OpenCmis.
i'm working on JAVA.
I have a document in my repository.
I can access to it with my java class who call methods from OpenCmis but i don't find any function or method to get children. i have need this to get comments of my node.

Thanks to help me :-)

info :
Alfresco One 4.2.4
OpenCmis 0.10.0

4.2

Remotely Created Tasks

$
0
0

We are using Alfresco for a pilot project and have a requirement to capture alerts from an external system. It seems that as the end users are using Alfresco as the primary interface that the alerts be displayed within the dashboard. I am new to Alfresco and wondered if this was possible with the integrated task manager or perhaps some other plugin.

Are there any examples that show a remote java application creating and assigning tasks to a user within the Alfresco task manager. I am looking for working code. The aim is that the task is created and can then be marked by the assigned user with the relevant states.

The remote application must communicate using a remote Java client and use the Alfresco web-services to create the task.

Alternatively, are there any plugins which allow me to record a log entry which has some state associated and can be driven by web-services.

Any thoughts would be greatly appreciated.

export utility - defaults to MySql

$
0
0

With 4.2, I'm trying to create an acp file from a folder:

java -XX:MaxPermSize=512m -classpath /vol1/alfresco-4.2.f/tomcat/lib/servlet-api.jar:classes/alfresco/module:classes:lib/* org.alfresco.tools.Export -user admin -pwd XXXX -s workspace://SpacesStore -verbose -p /sys:system/sys:authorities -d /tmp authorities.xml

My Alfresco uses postgresql, but something is defaulting to MySQL and am seeing:

2015-08-10 17:02:16,232 INFO [alfresco.repo.admin] [main] Using database URL 'jdbc:mysql:///alfresco' with user 'alfresco'.
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

Can I override the connection string somehow???

4.2.f

How can I get value of Type property using cmis API(Type property is available in create content wizard)

$
0
0

Hi

How can I get Type Property. Type property is available in create content wizard.
How can I get all this type property value Using query
I am using alfresco 4.2 f

Thanks

Get children of a node faster

$
0
0

I'm using the alfresco api on my Java backed webscript. I have an uuid, and I do a new NodeRef with this uuid and then I use getChildAssoc from nodeService to obtain all the direct child nodes.

NodeRef nodeRef =new NodeRef("workspace://SpacesStore/"+ uuid);
List<ChildAssociationRef> childRefList =new ArrayList<ChildAssociationRef>();
    childRefList = getNodeService().getChildAssocs(nodeRef); 
for(ChildAssociationRef childRef : childRefList){
    NodeRef nodeChildRef = childRef.getChildRef();
    ...
}

But on folders with more than 100 subfolders it takes too long. Are there another quicky way to obtain all direct children of a node? The fastest method you know to do that.

Thanks!

4.1

Access user task list using alf_ticket

$
0
0

Hi,

I have developed a web application which is integrated with Alfresco using CMIS. Now i want to have logged in user task list by passing alf-ticket or by only username as i don't have access to password.

So, Anyone please help me with this..how i can expose user tasklist using login ticket or by any other way?

Thanks in advance!
Nancy

5.0.a

presence Root object

$
0
0

Hello,

I have a question regarding the presence root object.

In the documentation (http://docs.alfresco.com/5.0/references/API-JS-rootscoped.html), the following is stated:
presence | org.alfresco.repo.jscript.Presence | Root object providing access to methods for detecting online presence of users.

Well we're using the Alfresco SDK 2.1, but when I use the presence.getDetails(people.getPerson("admin")) method I just get a null|null string back.

I think I'm just using the object the wrong way.

Could maybe someone explain me the use of the presence root object and what it actually does.

Thanks

OpenCMIS: CmisRuntimeException

$
0
0

Hi,

Here is my problem: I try to get a cmisObject with the method "getObject(String objectId, OperationContext context)" and "getObjectByPath(String path, OperationContext context)".
For almost all my files, it works perfectly... But for some of them, I receive this error:

at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:495) [chemistry-opencmis-client-bindings-0.12.0.jar:0.12.0]
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:634) [chemistry-opencmis-client-bindings-0.12.0.jar:0.12.0]
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:857) [chemistry-opencmis-client-bindings-0.12.0.jar:0.12.0]
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObjectByPath(ObjectServiceImpl.java:634) [chemistry-opencmis-client-bindings-0.12.0.jar:0.12.0]
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:556) [chemistry-opencmis-client-impl-0.12.0.jar:0.12.0]

Then I tried to enter this as the URL address: http://192.168.6.65:8087/alfresco/api/-default-/public/cmis/versions/1.1/atom/path?path=%2FVille+de+Li%C3%A8ge%2FtestLNA%2Fx.jpg&filter=&includeAllowableActions=true&includeACL=true&includePolicyIds=false&includeRelationships=none&renditionFilter=cmis%3Anone

I am 100% sure the file exists but this is the error:

HTTP Status 500 - runtime
null
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:99)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy293.getObjectByPath(Unknown Source)
at org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.getObjectByPath(ConformanceCmisServiceWrapper.java:933)
at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$GetObjectByPath.serve(ObjectService.java:429)
at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)
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.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:188)
at org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:418)
at org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:600)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:380)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:261)
at org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26)
at org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81)
at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)
at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)
at org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)
at org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)
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.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:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
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:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2378)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException
at java.math.BigDecimal.(BigDecimal.java:494)
at java.math.BigDecimal.(BigDecimal.java:383)
at java.math.BigDecimal.(BigDecimal.java:806)
at java.math.BigDecimal.valueOf(BigDecimal.java:1274)
at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$42.convert(DefaultTypeConverter.java:460)
at org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter$42.convert(DefaultTypeConverter.java:451)
at org.alfresco.service.cmr.repository.datatype.TypeConverter.convert(TypeConverter.java:114)
at org.alfresco.opencmis.CMISConnector.getProperty(CMISConnector.java:2162)
at org.alfresco.opencmis.CMISConnector.addAspectProperties(CMISConnector.java:1863)
at org.alfresco.opencmis.CMISConnector.getNodeProperties(CMISConnector.java:1934)
at org.alfresco.opencmis.CMISConnector.createCMISObject(CMISConnector.java:1480)
at org.alfresco.opencmis.AlfrescoCmisServiceImpl.getObjectByPath(AlfrescoCmisServiceImpl.java:1917)
at sun.reflect.GeneratedMethodAccessor737.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisStreamInterceptor.invoke(AlfrescoCmisStreamInterceptor.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisServiceInterceptor.invoke(AlfrescoCmisServiceInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:83)
... 48 more

Do you have any ideas? When I enter the modify menu and save (without changing any values) the file in Alfresco share, THEN it works... I don't know why.

For information, I use Alfresco 5.0.c and CMIS 1.1. I attached one of the file that makes a problem.

Thanks forward, plz,

Lucas Naldi


How to search for all sub folders in a folder using CMIS

$
0
0

Hi,

I am using Alfresco v4.1 and cmis v0.13 jar files.

I want to know 2 things:

1)How do I find list of Sites in root folder
2) How do I find list of sub folders in a folder?

I tried following but I got exceptions --

 CmisObject object = cmisSession.getObject(cmisSession.createObjectId(folderId));
        Folder folder =(Folder)object;
        OperationContext operationContext = cmisSession.createOperationContext();
        operationContext.setMaxItemsPerPage(maxItemsPerPage); 
        ItemIterable<CmisObject> children = folder.getChildren(operationContext);for(CmisObject child :children){
             System.out.println(child.getName());}

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject
at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:348)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:523)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:493)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:485)
at com.alfresco.api.example.CmisBasicQuery.doQuery(CmisBasicQuery.java:37)
at com.alfresco.api.example.CmisBasicQuery.doExample(CmisBasicQuery.java:23)
at com.alfresco.api.example.CmisBasicQuery.main(CmisBasicQuery.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.api.TransientCmisObject

CMIS:Get all metadata

$
0
0

Hi All

Can we get all custom metadata through CMIS object.

document.getProperties would only return OOTB properties.Correct me if am wrong

I have 2 types of custom properties

1)Part of custom Aspect
2)Not part of any aspect

Since there is lot of metadata, I am looking for some API which would return list of all custom metadata.

Please provide your inputs

Rahul Mackdani

Cannot set Title, Location on DataListItem using java opencmis

$
0
0

Hi,

We want to write properties into a datalist but are having difficulty populating the fields using a java program.

We're trying to add DataList items into a Event List (built-in type of data list) that we created manually on the Alfresco site. we are able to set the value for property 'Description' on the item being added to my list using the Java code below, but not able to set 'Title' or 'Location' properties on it. Have tried retrieving the newly created item and updating the properties, but that does not work either. Could someone please suggest how to work this out. Please note that my list is not a custom data list.

Thanks
Dev

publicclass Test 
{publicstaticvoid main(String[] args){
    	Map<String, String> parameter =new HashMap<String, String>();
    	AlfrescoItemType itemType =null;// Set the user credentials
    	parameter.put(SessionParameter.USER, "admin");
    	parameter.put(SessionParameter.PASSWORD, "root"); 
    	// Specify the connection settings
    	parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8181/alfresco/api/-default-/public/cmis/versions/1.1/atom");
    	parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); 
    	// Set the alfresco object factory
    	parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); 
    	// Create a session
    	SessionFactory factory = SessionFactoryImpl.newInstance();
    	Session session = factory.getRepositories(parameter).get(0).createSession();
AlfrescoFolder dataLists =(AlfrescoFolder) session.getObjectByPath("/Sites/alerts/dataLists/262abf17-b519-48b2-91d8-1eadb919dae7");System.out.println(" dataList object---"+dataLists.getName()); 
    	Map<String, Object> properties =new HashMap<String, Object>();//	properties.put(PropertyIds.OBJECT_TYPE_ID, "D:dl:dataListItem");
    	properties.put(PropertyIds.OBJECT_TYPE_ID, "D:dl:event"); 
	String var_name_extension ="9";
	properties.put(PropertyIds.NAME, "some name"+var_name_extension);
    	properties.put(PropertyIds.DESCRIPTION, "some description"+var_name_extension);//    	properties.put("cm:title", "some title3"); 
// 	IF BELOW 4 LINES ARE USED, IT CREATES AN ITEM IN THE LIST BUT WITHOUT DESCRIPTION, I see an empty row IN THE LIST 
//    	properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled");//		properties.put(PropertyIds.NAME, "some name"+var_name_extension);//    	properties.put("cm:title", "some title");//    	properties.put("cm:description", "some description"); 
	ObjectId newItemId = session.createItem(properties, dataLists);System.out.println("newItemId===="+newItemId); 
	AlfrescoDocument dLItem =(AlfrescoDocument) session.getObjectByPath("/Sites/alerts/dataLists/262abf17-b519-48b2-91d8-1eadb919dae7/some name"+var_name_extension);//	dLItem.addAspect("D:dl:dataListItem,P:cm:titled", "HELLO"); 
	Map<String, Object> newProps =new HashMap<String, Object>();
	newProps.put("cm:title", "HELLO");
	dLItem.updateProperties(newProps,true); 
    }}
5.0.d

not able to create folder using CMIS API

$
0
0

Hi,

I am building one client application which is integrated with alfresco using external authentication. I am able to create a session with alfresco using current user alf_ticket. Now in root folder i have created one folder with the name "test".

Now i want to create folder inside the folder test with the name of the current user.

For this i written the below code:

private static Folder createFolder(Folder target,String newFolderName){
Map<String, String> props =new HashMap<String, String>();
props.put(PropertyIds.OBJECT_TYPE_ID,"cmis:folder");
props.put(PropertyIds.NAME,"abc");
Folder newFolder = target.createFolder(props);
return newFolder;
}
 
 
and now calling this method in main after retriving the test as below:
Folder target =(Folder) session.getObject("workspace://SpacesStore/898583d0-5c38-4dad-a297-204f45960a4c");//retrieving test folder
Folder newFolder = createFolder(target,"abc");

but while running this code this is giving me org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: Forbidden error.

Please help me with this.

Regards,
Nancy

Completing review task with REST api

$
0
0

Hello, how can I set a review task as either approved or rejected through the REST api? I'm fairly sure it's done using the PUT method with state as completed, but I have no idea what variables to set. I wasn't able to find anything about it in the forums or docs. Thanks for any help.

4.2

change folder permission using API

$
0
0

Hi,

I am working on a use case where i have one client application which integrated with alfresco using CMIS. I am using external authentication by modifying header in request for authentication in alfresco. Till now i am able to create session with non-admin user using cmis api.

Now there is one folder in repository by the name testing and i want the non-admin user say "abc" should have the permission on that folder with the role contributor and this i want to achieve by rest api or some other api. I don't want the admin to do this rather non-admin user should do this

Please help me with this. I am not able to find any solution for my use case.

Thanks
Nancy

change user role on login

$
0
0

hi,

I have a query regarding user role in alfresco.

For example: Let there is one user "test". He logs into alfresco and he lands on his user dashboard. Now he wants to create a folder in global repository and for that he requires the role or permission. So, i want to ask is there any way by which i can change his role or give permission to that user on a folder without admin rights.

Thanks
Nancy


BUG: CMIS paging query getTotalNumItems() is wrong

$
0
0

Easily illustrated bug, the getTotalNumItems() returns ONLY the results returned up to the current page. I saw a link that said the issue was fixed in Enterprise...has anyone fixed (or know how to fix) Community 4.2.f? If so, could you please share the fix? I believe this is the same issue: https://issues.alfresco.com/jira/browse/MNT-2839 (marked fixed in Enterprise).

import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.data.*
import org.apache.chemistry.opencmis.commons.enums.*
import org.apache.chemistry.opencmis.client.api.*

String cql = "SELECT cmis:name FROM cmis:folder"

int maxItemsPerPage = 10;
OperationContext context = session.createOperationContext();
context.setIncludeAcls(false);
context.setIncludePolicies(false);
context.setMaxItemsPerPage(maxItemsPerPage);

int reqPageNum = 0;
ItemIterable results = session.query(cql, false, context).skipTo(reqPageNum * maxItemsPerPage).getPage(maxItemsPerPage);
long total = results.getTotalNumItems();
println("========== total: "+total); // will be WRONG and return 10

reqPageNum = 1;
results = session.query(cql, false, context).skipTo(reqPageNum * maxItemsPerPage).getPage(maxItemsPerPage);
total = results.getTotalNumItems();
println("========== total: "+total); // will be WRONG and return 20

4.2.f

What Url base for connect to CMIS Workbench?

$
0
0

I have a local instance of Alfresco, Community - 5.0.0 (d r99759-b2)

I'm trying CMIS Workbench, but I'm pretty busy with what the url that I put in the login form.

If I put this URL:
http: // localhost: 8080 / alfresco / cmisatom
Everything works fine, but I do not know if I'm with CMIS 1.0 or 1.1

If I put the URL:
http: // localhost: 8080 / alfresco / api / -Default- / public / CMIS / versions / 1.1 / atom (url that generate http://localhost:8080/alfresco/ index)

It seems that loads the repository, but when entering the workbench receive an alert with the message:
ERROR: Propery 'cm: title' does not exist !.

what is the problem?

The same happens to me with the url:
http: // localhost: 8080 / alfresco / api / -Default- / public / CMIS / versions / 1.0 / atom

5.0.d

Error while uploading file from lotus notes

$
0
0

Hi,

I am using alfresco v4.1 and lotus notes 9.0

I am trying to create plugin to upload files from lotus notes to alfresco.

While doing so it is giving me error (I have attached screen shot with this post).

PS: When I use same code from my stand alone jave application it works.

Is there some setting I am missing on notes/alfresco side?

Regards,
Archi

Upload Batch files

$
0
0

Hi, I have the following problem:

I have an external java module that performs the upload of documents to Alfresco via CMIS.
For now I upload two types of files - pdf and jpg.
When I upload only 200 PDF files it works correctly. When I upload 200 jpg files also it works correctly too. However when I try to insert 400 files - 200 jpg and pdf 200 the following occurs:
The first 200 files - of the same type - are inserted correctly (eg 200 jpg). But in the first pdf file (the file number 201) the error occurs:

Exception in thread "Thread-0" org.apache.chemistry.opencmis.commons.exceptions.CmisStorageException: Expected 69489 bytes but retrieved 0 bytes!
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:493)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:650)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:121)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:1043)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:77)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:451)
at com.most.cmis.client.CMISTestClient.uploadDocumento(CMISTestClient.java:307)
at com.most.parascript.export.DirectoryWatcher.SpecificRule(DirectoryWatcher.java:63)
at com.most.parascript.export.DirectoryWatcher.fileEvents(DirectoryWatcher.java:172)
at com.most.parascript.export.DirectoryWatcher.run(DirectoryWatcher.java:203)
at java.lang.Thread.run(Unknown Source)

I tried this but it doesn't work: https://forums.alfresco.com/forum/developer-discussions/alfresco-api/cmisstorageexception-checkin-06012014-1149

Comments:
All PDF files have the same size - 509 KB
All JPG files have the same size - 68 KB
When I do the same test with a smaller amount of files, eg 5 pdf's and 5 jpg's it works properly.

Below the section of code that uploads:

                folderEntrada =(Folder) session.getObjectByPath("/sites/most/documentLibrary/clasComChave");
File file =new File(caminhoArquivo);
InputStream fis =new FileInputStream(file);
VersioningState vs = VersioningState.MAJOR;
DataInputStream dis =new DataInputStream(fis);
byte[] bytes =newbyte[(int) file.length()];
 
dis.readFully(bytes);
 
ContentStream contentStream =new ContentStreamImpl(file.getAbsolutePath(), BigInteger.valueOf(bytes.length), tipoArquivo,new ByteArrayInputStream(bytes));
 
AlfrescoDocument novoDocumento =(AlfrescoDocument) folderEntrada.createDocument(properties, contentStream, vs);

Does anyone have any idea that can help me?

Windows 8
4.2.f Community

4.2.f

Frederico Americano Linhares

Aflresco 5.0.c : Unable to access the content/data for a node/document using Rest API

$
0
0

Hi,

I am trying to access the data of a node/document using following API:

http://<host>:<port>/alfresco/service/api/node/{store_type}/{store_id}/{id}

And, it is giving 404 error with following response:

404 Description:	Requested resource is not available.
 
Message:	08020013 Script url /api/node/workspace/SpacesStore/b4cff62a-664d-4d45-9302-98723eac1319 does not map to a Web Script.

However, this same API works properly for Alfresco Community 4.2.f and returns the data in XML format.

I have tried to hit other following Web Scripts APIs, which works fine.

http://<host>:<port>/alfresco/service/api/node/{store_type}/{store_id}/{id}/comments
http://<host>:<port>/alfresco/service/api/node/{store_type}/{store_id}/{id}/metadata

Could someone please help, regarding what and how to fix. Or, is there any API changes for Alfresco Community 5?
I have checked the alfresco wiki and forum, but couldn't find the required inputs.

Thanks.

5.0.c
Viewing all 252 articles
Browse latest View live