Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hervé Ménage
Journal draft articles
December 2, 2008 2:49 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hello,

Could anybody explain to me why there is not any "save as draft" feature in Liferay Journal?

I want to be able to edit my article, save it, and edit it later. Currently, the email notification for approval is sent as soon as the article is saved. "Save as draft" would not send the email.
What about customizable workflows in Journal?

Many thanks for your help
Regards

Hervé
Hervé Ménage
RE: Journal draft articles
December 3, 2008 8:40 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi,

I actually implemented the feature, see LPS-856

http://issues.liferay.com/browse/LPS-856

Attached are the files, as described in the JIRA issue.

It would be great that you install and test it, so that we can hope to get this feature really soon in Liferay!

Best regards
Hervé
Attachments: journal_draft.zip (683.1k)
Gloria Muñoz
RE: Journal draft articles
January 15, 2009 12:03 AM
Answer

Gloria Muñoz

Rank: Junior Member

Posts: 47

Join Date: November 4, 2008

Recent Posts

Hi Hervé,

I'm facing a similar problem and I wonder if you could help me.
As far as I know the "Deny" workflow action is not implemented. Till now the way to deny an article content is to click the "Expire" button, and once an article is expired, no mail is sent whenever the writer update the article, unless you save it as a new version, and the state of both old and new versions keeps expired.

I've been thinking about using the review feature as a request for the writer to modify the article. For that, I need to change the default recipient e-mail address of the review email, do you know where can I modify that??

Did you find any other solution?

Thanks in advance, and please answer, it's important..
Hervé Ménage
RE: Journal draft articles
January 15, 2009 12:26 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi Gloria,

You can change email settings in the Journal portlet's configuration mode.
The following email templates can be configured:
- Email From
- Article Denied email
- Article granted email
- Article review email

"From:" recipient is the email address of the user who performed the action on the article (e.g. "expire", "approve", "send for approval")

Let me know if I did not understand your question.

Best regards
Hervé
Gloria Muñoz
RE: Journal draft articles
January 15, 2009 12:34 AM
Answer

Gloria Muñoz

Rank: Junior Member

Posts: 47

Join Date: November 4, 2008

Recent Posts

I think the default mail settings of Journal Portlet for the review email are:

From: the author of the article
To: address from the Email from tab.

what I want is the author to receive the review email, not the address from the Email tab. Is this possible??

Thanks for answering so early! emoticon
Hervé Ménage
RE: Journal draft articles
January 15, 2009 1:00 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Well, actually the code is not what I would have expected...

File (version I posted): com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl
Method: sendMail

From line 2347: you can see how the email from/to are set.
From there, I think you can imagine a quick fix.

However, I would rather like Liferay to make use of roles and permissions to detect which users are allowed to approve the articles, and to send the email to them. It is more work...

Hope it helps
Regards
Hervé
Gloria Muñoz
RE: Journal draft articles
January 15, 2009 1:09 AM
Answer

Gloria Muñoz

Rank: Junior Member

Posts: 47

Join Date: November 4, 2008

Recent Posts

Of course it helps!
That's what I was looking for. Right now this is enough for me, until someone implement a better solution for the deny article workflow. I'll think about it.

Thanks so much!
Gloria Muñoz
RE: Journal draft articles
January 23, 2009 1:17 AM
Answer

Gloria Muñoz

Rank: Junior Member

Posts: 47

Join Date: November 4, 2008

Recent Posts

Hi again,

I've finally installed the ext-environment and it works fine. Now I want to use your "journal draft package", which looks very useful emoticon, but I'm new in Liferay development and I'm not sure about how to install it. Could you please give me some indications?

Cheers!
Hervé Ménage
RE: Journal draft articles
January 23, 2009 1:51 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi Gloria,

I have not been using the ext environment, thus I cannot help you much... I think it is well explained on Liferay wikipedia.
In the ZIP bundle, I packaged the complete stuff, but you need only the files I modified in your ext environment. Have a look the their timestamp.

Regards
Hervé
Rohan Gandhi
RE: Journal draft articles
January 23, 2009 5:49 AM
Answer

Rohan Gandhi

Rank: New Member

Posts: 9

Join Date: November 26, 2008

Recent Posts

Hervé Ménage:
Hi Gloria,

I have not been using the ext environment, thus I cannot help you much... I think it is well explained on Liferay wikipedia.
In the ZIP bundle, I packaged the complete stuff, but you need only the files I modified in your ext environment. Have a look the their timestamp.

Regards
Hervé


