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

Share 'Can not delete 'file'" but Explorer can

$
0
0

I can't reproduce this locally (4.2.f), but seeing it on all 3 linux instances. Files can not be deleted via share consistently (REST call returns 403), but always works with Explorer. I am admin in both cases. I have turned on debug and am getting TONS of logging but nothing that seems like an error. just the "Can not delete 'xxx'" popup.

I see this in the log...but I don't think it's an error, is it? "[org.alfresco.repo.service.StoreRedirectorProxyFactory] Redirecting method public abstract java.util.List org.alfresco.service.cmr.repository.NodeService.getChildAssocs(org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.namespace.QNamePattern,org.alfresco.service.namespace.QNamePattern) throws org.alfresco.service.cmr.repository.InvalidNodeRefException based on store type workspace://SpacesStore"

Any other ideas? I can't figure out exactly where that javascript popup comes from Sexactly...is there anything specific I can turn on in the log file besides "repo.web.scripts" and "ScriptLogger"?

Would appreciate any help!

4.2.f

ACL through CMIS query

$
0
0

Hello, I need to index ACL and I wish to know if it is possible to retreive ACL through CMIS query?

4.2.d

Access AMP details

$
0
0

Hi,
Does anybody know if it's possible to access the details of installed AMP files using the available APIs?
For example, I'd like to check if my AMP is installed and if it is which version is running and then that info in a webscript.

Thanks

5.0.d
AMP

Scheduled actions in multi-tenant environment

$
0
0

Hi,

I've got an bespoke AMP that includes a number of (scheduled) actions.
This all works fine, without any issues.

Now we're deploying this in a multi-tenant setup and I'm trying to get my head around how this would work.

The scheduled action beans use the CronScheduledQueryBasedTemplateActionDefinition class with property "runAsUser" set to System.
It also includes a lucene query using the "workspace://SpacesStore" store.

Now, in a multi-tenant environment, how will these queries work? e.g. will it run these for all tenants individually or once as "System" user and I need to loop over the individual tenants manually?

Ideally I get it to run the action for each tenant individually and run the query for each tenant's spaces store.

Does anyone have any pointers?

5.0.d

Lucene search problem

$
0
0

i making a query in node-browser of alfresco 4.2.f version, my search is for a specific property of my custom model, the result of this query is not satisfactory, the query brings me all nodes of repository with my specific type "TYPE:"myprefix:document", the nodes don't have a custom property "myprefix:myproperty" and similarly get the node in query result.

this is my query:

TYPE:"myprefix:document" AND @myprefix\:myproperty:"IT"

and this is other one

TYPE:"myprefix:document" AND @myprefix\:myproperty:"OR"

Any idea?

4.2.c

Alfresco Performance Issue

$
0
0

We are using alfresco community 4.0 version server. I m geting performance issue on our Alfresco server.

Initially we are uploading 1000 files within 1 hour but now only 100 files are able to upload the alfresco server through our java batches.

we are using alfresco web service's for uploading and downloading the files.

we are using following environment:

1 Alfresco 3.4 community version

2 DB postgres 9.2

3 Alfresco app server Details

OS App server RAM CPU
Linux 6.6 64bit Tomcat 6 12 GB 4

JVM setting -server -Xss1M -Xms3G -Xmx6G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:NewSize=2G -XX:MaxPermSize=1G -XX:CMSInitiatingOccupancyFraction=80

4 Postgres Server Details:

OS RAM CPU
Linux 6.6 64bit 8 GB 4

Data details on the alfresco app server.

folder size

/CMS_data/contentstore 1.5 Tera bytes

/CMS_Index/lucene-indexes 39 GB

Details of alfresco.global.properties

#
dir.root=/CMS_Data

# The location for lucene index files
dir.indexes=/CMSIndex/lucene-indexes

# The location for index backups
dir.indexes.backup=/CMSIndex/backup-lucene-indexes
#

