Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Raghu k
How to add expiry date for Documents?
27 février 2013 01:07
Réponse

Raghu k

Rang: Junior Member

Publications: 58

Date d'inscription: 10 août 2012

Publications Récentes

Hi all,
I want to set expiry date for Documents. How can i achieve this?
We have schedule option for Web content which does this job. But this option is not available for Documents. How can I implement this feature to Documents? Also how does this schedule works?
Hitoshi Ozawa
RE: How to add expiry date for Documents?
27 février 2013 06:39
Réponse

Hitoshi Ozawa

Rang: Liferay Legend

Publications: 7949

Date d'inscription: 23 mars 2010

Publications Récentes

If you have no idea about how to develop with liferay, it may be easier to just ask Liferay.com to support it in the future release.
You can post your request to the following forum.

http://www.liferay.com/community/forums/-/message_boards/category/1108052
Raghu k
RE: How to add expiry date for Documents?
27 février 2013 23:55
Réponse

Raghu k

Rang: Junior Member

Publications: 58

Date d'inscription: 10 août 2012

Publications Récentes

Hi Hitoshi.
Thanks for the update. I have updated that forum. Below is the link (may be useful to someone if Liferay team responds).
http://www.liferay.com/community/forums/-/message_boards/message/21872003

Do you have any idea/suggestion reg how to implement this feature for Documents and DDLs?

Below are the changes I have done. Please correct me if my approach is wrong.
1. Retrieved all the assets of required type which has past expirationdate using query as I dint find proper Classes from API to get expiration date.
SELECT * FROM assetentry where classNameId in (10010) and DATE(expirationDate) < DATE(NOW())
2. Then with ClassPK value of each result for this query I got DLFileEntry.
DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getDLFileEntry(classPK);
3. For this DLFileEntry I got LatestFileVersion and I have set status to 3 (which means its expired).
dlFileEntry.getLatestFileVersion(true).setStatus(3);

But this is not updating status column in dlfileversion table.
DLFileVersion getLatestFileVersion(boolean trusted). This is the method signature. What does boolean trusted represent?
When i gave this value to false im getting some security exception related to PortalException. So I gave it to true.
What could be the reason for status not getting updated?
dave ch
RE: How to add expiry date for Documents?
28 février 2013 00:19
Réponse

dave ch

Rang: Regular Member

Publications: 164

Date d'inscription: 6 février 2012

Publications Récentes


Do you have any idea/suggestion reg how to implement this feature for Documents and DDLs?


I have implemented expiration date functionality for DDL portlet by creating custom fields. Since liferay does not provide any custom field by default for DDL, hence, using coding(expando) i have achieved this.
Hope that helps you.

Thanks,
Dave
Raghu k
RE: How to add expiry date for Documents?
28 février 2013 01:13
Réponse

Raghu k

Rang: Junior Member

Publications: 58

Date d'inscription: 10 août 2012

Publications Récentes

Thanks Dave.

DLFileVersion getLatestFileVersion(boolean trusted)

What is the use of trusted variable? What difference does it's value make?
dave ch
RE: How to add expiry date for Documents?
28 février 2013 03:50
Réponse

dave ch

Rang: Regular Member

Publications: 164

Date d'inscription: 6 février 2012

Publications Récentes


DLFileVersion getLatestFileVersion(boolean trusted)
What is the use of trusted variable? What difference does it's value make?


Hi Raghu,

Could you plz elaborate your req? What actually you want to achieve with this code?

Thanks,
Dave
Raghu k
RE: How to add expiry date for Documents?
28 février 2013 04:54
Réponse

Raghu k

Rang: Junior Member

Publications: 58

Date d'inscription: 10 août 2012

Publications Récentes

dave ch:


Hi Raghu,

Could you plz elaborate your req? What actually you want to achieve with this code?

Thanks,
Dave


I want to get expirydate value of a document. expirydate column is present in "dlfileversion" table. To use this table, I need DLFileVersion instance.
So I am trying to get DLFileVersion instance from DLFileEntry object. This is done with the help of getLatestFileVersion(boolean trusted).

I don't know importance of this boolean variable and what it does if its true / flase.
Vilmos Papp
RE: How to add expiry date for Documents?
28 février 2013 05:12
Réponse

Vilmos Papp

LIFERAY STAFF

Rang: Liferay Master

Publications: 521

Date d'inscription: 21 octobre 2010

Publications Récentes

Hi,

Try to use Custom Fields for documents, and implement a scheduler based on the pattern we use e.g.: in Social Activities portlet.

Regards,
Vilmos
Akash B Gajjar
RE: How to add expiry date for Documents?
5 novembre 2013 09:02
Réponse

Akash B Gajjar

Rang: New Member

Publications: 5

Date d'inscription: 15 mai 2010

Publications Récentes

Hi, I extended Dynamic Data Lists portlet with display date and expiration date and have explained approach in following link.

https://www.liferay.com/community/forums/-/message_boards/message/31035135

Hope, this approach provides guideline in your case. I think, you can use similar approach for Document Library Portlet.

Thx.

Regards,
Akash Gajjar