Forums de discussion

How to add expiry date for Documents?

Raghu k, modifié il y a 11 années.

How to add expiry date for Documents?

Junior Member Publications: 58 Date d'inscription: 10/08/12 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?
thumbnail
Hitoshi Ozawa, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 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, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Junior Member Publications: 58 Date d'inscription: 10/08/12 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?
thumbnail
dave ch, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Regular Member Publications: 161 Date d'inscription: 07/02/12 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, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Junior Member Publications: 58 Date d'inscription: 10/08/12 Publications récentes
Thanks Dave.

DLFileVersion getLatestFileVersion(boolean trusted)

What is the use of trusted variable? What difference does it's value make?
thumbnail
dave ch, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Regular Member Publications: 161 Date d'inscription: 07/02/12 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, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Junior Member Publications: 58 Date d'inscription: 10/08/12 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.
thumbnail
Vilmos Papp, modifié il y a 11 années.

RE: How to add expiry date for Documents?

Liferay Master Publications: 529 Date d'inscription: 21/10/10 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
thumbnail
Akash B Gajjar, modifié il y a 10 années.

RE: How to add expiry date for Documents?

New Member Publications: 5 Date d'inscription: 16/05/10 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