Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/forms
In directory 
james.mmbase.org:/tmp/cvs-serv15269/portlets-newsletter/src/java/com/finalist/newsletter/forms

Modified Files:
        NewsletterPublicationPublish.java 
Log Message:
CMSC-1178 - Add restrictions to Newsletter edition workflow for SiteTree. Also 
improved code.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/forms
See also: http://www.mmbase.org/jira/browse/CMSC-1178


Index: NewsletterPublicationPublish.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/forms/NewsletterPublicationPublish.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- NewsletterPublicationPublish.java   11 Dec 2008 06:55:37 -0000      1.25
+++ NewsletterPublicationPublish.java   12 Dec 2008 17:27:02 -0000      1.26
@@ -47,6 +47,12 @@
    private static final String ACTION_CANCEL = "cancel";
 
    /**
+    * System property to allow skipping the Freeze or Approve action 
+    */
+   public static final String NEWSLETTER_FREEZE_PROPERTY = 
"newsletter.workflow.allow.skip.freezing";
+   public static final String NEWSLETTER_APPROVE_PROPERTY = 
"newsletter.workflow.allow.skip.approving";
+
+   /**
     * @Override
     */
    public ActionForward execute(ActionMapping mapping, HttpServletRequest 
request, Cloud cloud) throws Exception {
@@ -67,15 +73,15 @@
          boolean isChiefEditor = (role != null && 
SecurityUtil.isChiefEditor(role));
 
          if (!isWebMaster && !isChiefEditor) {
-            String process_status 
=publicationNode.getStringValue("process_status");
-            
if("true".equalsIgnoreCase(PropertiesUtil.getProperty("newsletter.workflow.skip.freezing")))
 {
+            String process_status = 
publicationNode.getStringValue("process_status");
+            
if("true".equalsIgnoreCase(PropertiesUtil.getProperty(NEWSLETTER_FREEZE_PROPERTY)))
 {
                if (EditionStatus.INITIAL.value().equals(process_status)) {
                   request.setAttribute("message", 
"confirm_send.skip.freezing"); 
                   request.setAttribute("restriction", true);
                   return mapping.findForward("confirm_send");
                }
             }
-            
if("true".equalsIgnoreCase(PropertiesUtil.getProperty("newsletter.workflow.skip.approving")))
 {
+            
if("true".equalsIgnoreCase(PropertiesUtil.getProperty(NEWSLETTER_APPROVE_PROPERTY)))
 {
                if (EditionStatus.INITIAL.value().equals(process_status) || 
EditionStatus.FROZEN.value().equals(process_status)) {
                   request.setAttribute("message", 
"confirm_send.skip.approving"); 
                   request.setAttribute("restriction", true);
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to