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

What are Solr afts-alfresco-select

$
0
0

Hi All,

I've stumble into following API, afts-alfresco-select

http://localhost/solr/alfresco/afts?wt=json&fl=*&indent=on&q=@ABC\:creator:Andy
http://localhost/solr/alfresco/alfresco?q=+@NCMS\:CMSUUID:0039bf65-9271-43a9-ac0d-fad4be2e2414&indent=on&rows=1&fl=@{ABC.model}creator.u
http://localhost/solr/alfresco/select/?q=*%3A*&start=0&rows=10&indent=on&fl=*

What does the difference between this 3?
afts stands for Alfresco Full Text Search, does that mean the other 2 doesn't do full text search?

Primarily I used afts, I have my own data model, trying to figure out what is the meaning of the fields name returned with additional postfix
e.g.: @{ABC.model}creator.__.u, @{ABC.model}creator.u, @{ABC.model}creator.__, @{ABC.model}creator

I could not find clear reference for questions above, one of my findings (https://wiki.alfresco.com/wiki/Alfresco_And_SOLR)

I am using Alfresco Version :Community - v4.2.0 (4428)

Thanks

4.2


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

Fetch the list of nodes whose permission is updated/modified

$
0
0

Hi,

I am working on java based application for crawling content from Alfresco (both 4.x and 5.x). I am able to figure out the nodes whose metadata is updated after some specified time, using SELECT query on following CMIS 1.1 query,
/alfresco/api/-default-/public/cmis/versions/1.1/atom/query?q={query}

But, the above API provides only the nodes having metadata modified.

To get the nodes, whose ACLs or permissions are modified, I am trying to use Audit services with CMISChangeLog application. But, this is returning 0 (zero) entries even if 'verbose' is set to true.

Is there any other api, that can help me here.

Thanks,
Manoj

4.2.f

Change permissions on a node with REST API

$
0
0

Hi!
I would like to be able to modify the permissions of a node using the REST API ? Does anyone know if it's possible or not ?
And if yes, what is the url api to use ?

Thanks in advance,

Michael

4.2.f

About searching documents

$
0
0

Hi, I'm new to this product and I am developing an interface to return to user a number of documents. So basically I will writ a web interface to let user input a start date and an end date, then I search in our document system which is based on Alfresco (version 3.3) and return the documents within the specified period.
I meet a few issues,though:
1. The Alfresco API, as far as I know, returns the total number of documents and the first 1000 documents (or all documents if less than 1000). This takes a lot of time, and the time is proportional (not linear, though) to the total number of documents. Say, if the search specifies a period of 1 day and there are 900 documents, the API takes about 5 seconds to return all 900 documents and the number 900; If the search specifies 10 days and there are 8000 documents, it takes 30 seconds to return the first 1000 documents and the number 8000. Is there another API that can quickly return the total number of documents, without the documents themselves? Like so I can quickly respond to user and decide what to do next (for example to ask user to reduce the number of days to search)?
2. Now that the API only returns the first 1000 documents, if there are > 1000 documents, I have to call the API several times to get all the remaining documents by using some tricks (for example taking the time of the 1000th document and use that as the new start time to search again, but if there are a lot of documents user needs to wait a long time if I loop many times), is there another API that can return all docments, or offers 'paging' mechanism that I can just call in sequence to get all documents? However this is less critical as I can overcome it, slow though, the more critical issue is to quickly get the total number of documents.

Thanks!

3.3

Updating node lastModificationDate via CMIS

$
0
0

Hi,

I have a use case where I need to update a node's last modification date based on changes to a node's associations. I realize that the mod date is intended to be updated only on content changes not metadata. Is there a facility to accomplish this? I noted a previous post that suggested dropping the "audit policy" for the transaction, but it's not clear how one can do this via CMIS.

Any suggestions would be appreciated.

Carlos S. Zamudio

I'm using Alfresco 4.3. on Windows

Carlos S. Zamudio

download document using CMIS

$
0
0

Hi,

I have integrated my client application with alfresco using CMIS and also exposing document library using CMIS only. Now when i click on a document it starts downloading on my local system but it didn't shows the name of the document. The document is not saved with the actual document name rather with some arbitrary name.

How to download the document with the document name?

Regards,
Nancy


how to get edit task list page

$
0
0

Hi,

I have integrated alfresco with custom application and exposed specific user task list using web service. now i want if user in custom application clicks on particular task then edit task page of alfresco gets displayed. Or there is any other method by which user can complete his task remotely without login into alfresco?

Regards,
Nancy

No search index when uploaded via CMIS and containing description text

$
0
0

After an upgrade from Alfresco 5.0.a CommunityEdition to 5.0.d some documents never get indexed by Solr4. These documents are based on a custom model ("cierp") and uploaded via CMIS 1.1. But only the documents containing a description text ("cm:description") don't get indexed. No error in the log files. Model-based documents without description text do get indexed, so no problems there. So we are able to upload documents without description text by CMIS to get them indexed. Afterwards we can add the text manually in Share and they are reindexed correctly.

In previous Alfresco versions with Solr1 there were no such problems.

Our custom cierp-model is a subtype of cm:content, from share-config-custom.xml:

<types><type name="cm:content"><subtype name="cierp:doc"/><subtype name="cierp:erp"/></type><type name="cierp:doc"><subtype name="cierp:erp"/></type> <type name="cm:folder"></type> <type name="trx:transferTarget"><subtype name="trx:fileTransferTarget"/></type></types>

This is a part of the CMIS properties (omitted date and unimportant parts):

 cierp:vorgangsnr=Invoice_1111,
 cierp:scanned=false,
 cierp:kundliefnr=12345,
 cierp:kundliefname=Lieferant GmbH,
 cierp:sprache=de,
 cm:categories=[workspace://SpacesStore/SpacesStore/962ae9c7-9c15-45a5-8aee-c007b9c88fc0],
 cmis:objectTypeId=D:cierp:erp,
 cmis:name=EX15850027.pdf,
 cmis:createdBy=gerold,
 cm:description=OUR DESCRIPTION TEXT,
 cmis:secondaryObjectTypeIds=[P:cierp:vorgangsDaten, P:cierp:nummerDaten, P:cierp:reldocnamesHidden, P:cierp:serviceDaten, P:cm:generalclassifiable, P:cm:titled]

And this is the custom model:

<?xml version="1.0" encoding="UTF-8"?><model name="cierp:ciErpModel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <description>Coolitalia-Model</description><author>Elsbeth Hartmann</author><version>1.0</version> <imports><import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/><import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/></imports> <namespaces><namespace uri="http://www.coolitalia.de/model/content/1.0" prefix="cierp"/></namespaces> <types><type name="cierp:doc"><title>Coolitalia-Dokument</title><parent>cm:content</parent></type> <type name="cierp:erp"><title>Coolitalia-ERP-Dokument</title><parent>cierp:doc</parent><properties><property name="cierp:kundliefname"><type>d:text</type></property><property name="cierp:sprache"><type>d:text</type></property><property name="cierp:vorgangsdatum"><type>d:date</type></property></properties><associations><association name="cierp:relatedDocuments"><title>Related Documents</title><source><mandatory>false</mandatory><many>true</many></source><target><class>cierp:erp</class><many>true</many></target></association></associations></type></types> <aspects><aspect name="cierp:vorgangsDaten"><title>Coolitalia-ERP-Vorgangsdaten</title><properties><property name="cierp:vorgangsnr"><type>d:text</type></property><property name="cierp:scanned"><type>d:boolean</type><default>false</default></property></properties></aspect><aspect name="cierp:nummerDaten"><title>Coolitalia-Nummerdaten</title><properties><property name="cierp:kundliefnr"><type>d:text</type></property></properties></aspect><aspect name="cierp:zahlungsDaten"><title>Coolitalia-Zahlungsdaten</title><properties><property name="cierp:banknr"><type>d:int</type></property><property name="cierp:auszugnr"><type>d:text</type></property><property name="cierp:freigabe"><type>d:text</type></property><property name="cierp:eingangsdatum"><type>d:date</type></property></properties></aspect><aspect name="cierp:kontaktDaten"><title>Coolitalia-Kontaktdaten</title><properties><property name="cierp:plz"><type>d:text</type></property><property name="cierp:ort"><type>d:text</type></property><property name="cierp:ansprpartner"><type>d:text</type></property></properties></aspect><aspect name="cierp:produktDaten"><title>Coolitalia-Produktdaten</title><properties><property name="cierp:seriennr"><type>d:text</type><multiple>true</multiple></property></properties></aspect><aspect name="cierp:versandDaten"><title>Coolitalia-Versanddaten</title><properties><property name="cierp:packer"><type>d:text</type><multiple>true</multiple></property><property name="cierp:packdatum"><type>d:date</type></property></properties></aspect><aspect name="cierp:serviceDaten"><title>Coolitalia-Servicedaten</title><properties><property name="cierp:servicenr"><type>d:text</type></property></properties></aspect><aspect name="cierp:reldocnamesHidden"><title>Coolitalia-UnsichtbareRelatedDocNamen</title><properties><property name="cierp:hiddenReldocnames"><type>d:text</type></property></properties></aspect></aspects></model>

Please, can somebody help to fix this problem? Many thanks in advance.

Elsb.

5.0.d

Update aspect cm:taggable

$
0
0

Hi, i'm new with Alfresco.
I'm developing a c# software to write some documents into an Alfresco repository.

I'm using dotCMIS library to create documents.

I'm able to set some aspect properties like cm:title, cm:description, cm:author with a code like this:

private static ExtensionsData CreateData(string description)
{
ExtensionsData data = new ExtensionsData();
data.Extensions = new List();
CmisExtensionElement element = new CmisExtensionElement
{
Name = "alf:setAspects",
Namespace = "http://www.alfresco.org",
Children = new List
{
new CmisExtensionElement
{
Name = "alf:properties",
Namespace = "http://www.alfresco.org",
Children = new List
{
new CmisExtensionElement
{
Name = "cmis:propertyString",
Namespace = "http://docs.oasis-open.org/ns/cmis/core/200908/",
Attributes = new Dictionary
{
{"propertyDefinitionId","cm:description"},
{"displayName","Description"},
{"queryName","cm:description"}
},
Children = new List
{
new CmisExtensionElement
{
Name = "cmis:value",
Namespace = "http://docs.oasis-open.org/ns/cmis/core/200908/",
Value = description
}
}
}
}
}
}
};
data.Extensions.Add(element);

return data;
}

But I don't reach to write into the document some TAGS...
I'm able to set the propetrie c:taggable, but not to set his value (tags are atring array).

IS IT POSSIBLE TO CREATE A DOCUMENT IN ALFRESCO WITH SOME TAGS?

Thank you

Regards.

4.2.f

How to get CMIS ObjectId using Alfresco Java API

$
0
0

Hello,

We are using Alfresco 5.0.d and Activiti workflows. Our application uses CMIS mostly. For workflow task list we use REST API.

When creating a workflow via Java API we need to set the CMIS ObjectId of the object associated with the workflow - is that possible?

I could not find a correct way to do these actions for Alfresco 5.0.d:
a) Java API: Convert NodeRef to CMIS ObjectId
b) Java API: Convert CMIS ObjectId to NodeRef
c) CMIS API (also Java): Convert NodeRef to CMIS ObjectId