# database connection properties
#
#db.username=alfresco
#db.password=alfresco
### database connection properties ###
db.name=postgres
db.username=usrname
db.password=pasword
db.host=192.xxx.xxx.xxx
db.port=xxx
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://${db.host}:${db.port}/${db.name}

alfresco.cluster.name=CMSCluster

4.0

Multiple Where Clause Predicates on Attributes w/ Multiple Values

$
0
0

Hi Everyone,

I have a query I am trying to execute via CMIS, which queries on a attribute with multiple values.

My query is like this so far (note we alias aspects as their name to ease the generation of queries in code)

SELECT * 
 
 FROM namespace:type AS primary JOIN namespace:aspectA AS P:namespace:aspectA ON primary.cmis:objectId=P:namespace:aspectA.cmis:objectId 
 
WHERE 
 
'myValue'= ANY P:namespace:aspectA.namespace:RepeatingAttribute

Which is working great.

But when I try to add ANDs and ORs everything breaks down.

I know one code has 2 of my values but this does not work and returns no results and no errors. Just 0 results

SELECT * 
 
 FROM namespace:type AS primary JOIN namespace:aspectA AS P:namespace:aspectA ON primary.cmis:objectId=P:namespace:aspectA.cmis:objectId 
 
WHERE 
 
'myValue'= ANY P:namespace:aspectA.namespace:RepeatingAttribute
 
AND
 
 
'myValue2'= ANY P:namespace:aspectA.namespace:RepeatingAttribute

When I run that same query but with an OR as the logic between my predicates, I get 15 results. However, if I query on myValue I get 1, and myValue2 returns 19. I have no idea what the intersection/distinctness could be doing to create that set of 15.

Is this just not supported? What is the logic here? And can I work around this at all?

FYI I am issuing these with CMIS WorkBench, and our code is using Apache Chemistry as well.

5.0.c

Prevent cmis:document setContentStream via document attribute?

$
0
0

Hello,

is it possible to disallow calling setContentStream on a document, by setting a document attribute?

Setting VersioningState.NONE does not prevent the content of beeing replaced by setContentStream. Also it should be possible to have e.g. VersioningState.MAJOR, but only allow to "upload" a new verison of a document by creating a new version, rather than overwriting the existing content by setContentStream.

Setting cmis:isImmutable to the document did not work either. What I want to achieve is bascially an "immutable latest version" of the document.

Thanks for any help.


CMIS resources, tutorials, and examples

$
0
0

If you are new to CMIS, there are several resources you need to be aware of:

Also, please note that when you are using the CMIS ATOM Pub binding against Alfresco 4, you should use the new OpenCMIS-based URL (http://localhost:8080/alfresco/cmisatom) instead of the old web script-based URL (http://localhost:8080/alfresco/s/api/cmis). The old URL should be considered deprecated. This is not just a URL change--these are two different implementations, so you will see differences in how they behave.

If you are using Alfresco 4.2.x the URL has changed again. You should use one of these URLs:
* http://localhost:8080/alfresco/api/-default-/cmis/versions/1.0/atom
* http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom
* http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/browser

Jeff

Hire my team for your next project! Metaversant
Blog: ecmarchitect.com | Twitter: jeffpotts01
CMIS APIs: Apache Chemistry | CMIS and Apache Chemistry in Action
Alfresco tutorials: Alfresco Developer Series

Public Alfresco API is Now Live

$
0
0

This morning, Alfresco announced the general availability of the public Alfresco API. The public Alfresco API allows developers to create custom applications (desktop, mobile, or cloud) that persist content to Alfresco in the Cloud. The API includes CMIS plus some Alfresco REST calls that provide functionality CMIS does not cover.

To use the Alfresco API, all you have to do is become a registered developer at http://developer.alfresco.com. Once you've verified your email address, you can add applications to your profile. Each application has a unique authentication key and a secret. OAuth2 is used to handle authentication.

Once you have your authentication key and secret, you can start making calls against the API. Calls that hit the Alfresco REST part of the API return JSON. Calls that leverage CMIS return AtomPub XML. If you already know how to make CMIS calls, you already know how to use the Alfresco API--just grab the latest version of your favorite CMIS client, like OpenCMIS or cmislib, and pass in the authorization header.

Here are some resources to help you get started:
Alfresco Developer Portal
Alfresco API Documentation
Introduction Presentation from JavaOne
Alfresco API Screencasts showing how to register for an application key and how to execute simple command-line Java applications that leverage the API
Sample Java code showing simple command-line examples with Google's OAuth2 client and the Alfresco API.
Python examples showing the same command-line examples as the Java examples above.

If you want to discuss the public Alfresco API, use this forum.

Jeff

Hire my team for your next project! Metaversant
Blog: ecmarchitect.com | Twitter: jeffpotts01
CMIS APIs: Apache Chemistry | CMIS and Apache Chemistry in Action
Alfresco tutorials: Alfresco Developer Series

Getting users and documents via API

$
0
0

Hi,
is it possible to get user(s) (preferrably getting all users or getting a user by its login, etc.) and documents (again, preferrably filtered) via the REST API?
I searched for something like that but found nothing.
Can I use the RESTful API or what do I have to do so that an external system can access these objects? Do I have to create a plug-in?
Thanks :-)

