The Proposals Wiki has been deprecated in favor of creating Feature Requests in JIRA. If you wish to propose a new idea for a feature, visit the Community Ideas Dashboard and read the Feature Requests Wiki page for more information about submitting your proposal.
« Back to 2012 Google...

Expire Documents

Project Title #

Expire Documents in Document Library

Background #

Liferay provides one central place to aggregate and manage all your content. Each community within Liferay Portal gets its own separate Document Library, which is equipped with customizable folders and act as a web-based shared drive for all your team members, no matter where they are. Because content is accessible only by those authorized by the administrator, each individual file is as open or as secure as you need it to be.

Documents are often collaborated on, live for a while, then become deprecated, obsolete, or wrong over time.

Use Cases #

A document that has become obsolete needs to be expired such that it can no longer be viewed or accessed, but is instead archived as a previous, no longer valid, document.

The Problem #

Currently, Documents in the document library have no expiration date, and live forever unless manually deleted by an administrator.

The Solution #

Modify the Document Library to give the ability to expire documents.

Now that Liferay has implemented the workflow infrastructure it's much easier to implement this project, since DLFiles has the hability to store the status. Custom fields like expiration date can be added to the form and then create the logic that changes the status when the user decides.

Skills Needed #

  • Required: Java, JSP, XML
  • Nice to have: Liferay experience

Prerequisites #

None.

Deliverables #

  • Complete code changes to Liferay Portal blog tool to enable a "print view" option displayed as part of a given blog post or blog aggregator.
  • Unit tests for all new and changed code.
  • Documentation required to configure the blog tool for print view.

References #

Related Issues #

LPS-4500

External References #

Document Library Portlet

Liferay Workflow Blog Post

Official Workflow documentation

0 Attachments
27491 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
Threaded Replies Author Date
Hi, I have achieved this functionality. I have... Dileepkumar R March 27, 2013 10:15 PM
Hi Dileep, I tried to update some document in... Julien GRESSE May 17, 2013 8:33 AM
Hi, I have achieved this functionality. I have... Dileepkumar R March 27, 2013 10:15 PM
Dileep, I'm trying to achieve this also, but... Adam Spence April 2, 2013 9:15 AM
Hi Adam, Even i did the same as you. I have... Dileepkumar R April 2, 2013 10:13 PM
Hi Adam, Even I have the same exception. So, I... Dileepkumar R April 4, 2013 6:47 AM
Dileep, Are you republishing the expired... Adam Spence April 4, 2013 8:15 AM

Hi,
I have achieved this functionality. I have added a custom expiration date field to Document and Media Document and i insert all the details into a custom table which is scanned by a scheduler class and once the expiration date is reached, a notification is sent to the content contributor and the File Version status is changed to 3(Expired).

Regards,
Dileep.
Posted on 3/27/13 10:15 PM.
Hi,
I have achieved this functionality. I have added a custom expiration date field to Document and Media Document and i insert all the details into a custom table which is scanned by a scheduler class and once the expiration date is reached, a notification is sent to the content contributor and the File Version status is changed to 3(Expired).

Regards,
Dileep.
Posted on 3/27/13 10:15 PM.
Dileep,

I'm trying to achieve this also, but I'm seeing some weird behavior(losing assigned asset categories for the document after changing the file version status to expired, getting BatchUpdateException/ConstraintViolationException related to duplicate entry keys when trying to republish the document). Currently I'm just using DLFileVersionLocalServiceUtil to update the file version status. I can't say that I fully understand the intricacies of all the database stuff though. Was there any additional work you had to do to get this to work?

Thanks,
Adam
Posted on 4/2/13 9:15 AM in reply to Dileepkumar R.
Hi Adam,
Even i did the same as you. I have changed the status using DLFileVersionLocalServiceUtil. And i'm able to re-publish the same document again. From workflow, there is a provision to set the document status to approved/pending/reject/draft/expired/incomplete. That means we also can update programatically to any status right.

Regards,
Dileep.
Posted on 4/2/13 10:13 PM in reply to Adam Spence.
Hi Adam,
Even I have the same exception. So, I have changed my update call using
DLFileEntryLocalServiceUtil.updateStatus(). Then I'm able to republish the expired document.
Regards,Dileep
Posted on 4/4/13 6:47 AM in reply to Dileepkumar R.
Dileep,

Are you republishing the expired document in a folder that has a workflow configured? It seems to work for me when I publish/expire/republish the document in a folder with a workflow configured, but not when I'm in a folder without a workflow(I get BatchUpdateException). Also, in my hook which overrides EditFileEntryAction, I had to set the status of an expired document to 'approved' before calling the original processAction() for add/update, otherwise after the document was republished and approved, its status would be stuck at 'pending'.

Regards,
Adam
Posted on 4/4/13 8:15 AM in reply to Dileepkumar R.
Hi Dileep,

I tried to update some document in the database with this:
UPDATE `mskportaldemo`.`dlfileversion` SET `status`='3' WHERE `fileVersionId`='16234';
but it do not seems to change anything.
Did you do some changes in JSP or Java code to handle document expiration ?

Julien
Posted on 5/17/13 8:33 AM in reply to Dileepkumar R.