Charlie

Claim pooled task with Alfresco Rest API - (4.1.10)

$
0
0

Hi,

I am using Alfresco 4.1.10 Enterprise.

I am trying to claim a pooled task but am unable to find the correct rest api to perform the claim with.

So far I have found these options:
PUT to
api/task-instances/{taskId}
{
owner={username}
}

But I am unsure if this is correct, I cannot find any documentation explaining whether the owner can be updated.
I am using the ticket for the user that wants to claim the task, but could use the administrator to perform the action if needed.

Another option I have seen is api/enterprise/tasks/{taskId}/action/claim
which seems to be an activity api, which I am unsure as how the url should be referenced, as http://server:port/alfresco/service/api... does not work.

Can anybody please advise with any information on how I would be able to claim a task.
It would be very useful if it used the Alfresco JSON api, buy anything that would be compatible with my server would be appreciated.

Thank you.

Creating content upon creation of document

$
0
0

Hi everyone.

I am currently creating a situation where I have a custom model/document that needs to be pre filled with data from a form. I managed to use get the model in the list under "Create" in share. If I click that I will get a form with my own fields on there (I made custom properties), but I still derive from the cm:content model. Essentially, what I'm trying to achieve is have the input that the user provided in this form into the contents of the document, using some placeholders.

I have also created the java class for this, using the implantation of "NodeServicePolicies.OnCreateNodePolicy" and bound it to the right behaviour. It triggers and I can execute my own code, but am stuck at getting content in there. I have also implemented "ContentServicePolicies.OnContentUpdatePolicy" but this is not triggered on creation (makes sense now).

