cancel
Showing results for 
Search instead for 
Did you mean: 

Searching a file in repository

itsard
Champ in-the-making
Champ in-the-making
Hi,
Can u help me with this…
I need to search a document in Alfresco repository.
I pass the file name and need to get the reference to it.
Below is the code am using.
Query query1 =new Query(Constants.QUERY_LANG_LUCENE,"PATH:\"/app:company_home/cm:sample_folder/cm:"+ISO9075.encode(lStringFileName)+"\"");

Whether I use the ISO9075.encode or not it gives random result.Sometimes it finds the doc and sometime doesnt. There is some prob with the documents having "_,digits,spaces" in their names.
Can u let me know the code for searching a document in the repository.
Alfresco version : 3.0 community edition

Thanks.
21 REPLIES 21

cheffilet
Champ in-the-making
Champ in-the-making
If i have understand you correctly, you want to change the WebService-Endpoint-Adress.

Currenlty ive no source-files here but please have alook to following method of the webservice-api:

WebServiceFactory.setEndpointAddress("")…

Tell us about your progress

shamabbas
Champ in-the-making
Champ in-the-making
Thanks a lotz for your reply. I really appreciate it.

And i resolved it already. I'm using now getUrl(); to get the whole URL to download files and getUuid(); to access the index of the uploaded file.

getUrl(); provides you complete url so just by click, you can download file.
Thats what i wanted.

And yes I'm also using what you suggested

WebServiceFactory.setEndpointAddress("http://" + server_host + ":" + server_port + "/alfresco/api");

In my case I have defined these properties sepratly already!
server_host:localhost
server.port:8080
server.user:admin
server.password:admin

Thanks once again. Smiley Very Happy