5.0.d

List of version content

$
0
0

Hi All

I need to fetch all the content which have some version(>1.0) associated to them.By default cm:versionable aspect is applied so cannot use that.

Do we have some API for that or we need to execute some DB query.

Regards,

Rahul Mackdani

Rahul Mackdani

cmis Url for Alfresco 5.0.d

$
0
0

Hi,
i have integrated Alfresco 5.0.d with CMIS plug in . can anyone tell me the correct url for 5.0.d
currently am using "http://localhost:8080/alfresco/s/cmis" this link, but this one is not working for me.

5.0.d

Ananthu Krishna S

Last modified date of content stream

$
0
0

Hi,

I have seen that, in the document, there's only one date to know when was the document updated. But I can't find a date to know when was the content stream updated.
That is, I want to know when was the binary updated rather than attributes.

Do you know wich attribute indicates the last modified date of the content stream?

Thanks.

4.2
<cmis>

CMIS, Alfresc 4.2.1, can not update DESCRIPTION and TITLE properties

$
0
0

Dear Alfresco experts,

I am working on a Alfresco repository with existing folders and files - so the task is to update the folder and files with new TITLE and DESCRIPTION properties using Java program.

I am using Alfresco 4.2.1 and tried the normal CMIS way to set TITLE and DESCRIPTION but resulted in null value. So I am using the Alfresco CMIS extension and the following
... getting session, obtaining folder by path etc ....

Map penProp = new HashMap();
penProp.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder, P:cm:titled");
penProp.put(PropertyIds.NAME, subFolder.getName() + "_");
penProp.put("cm:title", strTitle);
penProp.put("cm:description", strDesc);

subFolder.updateProperties(penProp);

And I got the following error:
CFR Folder Meta Data exception: java.lang.IllegalArgumentException: Property 'cm:description' is neither an object type property nor an aspect property!

I read Jeff Potts' posts that this may be a result of the PropertyIds.OBJECT_TYPE_ID can not be changed, so once a folder or file is uploaded, the Content Type can not be changed ? But from the Alfresco share interface we can change Object Content Types - correct ?

Any help will be appreciated.

Thanks.

Sam

<cmis>

CMIS Authentication Failing

$
0
0

We recently upgraded from Alfresco 5.0.c to 5.0.d and it broke our CMIS API calls because we cannot get authenticated. Below is the exception we are receiving. Does anyone have any ideas?

org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException: Unauthorized
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:468)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:634)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:797)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:69)
at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:74)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.connect(SessionImpl.java:1003)
at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:106)
at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:68)

Search latency when saving a doc

$
0
0

I notices a a significant latency after creating a document on the share before that document can be found in a IN_TREE search. The doc can be found straight away if you define the type and search param without the IN_TREE clause. so for example I have a doc of type cmpdl:companyCustomer, and I create it in the repo.
Then I run a search like:

SELECT cmis:objectId from cmpdl:companyCustomer where IN_TREE(?)
and this type of search usualy takes 2-10 seconds to return the new document to the list.
where as if i specify the search like
SELECT cmis:objectId from cmpdl:companyCustomer where cmpdl:firstName = ?
it returns the result straight away.

The interesting thing is that sometimes the first search returns the result straight away sometimes it might take up to 10 seconds to succeed. Is there any configuration or workaround that can be applied in this case?

How do I create sub-folders?

$
0
0

I'm working on an InboundSMTP override and am hung up with what seems like it should be a simple part... How to create a sub-folder given a particular nodeRef. Here's what I've got so far:

        ApplicationContext appContext =new ClassPathXmlApplicationContext("alfresco/application-context.xml");//        ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("classpath:alfresco/extension/subsystems/email/InboundSMTP/inbound/InboundSMTP-context.xml");
        ServiceRegistry serviceRegistry =(ServiceRegistry) appContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
        FileFolderService fileFolderService=serviceRegistry.getFileFolderService();
        FileInfo object = fileFolderService.create(nodeRef, messageSubject, ContentModel.TYPE_FOLDER);

I've narrowed it down to trying to get the application context. That single line (either of the ways listed above) results in the following very confusing (what patches?) error in the log when an e-mail is received:

ERROR [org.springframework.extensions.surf.util.AbstractLifecycleBean][org.subethamail.smtp.server.Session-/2001:470:c27d:18:0:0:0:17:62204] 06300186 Email message processing failed
org.alfresco.error.AlfrescoRuntimeException: 06300186 Email message processing failed
	at org.alfresco.email.server.EmailServiceImpl.processMessage(EmailServiceImpl.java:324)
	at org.alfresco.email.server.EmailServiceImpl.importMessage(EmailServiceImpl.java:180)
	at org.alfresco.email.server.impl.subetha.SubethaEmailServer$Handler.processDelivery(SubethaEmailServer.java:223)
	at org.alfresco.email.server.impl.subetha.SubethaEmailServer$Handler.data(SubethaEmailServer.java:184)
	at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:61)
	at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:27)
	at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:98)
	at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:222)
	at org.subethamail.smtp.server.Session.run(Session.java:125)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 06300185 Not all patches could be applied
	at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:111)
	at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:124)
	at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:120)
	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
	at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:128)
	at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at com.sscorp.CustomFolderEmailMessageHandler.addAlfrescoContent(CustomFolderEmailMessageHandler.java:132)
	at com.sscorp.CustomFolderEmailMessageHandler.processMessage(CustomFolderEmailMessageHandler.java:94)
	at org.alfresco.email.server.EmailServiceImpl$3.execute(EmailServiceImpl.java:296)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:342)
	at org.alfresco.email.server.EmailServiceImpl$4.doWork(EmailServiceImpl.java:304)
	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
	at org.alfresco.email.server.EmailServiceImpl.processMessage(EmailServiceImpl.java:307)
	... 8 more

What am I missing? Is there an easier way to go about doing this?

5.0.a

How to change Alfresco Public API from Development Plan to Production Plan?

$
0
0

I log in my Alfresco Developer Portal, and change the Alfresco Public API from Development plan to Production Plan in API Management of APPLICATIONS menu, but the API status always displays "Pending change request to Production Plan". So I want to know what should I do to get the approval of changing request?

other

cmis query for NOT in aspect

$
0
0

I'm familiar with joining in cmis queries to retrieve nodes of a certain aspect, but I need to query for all nodes that are NOT in a list of aspects. I googled and found this suggestion:

SELECT * FROM cmis:document where contains('NOT ASPECT:\'myNs:myAspect\'')

which returns SOME data, but doesn't seem to be returning the correct subset. Should this work with CMIS 1.1? Is there a better way?

I realize I could use Java, but I'd like to take advantage of the query's paging ability!

4.2.f
Viewing all 252 articles
Browse latest View live