cancel
Showing results for 
Search instead for 
Did you mean: 

Web application suggestion

inspiron82
Champ in-the-making
Champ in-the-making
Hi,
I hope that this is the right section of the forum, in case feel free to move my post in the right one.

I have to make a web application that just have two jsp. They must be like original login.jsp and browse.jsp. I don't need need any other Alfresco's features.
I just need to login, see documents that my user can see and download them, logout, and audit login and and download(if possible).

Which is the best way?

I hope you can help me.

Thanks.
16 REPLIES 16

inspiron82
Champ in-the-making
Champ in-the-making
Ok,
I got the problem.
I have to implement a web application that let me make the login(and it's not a problem) and let me show to the final user (in a jsp) all the files in a specified alfresco's folder AND IN ALL OF ITS SUBFOLDER.
For example, if i have a folders' structure like this:

Folder1
       |
       |——–Folder2
       |              |
       |              |—–Folder3
       |               
       |——–Folder4
       |                |
       |                |—–Folder5
       |                              |
       |                              |———Folder6
       |
       |——–Folder7

if I click on the link corresponding to the Folder1, I have to make a query to alfresco and list all the file contained in Folder1, Folder2, Folder3, Folder4, Folder5, Folder6, Folder7.

I think that I have to use Web Services and WebScript.
Can u please tell me which methods I have to use and which the right logic to make the trick?

Thanks a lot.

hyperation
Champ on-the-rise
Champ on-the-rise
Ok,
I got the problem.
I have to implement a web application that let me make the login(and it's not a problem) and let me show to the final user (in a jsp) all the files in a specified alfresco's folder AND IN ALL OF ITS SUBFOLDER.
For example, if i have a folders' structure like this:

Folder1
       |
       |——–Folder2
       |              |
       |              |—–Folder3
       |               
       |——–Folder4
       |                |
       |                |—–Folder5
       |                              |
       |                              |———Folder6
       |
       |——–Folder7

if I click on the link corresponding to the Folder1, I have to make a query to alfresco and list all the file contained in Folder1, Folder2, Folder3, Folder4, Folder5, Folder6, Folder7.

I think that I have to use Web Services and WebScript.
Can u please tell me which methods I have to use and which the right logic to make the trick?

Thanks a lot.


Hi,

For getting the files contained in the folder, you'll probably need to create your own webscript that "searches" for the files contained.  What you need to do is get the NodeRef ID of the folders and pass it in to the webscript (the one you'll make) and in that webscript you write use something like search.luceneSearch.  You can then pass the results via freemarker back to your customed UI side.

Question:
Can you tell me how does your Login work?  Were you able to call Alfresco webscripts after logging in (without having to log in again, meaning the ticket remains)?

Thanks
Smiley Happy

inspiron82
Champ in-the-making
Champ in-the-making
Ok,
I got the problem.
I have to implement a web application that let me make the login(and it's not a problem) and let me show to the final user (in a jsp) all the files in a specified alfresco's folder AND IN ALL OF ITS SUBFOLDER.
For example, if i have a folders' structure like this:

Folder1
       |
       |——–Folder2
       |              |
       |              |—–Folder3
       |               
       |——–Folder4
       |                |
       |                |—–Folder5
       |                              |
       |                              |———Folder6
       |
       |——–Folder7

if I click on the link corresponding to the Folder1, I have to make a query to alfresco and list all the file contained in Folder1, Folder2, Folder3, Folder4, Folder5, Folder6, Folder7.

I think that I have to use Web Services and WebScript.
Can u please tell me which methods I have to use and which the right logic to make the trick?

Thanks a lot.


Hi,

For getting the files contained in the folder, you'll probably need to create your own webscript that "searches" for the files contained.  What you need to do is get the NodeRef ID of the folders and pass it in to the webscript (the one you'll make) and in that webscript you write use something like search.luceneSearch.  You can then pass the results via freemarker back to your customed UI side.

Question:
Can you tell me how does your Login work?  Were you able to call Alfresco webscripts after logging in (without having to log in again, meaning the ticket remains)?

Thanks
Smiley Happy

For the login, for the moment, I just used the method start session.Isn't it enough?
I'm sorry but I can't believe that doesn't exist an API's method that retrieves files contained in a certain folder.
Is it possible to write a web script that returns the list of files that THE USER CAN SEE according to alfresco's roles?
And when I have this list, how can i make a list of link (in html) to download these files?

Can u give me an example code to retrieve Noderef Id of the above example starting from the path of Folder1?

Sorry for the questions but the API's documentation i found is poor.

Thanks

hyperation
Champ on-the-rise
Champ on-the-rise
Hi,

For start session, do you mean in Java code or some kind of Javascript?  Can you tell me more about how your login is structured (classes, webpages,etc)?

As for getting the folder items, check out the Opsoro framework.

http://forge.alfresco.com/plugins/scmsvn/viewcvs.php/opsoro/trunk/source/web/webScripts/opsoro/?root...

Look at documents.get.* webscript.

Thanks
Smiley Happy

openpj
Elite Collaborator
Elite Collaborator
Alfresco WebScript use Foundation Services API and then all the contents that users see are profiled correctly according to Alfresco permission and roles.

You can take a look at Folder Webscript, this is a sample webscript that you can use to create your own webscript:
http://localhost:8080/alfresco/service/sample/folder/Company%20Home
This webscript is deployed here (from JSF Client):
/Company Home/Data Dictionary/Webscripts/org/alfresco/sample

If you want to get a content you can use one of these urls that are based in an unique webscript:
Content Retrieval (getContent)
GET /alfresco/service/api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/path/content{property}/{store_type}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/avmpath/content{property}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}
GET /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}?a={attach?}
Hope this helps.

inspiron82
Champ in-the-making
Champ in-the-making
Alfresco WebScript use Foundation Services API and then all the contents that users see are profiled correctly according to Alfresco permission and roles.

You can take a look at Folder Webscript, this is a sample webscript that you can use to create your own webscript:
http://localhost:8080/alfresco/service/sample/folder/Company%20Home
This webscript is deployed here (from JSF Client):
/Company Home/Data Dictionary/Webscripts/org/alfresco/sample

If you want to get a content you can use one of these urls that are based in an unique webscript:
Content Retrieval (getContent)
GET /alfresco/service/api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/path/content{property}/{store_type}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/avmpath/content{property}/{store_id}/{id}?a={attach?}
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}
GET /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}?a={attach?}
Hope this helps.



Thanks a lot.
Now, I can i search a node symply by the path.
For example, I know that the folderZ has this path:

company_home/folderX/folderY/folderZ
which lines of code i have to write to have a reference to the folderZ?

thanks

inspiron82
Champ in-the-making
Champ in-the-making
The problem is that i didn't found some good documentation and so i  didn't understand the general logic of web services.

I make a connection to the repository, and then?

Is there some good documentation that will let me understand tecniques to make operations on the repository?

thanks