Hello Hervé,
Great work with that "save as draft". The zip code you gave is showing the message in the console as ">>>>HME : Draft mode implemented." But I want you ask you some question regarding the problems that I am facing.
1.Which permissions should be set when you want to create a role, for example, if I want to create a writer? For him the "save as draft" functionality would be a boon.
2. I cannot see any tab such as "save as draft", but I can see the message in the console as i have said earlier. So, it may be related to question 1.
3. Also, let me know if you want any help for testing your code. I am not a proficient developer, but still I can try my best to help you.

Thank you for the code. Waiting for the reply.
Regards,
Rohan.
Hervé Ménage
RE: Journal draft articles
January 23, 2009 6:25 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi Rohan,

Thank you for testing ! Always appreciated :-)

Have you read the fix description I published in JIRA? http://issues.liferay.com/browse/LPS-856
It is actually more detailed than in the forum.

What I did not like with the original version of Journal, is that as soon as you perform the "Save" or "Save and continue" action, the email is sent to request the approval.
So I removed the automatic email notification on these actions: the article is saved, as draft, as no approval request is sent.
However, the "draft" status does not exist (draft = saved + not approved)
To send the email for approval, I added the "Request approval" action. It simply sends the email.

(Do not care about messages in the console, it is an simple way to check whether my classes are used in place of Liferay ones)

Regarding permissions: you can create roles in Liferay Enterprise Admin.
- I created the community role "Marketing" (Marketing can add and update content in CMS), and defined permissions. See attachment. Users assigned to this role will not be able to "approve" an article.
- Then I created the community role "Direction" (Direction can approve articles), and defined permissions. See attachment. these users can only approve articles.

Finally assign your users to their respective role.

"Request for approval" can be improved by setting the requester's email address instead of the address configured in the portlet. Gloria is working on that I think.

Regards
Hervé
Attachment

Attachment

Attachments: direction_role.JPG (28.1k), marketing_role.JPG (30.5k)
Rohan Gandhi
RE: Journal draft articles
January 26, 2009 8:57 PM
Answer

Rohan Gandhi

Rank: New Member

Posts: 9

Join Date: November 26, 2008

Recent Posts

Hello Herve,
There is some difficulty that I am facing with the permissions now.
1. If I don't enable the permission of "approve article" for the writer role, I do get the tab of "Submit for approval". As soon as I click the tab, i get "you do not have the required role permission".
2. If I enable the permissions as you have shown me in the attachments, I don't get the "Submit for approval" tab. Instead I do get a "Approve" tab.
3. I have permitted the writer with view, add article and approve permissions.

Any suggestions on it?
Hervé Ménage
RE: Journal draft articles
January 26, 2009 10:52 PM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi Rohan,

Mmm... Let's step into all details, I may have forgotten something.

I have created a community called "Marketing".
I have created a community role name "Marketing"
I have created a community role name "Direction"

I defined the following portlet permissions for the role "Marketing":

Portlet - Resource - Action
Journal - (no resource) - Add Article
Journal - (no resource) - View
Journal - "Journal Article" - Delete
Journal - "Journal Article" - Expire
Journal - "Journal Article" - Permissions
Journal - "Journal Article" - Update
Journal - "Journal Article" - View


Why cannot we create tables in the forums?! Why not the same editor as in Journal??? :-(

I defined the following portlet permissions for the role "Direction":

Portlet - Resource - Action
Journal - (no resource) - Approve Article
Journal - (no resource) - View
Journal - "Journal Article" - Expire
Journal - "Journal Article" - View


I assigned a user to the community "Marketing":
1. Assign the user "MakertingUser" as community member
2. Assign him to community roles ([assign user roles] link)
3. Check "Marketing"
This user is now assigned to "Community member" and "Marketing" roles in the Marketing community

I assigned a user to the community "Direction":
1. Assign the user "DirectionUser"
2. Assign him to community roles ([assign user roles] link)
3. Check "Direction"
This user is now assigned to "Community member" and "Direction" roles in the Marketing community

Connect with "MarketingUser" and navigate in the Marketing community "Journal" page: your user is allowed to add articles, to submit it for approval, but not to approve it.

Create the article, and submit it for approval. If emails settings are correct, you should receive a notification email. It is not required to proceed further.

Now connect with "DirectionUser" and navigate in the Marketing community "Journal" page: search for non approved articles, you will see the one you created. As you can see, the user cannot edit it, but preview it only.
Preview the article: the "Approve" action is available (in the workflow section).
Approve it, and you're done!

If your installation does not behave as expected, please check the following:
- I am running LEP 5.1.2
- I deployed the fix, which is available for download in my first post

Regards
Hervé