Alex Nguyen | : |
|
|
| im using Document Library to store some document and i have some user can upload data but now i want know when he or she upload the data, the information of file will be: |
|
|
|
|
|
|
|
| name size download datetime user |
|
|
|
|
|
|
|
| can you help me ? |
|
|
|
|
|
|
|
| thanks so much. |
|
|
|
|
|
|
|
| Alex |
|
|
|
|
|
|
Mazhar Anwar | : | Hi Alex, |
|
|
|
|
|
|
|
| Documents entries are added to DLFileEntry table in Liferay, where you can find all related information for documents, |
|
|
|
|
|
|
|
| You can get more documents related information in TagsAsset table, since for each document upload, Liferay adds entries in tagsAssets table and maintain the counter for each asset downloads. |
|
|
|
|
|
|
|
| you can fetch the data from any of the above tables by using any custom-sql or using any existing Liferay API(As per requirement) in your portlet. |
|
|
|
|
|
|
|
| HTH,
Mazhar |
|
|
|
|
|
|
Erik Andersson | : | Hi Alex, |
|
|
|
|
|
|
|
| I would use a model listener to tap into the event that a new document library entry has been made: |
|
|
|
|
|
|
|
| http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Portal+Hook+Plugins |
|
|
|
|
|
|
|
| Cheers,
Erik |
|
|
|
|
|
|
Alex Nguyen | : | Thank for your reply but |
|
|
|
|
|
|
|
| Im not still clearly. |
|
|
|
|
|
|
|
| Can you tell me the way to do it. |
|
|
|
|
|
|
|
| thanks |
|
|
|
|
|
|
Erik Andersson | : | You implement a model listener with a hook. Hooks and model listeners are described in the wiki post I linked to. Also, take a look at the SevenCogs hook that comes with your Liferay bundle to get a more handson grip on how hooks are used. |
|
|
|
|
|
|
|
| One thing has changed since Ray wrote the wiki post: |
|
|
|
|
|
|
|
| Now you don't register your model listener in the liferay-hook.xml file. You rather specify your model listener in a portal.properties file, and then register the portal.properties file in the liferay-hook.xml file. |
|
|
|
|
|
|
|
| 1. To register a model listener - create a portal.properties file in your hook and specify your listener: |
|
|
|
|
|
|
|
| 2. Add your portal.properties to your liferay-hook.xml file: |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
| 2. Add your portal.properties to your liferay-hook.xml file: |
|
|
|
|
| |
|
|
|
|
|
|
|
| 3. Add your new listener class to your hook: |
|
|
|
|
| |
|
|
|
|
|
|
|
| Hooks can be tricky to get at first. But play around with them for a while. Learning how they work unveils a lot of possibilities in Liferay. |
|
|
|
|
|
|
|
| Cheers,
Erik |
No comments:
Post a Comment