web service api

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2009 03:39 PM
I have two questions here:
1. How to use lucene to search a file by name to get a unique return file. I used "TEXT:"filename
but get an exception (AxisFault). It appears that it return nothing or ??
2. How to invoke UploadContentServlet in web service program? Do I have to run the program on web server side or I can run from remote client machine has the client web service installed?
Thanks.
1. How to use lucene to search a file by name to get a unique return file. I used "TEXT:"filename

2. How to invoke UploadContentServlet in web service program? Do I have to run the program on web server side or I can run from remote client machine has the client web service installed?
Thanks.
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2009 07:32 AM
How to use lucene to search a file by name to get a unique return file. I used "TEXT:"filenamebut get an exception (AxisFault). It appears that it return nothing or ??
Query query = new Query();query.setLanguage(Constants.QUERY_LANG_LUCENE); query.setStatement("@cm\\:name:\"yourdocument.doc\""); … repositoryService.query(store, query, false);
How to invoke UploadContentServlet in web service program? Do I have to run the program on web server side or I can run from remote client machine has the client web service installed?You want to upload a file?
Please review this post how it works: http://forums.alfresco.com/en/viewtopic.php?f=27&t=7346

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2009 12:24 PM
How to use lucene to search a file by name to get a unique return file. I used "TEXT:"filenamebut get an exception (AxisFault). It appears that it return nothing or ??
Thanks, yours is working. How to add path before the file name? Such asQuery query = new Query();query.setLanguage(Constants.QUERY_LANG_LUCENE); query.setStatement("@cm\\:name:\"yourdocument.doc\""); … repositoryService.query(store, query, false);
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:folder1/cm:folder2/……)How to invoke UploadContentServlet in web service program? Do I have to run the program on web server side or I can run from remote client machine has the client web service installed?You want to upload a file?
Please review this post how it works: http://forums.alfresco.com/en/viewtopic.php?f=27&t=7346
From the link code, how to control where (which folders) to upload the file?
Also, If I want to use the web service with upload servlet API, where to put the source file to be uploaded? Do I need to put the external source file inside web server(tomcat) directory? Then which directory? Or could I upload a file from remote client machine? and if so, which folder to put to make it uploaded programmatically by servlet URL connection call.
Thanks in advance.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2009 02:11 AM
Thanks, yours is working. How to add path before the file name? Such as
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:folder1/cm:folder2/……)
Try following:
parentNode.setChildName(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, normilizeNodeName( spaceName )));newNodeProperties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, spaceName )};CMLCreate cmlCreate= new CMLCreate("1", parentNode, null, null, null, Constants.TYPE_FOLDER, newNodeProperties );CML createSpaceCML= new CML();createSpaceCML.setCreate(new CMLCreate[]{cmlCreate});…WebServiceFactory.getRepositoryService().update(cml);…
Also, If I want to use the web service with upload servlet API, where to put the source file to be uploaded?
That doesnt matter at all. As long as your Client and Server can communicate which each other you dont have to think about such a manner. The only thing you have to do is to set up binary upon the the API.
For more informations please have a look to following site: http://wiki.alfresco.com/wiki/IngresTutorial_Alfresco_Web_Service_API_for_Java

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2009 11:28 AM
Thanks, it is very helpful document. By the way how to upload existing PDF file? Will the same read and write function work on PDF format?Thanks, yours is working. How to add path before the file name? Such as
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:folder1/cm:folder2/……)
Try following:What I meant is that I want to do a search a document, I want to use the full node path in the query statement. For example:parentNode.setChildName(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, normilizeNodeName( spaceName )));newNodeProperties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, spaceName )};CMLCreate cmlCreate= new CMLCreate("1", parentNode, null, null, null, Constants.TYPE_FOLDER, newNodeProperties );CML createSpaceCML= new CML();createSpaceCML.setCreate(new CMLCreate[]{cmlCreate});…WebServiceFactory.getRepositoryService().update(cml);…
the statement similar to:
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:space1/cm:space2/cm:GuardFile.txt\"");
But it does not work. how to make a correct query PATH for this example?Also, If I want to use the web service with upload servlet API, where to put the source file to be uploaded?
That doesnt matter at all. As long as your Client and Server can communicate which each other you dont have to think about such a manner. The only thing you have to do is to set up binary upon the the API.
For more informations please have a look to following site: http://wiki.alfresco.com/wiki/IngresTutorial_Alfresco_Web_Service_API_for_Java