The next thing I tried to do is using CMIS to complete the contents. However, even though I am able to extract the workspace Id for my new document, I noticed that it is not yet accessible by CMIS? The repository always fails, while others do seem to work.

There must be something small that I seem to be missing. Can someone guide me in the right direction? I also have a strange feeling that i am doing something needlessly complex.
For your information: using CMIS and Python i seem to be able to change and/or manipulate everything that i want.

5.0.d

Ludo - Neobis

Dutch Alfresco enthousiasts

REST API: List files in site

$
0
0

Hello group,
Really new to Alfresco!
I have spent a few days so far and I love the REST API, but I can't figure out if there is an out-of-the-box REST API to list all files in a site. I'm using the Community v5 on localhost.
I've been going through the available scripts using "http://localhost:8080/alfresco/service/index/uri/" but can't find anything that would return list of all files and folders in a site.
Thanks,
---bjorn

5.0.d

---bjorn


CMIS - CONTAINS does not return all documents

$
0
0

Hi all,

I'm trying to make case-insensitive queries with and I've found that the CONTAINS method to do so is not working correctly. I've got several documents:

And the queries are working in some cases but in some others they're not:

SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*Asdf*\'') -- 2 results (OK)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*asdf*\'') -- 2 results (OK)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*Hola*\'') -- 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*hola*\'') -- 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*Sentencia*\'') -- 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmis:objectId=T.cmis:objectId WHERE CONTAINS(T,'cm:description:\'*sentencia*\'') -- 0 results (KO)

