Author: sshyrkov
Date: Thu Jan 24 21:15:23 2008
New Revision: 19577

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19577&repname=
=3Djahia
Log:
SQLIMA-11: [Migration jahia 5.0.3] Workflow icon
http://www.jahia.net/jira/browse/SQLIMA-11

Problem: 1) displayWorkflowStates is not correctly initialized
2) customized template does not include the code from /jsp/jahia/topbar/top=
menu.inc + a lot of content boxes are loaded with Ajax, so the workflow sta=
tes for them can not be retrieved with a single call after the page is load=
ed (the box content arrive to late)

Resolution:
1) correctly initialize values for displayWorkflowStates, displayTimeBasedP=
ublishing and aclDifferenceParam
2) add new option 'workflow_display_batch_loading' to the jahia.properties.=
 If set to "true" (default), the workflow state icons (near action menues f=
or content objects) will be retrieved from the server with  single Ajax cal=
l. If set to "false" each icon will be retrieved with a separate Ajax call =
(as it was in Jahia prior to 5.0.3)

Modified:
    trunk/core/src/java/org/jahia/gui/HTMLToolBox.java
    trunk/core/src/java/org/jahia/settings/SettingsBean.java
    trunk/core/src/webapp/WEB-INF/etc/config/jahia.skeleton

Modified: trunk/core/src/java/org/jahia/gui/HTMLToolBox.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/gui/HTMLToolBox.java&rev=3D19577&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/gui/HTMLToolBox.java (original)
+++ trunk/core/src/java/org/jahia/gui/HTMLToolBox.java Thu Jan 24 21:15:23 =
2008
@@ -1403,15 +1403,18 @@
         Boolean aclDifferenceParam =3D getUserInitialSettingForDevMode(the=
request, userSettings.ACL_VISU_ENABLED);
         if (!isDevMode) {
             try {
-                displayWorkflowStates =3D Boolean.valueOf((String) therequ=
est.getSession().getAttribute(userSettings.WF_VISU_ENABLED));
+                String value =3D (String) therequest.getSession().getAttri=
bute(userSettings.WF_VISU_ENABLED);
+                displayWorkflowStates =3D value !=3D null ? Boolean.valueO=
f(value) : null;
                 if (displayWorkflowStates =3D=3D null) {
                     displayWorkflowStates =3D Boolean.valueOf(Jahia.getSet=
tings().isWflowDisp());
                 }
-                displayTimeBasedPublishing =3D Boolean.valueOf((String) th=
erequest.getSession().getAttribute(userSettings.TBP_VISU_ENABLED));
+                value =3D (String) therequest.getSession().getAttribute(us=
erSettings.TBP_VISU_ENABLED);
+                displayTimeBasedPublishing =3D value !=3D null ? Boolean.v=
alueOf(value) : null;
                 if (displayTimeBasedPublishing =3D=3D null) {
                     displayTimeBasedPublishing =3D Boolean.valueOf(Jahia.g=
etSettings().isTbpDisp());
                 }
-                aclDifferenceParam =3D Boolean.valueOf((String) therequest=
.getSession().getAttribute(userSettings.ACL_VISU_ENABLED));
+                value =3D (String) therequest.getSession().getAttribute(us=
erSettings.ACL_VISU_ENABLED);
+                aclDifferenceParam =3D value !=3D null ? Boolean.valueOf(v=
alue) : null;
                 if (aclDifferenceParam =3D=3D null) {
                     aclDifferenceParam =3D Boolean.valueOf(Jahia.getSettin=
gs().isAclDisp());
                 }
@@ -1483,16 +1486,38 @@
             }
 =

             try {
-                out.print("<a href=3D\"javascript:");
-                out.print(drawWorkflowLauncher(buff.toString()));
-                out.print("\"");
-                out.print("\"><img class=3D\"wfState\"");
-                out.print(" title=3D\"");
-                out.print(objectKey);
-                out.print("\" src=3D\"");
-                out.print(contextPath);
-                out.print("/jsp/jahia/engines/images/wfWait.gif\" width=3D=
\"12\" height=3D\"12\"/>");
-                out.print("</a>");
+                if (Jahia.getSettings().isWflowStateBatchLoading()) {
+                    out.print("<a href=3D\"javascript:");
+                    out.print(drawWorkflowLauncher(buff.toString()));
+                    out.print("\"");
+                    out.print("\"><img class=3D\"wfState\"");
+                    out.print(" title=3D\"");
+                    out.print(objectKey);
+                    out.print("\" src=3D\"");
+                    out.print(contextPath);
+                    out
+                            .print("/jsp/jahia/engines/images/wfWait.gif\"=
 width=3D\"12\" height=3D\"12\"/>");
+                    out.print("</a>");
+                } else {
+                    out.print("<a href=3D\"javascript:");
+                    out.print(drawWorkflowLauncher(buff.toString()));
+                    out.print("\"");
+                    out.print("\">\n");
+                    buff.delete(0, buff.length());
+
+                    out.print("<img id=3D\"");
+                    out.print("tbpState_");
+                    out.print(realObjectKey);
+                    out.print("\" border=3D\"0\" src=3D\"");
+                    out.print(contextPath);
+                    out
+                            .print("/ajaxaction/GetWorkflowState?params=3D=
/op/edit/pid/");
+                    out.print(jParams.getPageID());
+                    out.print("&key=3D");
+                    out.print(objectKey);
+                    out.print("\" />");
+                    out.println("</a>");
+                }
             } catch (JahiaException je) {
                 logger.error(je.getMessage(), je);
             }

Modified: trunk/core/src/java/org/jahia/settings/SettingsBean.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/settings/SettingsBean.java&rev=3D19577&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/settings/SettingsBean.java (original)
+++ trunk/core/src/java/org/jahia/settings/SettingsBean.java Thu Jan 24 21:=
15:23 2008
@@ -376,7 +376,9 @@
     private int editModeSessionTimeout =3D 2*60*60; // 2 hours
     =

     // The db max elements for SQL IN clause
-    private int dBMaxElementsForInClause =3D 1000;    =

+    private int dBMaxElementsForInClause =3D 1000;
+
+    private boolean wflowStateBatchLoading;    =

 =

     /**
      * Default constructor.
@@ -796,6 +798,7 @@
             tbpDisp =3D getBoolean("timebased_display",false);
             aclDisp =3D getBoolean("aclDiff_display",false);
             wflowDisp =3DgetBoolean("workflow_display",false);
+            wflowStateBatchLoading =3D getBoolean("workflow_display_batch_=
loading", true);
             chatDisp =3DgetBoolean("chat_display",false);
             pdispDisp =3DgetBoolean("process_display",true);
             connectionTimeoutForProductionJob =3D getInt("connectionTimeou=
tForProductionJob",60000);
@@ -2193,4 +2196,8 @@
     public boolean isPreloadDBGroupMembersActivated() {
         return preloadDBGroupMembersActivated;
     }
+
+    public boolean isWflowStateBatchLoading() {
+        return wflowStateBatchLoading;
+    }
 }

Modified: trunk/core/src/webapp/WEB-INF/etc/config/jahia.skeleton
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/etc/config/jahia.skeleton&rev=3D19577&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/etc/config/jahia.skeleton (original)
+++ trunk/core/src/webapp/WEB-INF/etc/config/jahia.skeleton Thu Jan 24 21:1=
5:23 2008
@@ -812,6 +812,7 @@
 # performance.
 timebased_display                                       =3D false
 workflow_display                                        =3D true
+workflow_display_batch_loading                          =3D true
 chat_display                                            =3D true
 process_display                                         =3D true
 aclDiff_display                                                                
                        =3D false

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to