07-31-2009 03:39 PM
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:"filename but 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?
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:"filename but get an exception (AxisFault). It appears that it return nothing or ??Thanks, yours is working. How to add path before the file name? Such as
Query 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
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/……)
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?
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
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.