Is there anything I'm missing??

Thank you!!

4.2

Alf4.2 /api/./cmis atompub HTTPS reverse proxy

$
0
0

Hi all,
I'm trying to use the chemistry opencmis library via atompub when the server is setup for SSL, but when using the library the app:collection keeps redirecting the URL to a non-secure version.

atompub xml snippet:
<app:collection href="http://..:80...

Desired outcome is to use the https:// version expected.

I've tried the spring-webscripts-custom-config.xml approach, but that was apparently for the old CMIS server impl. Using the following API access layer for cmis:

https://<server>/alfresco/api/-default-/cmis/versions/1.0/atom

thanks for any assistance,
-D

4.2.f

Search comparing two datetime properties

$
0
0

Hi, does anybody know how to search for objects with 2 datetime properties where one datetime property needs to be before the other?

I have a custom model with an object that has 2 custom datetime properties, myModel:myFirstTimestamp and myModel:mySecondTimestamp and I'd like to find all objects where myModel:myFirstTimestamp < myModel:mySecondTimestamp if that makes sense.

I have tried this in solr4 and cmid but can't get it to work. I did find how to search for date ranges where the date was static, but not where the second argument was a property of the object.

Thanks!

5.0.d

Alfresco connector error

$
0
0

I'm trying to do a connector to get a file. I receive the path of the file by args like :
 var filePath = args["file"]

If I print this, I get the path correctly. But in the connector I have:

var connector = remote.connect("alfresco");
result = connector.get(args["file"])

and if I made this, this not recognise the path, the status is Error 500. I print the path and I paste like:

result = connector.get("/slingshot/node/content/workspace/SpacesStore/f32afa20-4c73-4e6c-84e4-1c12d5964a95/txt.txt")

... But obvious, I want by args because I want for all the files.

What is my error? This is so strange for me.

Does "cmis:write" contain "cmis:read"?

$
0
0

Hello,

I am writing a java client that uses Chemistry to talk to an Alfresco 5 Community server.

The client needs to get all principals that have the right to read a given cmis object. To get the ACL I use the following method call:

Acl acl = session.getAcl(cmisObject, true);

So I only get basic CMIS Permissions and the alfresco specific permissions get mapped to them, what makes things quite easy.

But I am wondering if the "cmis:write" permission contains the "cmis:read" permission in a alfreso repository.

The book "CMIS and Apache Chemistry in action" says on page 348:
In almost all repositories, the cmis:write permission contains the cmis:read permission.

What is it like in an alfresco repository?

Thanks,
Pascal

Viewing all 252 articles
Browse latest View live