Author: knguyen
Date: Wed Jul 18 15:18:09 2007
New Revision: 18030

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18030&repname=
=3Djahia
Log:
add time based publishing status icon to Page select engine.

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/engine.j=
sp
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/selectpa=
ge/select_page.jsp
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/p=
age_field.jsp
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/jahia=
.js
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTree.js
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTreeProperties.js

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap=
/SiteMapAbstractAction.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteMapAbstractAction.java&rev=
=3D18030&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/ajax/sitemap/SiteM=
apAbstractAction.java Wed Jul 18 15:18:09 2007
@@ -46,9 +46,14 @@
 import org.jahia.services.usermanager.JahiaUser;
 import org.jahia.services.version.*;
 import org.jahia.services.workflow.WorkflowService;
+import org.jahia.services.timebasedpublishing.RetentionRule;
+import org.jahia.services.timebasedpublishing.TimeBasedPublishingService;
 import org.jahia.utils.LanguageCodeConverters;
 import org.jahia.views.engines.JahiaEngineViewHelper;
 import org.jahia.views.engines.versioning.pages.PagesVersioningViewHelper;
+import org.jahia.hibernate.manager.JahiaObjectManager;
+import org.jahia.hibernate.manager.SpringContextSingleton;
+import org.jahia.hibernate.manager.JahiaObjectDelegate;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 =

@@ -78,6 +83,13 @@
     protected static final int NORMAL =3D 1;
     protected static final int VERSIONNING =3D 2;
 =

+    protected static final String TBP_EXPIRED_BUT_WILL_BECOME_VALID =3D "2=
0";
+    protected static final String TBP_EXPIRED =3D "21";
+    protected static final String TBP_VALID_BUT_WILL_EXPIRE =3D "22";
+    protected static final String TBP_VALID =3D "23";
+    protected static final String TBP_NOT_VALID_BUT_WILL_BECOME_VALID =3D =
"24";
+    protected static final String TBP_UNKNOWN =3D "25";
+
     /**
      * Gets all the direct child objects of a given ContentObject, that ha=
ve a separate WorkFlow associated to them.
      *
@@ -453,6 +465,9 @@
             }
             item.appendChild(lang);
         }
+        if ( item !=3D null ){
+            processTimeBasedPublishing(page,jParams,item);
+        }
         root.appendChild(item);
     }
 =

@@ -696,6 +711,65 @@
         root.appendChild(item);
     }
 =

+    protected void processTimeBasedPublishing(ContentObject contentObject,=
 ProcessingContext jParams, Element item){
+        try {
+            final JahiaObjectManager jahiaObjectManager =3D
+                    (JahiaObjectManager) SpringContextSingleton.getInstanc=
e()
+                            .getContext().getBean(JahiaObjectManager.class=
.getName());
+
+            final JahiaObjectDelegate jahiaObjectDelegate =3D
+                    jahiaObjectManager.getJahiaObjectDelegate(contentObjec=
t.getObjectKey());
+            TimeBasedPublishingService tbpService =3D ServicesRegistry.get=
Instance()
+                    .getTimeBasedPublishingService();
+            final RetentionRule retRule =3D tbpService.getRetentionRule(co=
ntentObject.getObjectKey());
+            final long nowInMillis =3D new Date().getTime();
+            final long offSet =3D TimeZone.getDefault().getOffset(nowInMil=
lis);
+            final long now =3D nowInMillis - offSet;
+            String statusLabel =3D "";
+            if (retRule !=3D null) {
+                final boolean isValid =3D jahiaObjectDelegate.isValid();
+                final boolean isExpired =3D jahiaObjectDelegate.isExpired(=
);
+                final boolean willExpire =3D jahiaObjectDelegate.willExpir=
e(now);
+                final boolean willBecomeValid =3D jahiaObjectDelegate.will=
BecomeValid(now);
+                if (isExpired) {
+                    if (willBecomeValid) {
+                        statusLabel =3D TBP_EXPIRED_BUT_WILL_BECOME_VALID;=
 // yellow
+                    } else {
+                        statusLabel =3D TBP_EXPIRED; // red
+                    }
+                } else if (isValid) {
+                    if (willExpire) {
+                        statusLabel =3D TBP_VALID_BUT_WILL_EXPIRE; // oran=
ge
+                    } else {
+                        statusLabel =3D TBP_VALID; // green
+                    }
+                } else {
+                    if (willBecomeValid) {
+                        statusLabel =3D TBP_NOT_VALID_BUT_WILL_BECOME_VALI=
D; // yellow
+                    } else {
+                        // is not valid
+                        statusLabel =3D TBP_UNKNOWN;
+                    }
+                }
+            }
+            if (!"".equals(statusLabel) && !TBP_VALID.equals(statusLabel))=
 {
+                item.setAttribute("displayImage",statusLabel);
+                final String contextPath =3D Jahia.getContextPath();
+                String actionURL =3D contextPath + "/ajaxaction/GetTimeBas=
edPublishingState?params=3D/op/edit/pid/" +
+                        jParams.getPageID() + "&key=3D" + contentObject.ge=
tObjectKey();
+                String serverURL =3D actionURL + "&displayDialog=3Dtrue";
+
+                String dialogTitle =3D JahiaResourceBundle.getEngineResour=
ce("org.jahia.engines.timebasedpublishing.dialogTitle",
+                        jParams, jParams.getLocale(), "Informational");
+                item.setAttribute("timeBasedPublishingActionURL",serverURL=
);
+                item.setAttribute("timeBasedPublishingDialogTitle",dialogT=
itle);
+                item.setAttribute("timeBasedPublishingPageId",String.value=
Of(jParams.getPageID()));
+            }
+        } catch (final Exception e) {
+            logger.error("Unable to process the request !", e);
+        }
+    }
+
     /**
      * Utility method to get a display Title for a ContentObject in a give=
n language
      *

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/en=
gine.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/engines/engine.jsp&rev=3D18030&repname=3D=
jahia
=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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/engine.j=
sp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/engine.j=
sp Wed Jul 18 15:18:09 2007
@@ -162,6 +162,7 @@
 <link rel=3D"stylesheet"
       href=3D"<jahia:serverHttpPath/><jahia:engineResourceBundle resourceN=
ame=3D"org.jahia.stylesheet.css"/>"
       type=3D"text/css"/>
+<link rel=3D"stylesheet" href=3D"<jahia:serverHttpPath/>/jsp/jahia/css/zim=
bra.css" type=3D"text/css"/>
 =

 <jahia:JSTools />
 =

@@ -316,6 +317,12 @@
     function handleOnLoad() {
           if (workInProgress && !workInProgress.closed) workInProgress.clo=
se();  =

           setTimeout("checkParent()", checkParentTimeOut);
+          engineCustomHandleOnLoad();
+    }
+    =

+    =

+    function engineCustomHandleOnLoad(){
+      // should be overriden by sub engine for specific onload code    =

     }
 =

     function closeTheWindow() {
@@ -348,6 +355,7 @@
 </head>
 =

 <body>
+<div id=3D"userShell">
 <div id=3D"wrapper"><!-- wrapper -->
     <form name=3D"mainForm" method=3D"post" action=3D"<%=3DengineUrl%>">
         <%
@@ -406,5 +414,6 @@
     </div>
     </form>
 </div> <!-- end wrapper -->
+</div>
 </body>
 </html>
\ No newline at end of file

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/se=
lectpage/select_page.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/engines/selectpage/select_page.jsp&rev=3D=
18030&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/selectpa=
ge/select_page.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/selectpa=
ge/select_page.jsp Wed Jul 18 15:18:09 2007
@@ -19,19 +19,54 @@
 <%@ page import=3D"org.jahia.data.viewhelper.sitemap.FlatSiteMapViewHelper=
" %>
 <%@ page import=3D"org.jahia.data.viewhelper.sitemap.SiteMapViewHelper" %>
 <%@ page import=3D"org.jahia.engines.selectpage.SelectPage_Engine" %>
-<%@ page import=3D"org.jahia.params.ParamBean" %>
+<%@ page import=3D"org.jahia.params.*" %>
 <%@ page import=3D"org.jahia.resourcebundle.JahiaResourceBundle" %>
 <%@ page import=3D"org.jahia.services.pages.ContentPage" %>
 <%@ page import=3D"org.jahia.taglibs.ajax.ComplexTreeInclude"%>
 <%@ page import=3D"org.jahia.utils.JahiaTools"%>
 <%@ page import=3D"javax.servlet.http.HttpSession"%>
-<%@ page import=3D"java.util.HashMap"%>
+<%@ page import=3D"java.util.*"%>
+<%@ page import=3D"java.io.*" %>
+<%@ page import=3D"org.jahia.content.ContentObject" %>
+<%@ page import=3D"org.jahia.registries.ServicesRegistry"%>
+<%@ page import=3D"org.jahia.engines.EngineLanguageHelper"%>
+<%@ page import=3D"org.jahia.resourcebundle.JahiaResourceBundle"%>
+<%@ page import=3D"org.jahia.hibernate.manager.JahiaObjectDelegate"%>
+<%@ page import=3D"org.jahia.hibernate.manager.JahiaObjectManager"%>
+<%@ page import=3D"org.jahia.hibernate.manager.SpringContextSingleton"%>
+<%@ page import=3D"org.jahia.services.timebasedpublishing.*"%>
 =

 <%@ taglib uri=3D"JahiaLib" prefix=3D"jahia" %>
+<%@ taglib uri=3D"contentLib" prefix=3D"content" %>
 <%@ taglib uri=3D"ajaxLib" prefix=3D"ajax" %>
 <%!
   private static final org.apache.log4j.Logger logger =3D
             org.apache.log4j.Logger.getLogger("jsp.jahia.engines.selectpag=
e.select_page");
+
+  private void drawTimeBasedPublishingStatusIcon(ContentObject contentObje=
ct, ProcessingContext jParams, PageContext pageContext)
+  throws IOException  {
+    JspWriter out =3D pageContext.getOut();
+    final String contextPath =3D Jahia.getContextPath();
+    final String actionURL =3D contextPath + "/ajaxaction/GetTimeBasedPubl=
ishingState?params=3D/op/edit/pid/" +
+            jParams.getPageID() + "&key=3D" + contentObject.getObjectKey();
+
+    String serverURL =3D actionURL + "&displayDialog=3Dtrue";
+    String dialogTitle =3D JahiaResourceBundle.getEngineResource("org.jahi=
a.engines.timebasedpublishing.dialogTitle",
+            jParams, jParams.getLocale(), "Informational");
+    StringBuffer cmdBuffer =3D new StringBuffer("handleTimeBasedPublishing=
(event,'");
+    cmdBuffer.append(serverURL).append("','");
+    cmdBuffer.append(contentObject.getObjectKey()).append("',").append("'/=
op/edit/pid/")
+            .append(jParams.getPageID()).append("','").append(dialogTitle)=
.append("')");
+    out.print("<img class=3D\"timeBasedPublishingState\" id=3D\"");
+    out.print("img_");
+    out.print(contentObject.getObjectKey());
+    out.print("\" border=3D\"0\" src=3D\"");
+    out.print(actionURL);
+    out.print("\" onClick=3D\"");
+    out.print(cmdBuffer.toString());
+    out.print("\" />\n");
+  }
+
 %>
 <%
     final HashMap selectedPageParams =3D (HashMap) session.getAttribute(Se=
lectPage_Engine.SESSION_PARAMS);
@@ -72,6 +107,25 @@
 %>
 =

 <script type=3D"text/javascript">
+
+    function showUserShell(){
+      try {
+        Dwt.setVisibility(document.getElementById("userShell"),true);
+      } catch (ex){
+        return;
+      }
+    }
+
+    function engineCustomHandleOnLoad(){
+      if ( AjxEnv.isIE ){
+        initZimbraShell('MainShell',true,null,null,true,false,'#dddddd');
+      } else {
+      initZimbraShell('MainShell',true,null,'userShell',true,false,'#ddddd=
d');
+      }
+      showUserShell();
+    }
+    =

+    =

     function handleActionChanges(param) {
         saveContent();
         document.mainForm.action +=3D "?screen=3D" + param;
@@ -80,6 +134,7 @@
 =

      window.onunload =3D removeAll;
 </script>
+<script language=3D"javascript" src=3D"<content:serverHttpPath/>/jsp/jahia=
/javascript/zimbra/timebasedpublishing/TimeBasedPublishingStatus.js" type=
=3D"text/javascript"></script>
 =

 <!--
 <input type=3D"hidden" name=3D"<%=3DSelectPage_Engine.PAGE_ID%>"          =
value=3D"<%=3DpageID%>" />
@@ -279,7 +334,7 @@
         if (flatJahiaSiteMap.getPageID(i) =3D=3D jParams.getPageID()) {
             style +=3D " font-weight: bold;";
         } %><span style=3D"<%=3Dstyle%>"
-            ><%=3DJahiaTools.replacePattern(pageTitle, " ", "&nbsp;") %></=
span><%
+            ><%drawTimeBasedPublishingStatusIcon((ContentObject)ContentPag=
e.getPage(flatJahiaSiteMap.getPageID(i)),jParams,pageContext);%>&nbsp;<%=3D=
JahiaTools.replacePattern(pageTitle, " ", "&nbsp;") %></span><%
         // end write page title ----------------------------------------
         // Indicate parent page ----------------------------------------
         if (parentPageID =3D=3D flatJahiaSiteMap.getPageID(i)) {

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/sh=
ared/page_field.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/engines/shared/page_field.jsp&rev=3D18030=
&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/p=
age_field.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/engines/shared/p=
age_field.jsp Wed Jul 18 15:18:09 2007
@@ -16,6 +16,7 @@
 limitations under the License.
 --%><%@ page language=3D"java" contentType=3D"text/html;charset=3DUTF-8" %>
 <%@ page import=3D"org.apache.commons.lang.StringUtils" %>
+<%@ page import=3D"org.jahia.bin.Jahia" %>
 <%@ page import=3D"org.jahia.data.JahiaData" %>
 <%@ page import=3D"org.jahia.data.containers.JahiaContainer" %>
 <%@ page import=3D"org.jahia.data.fields.JahiaField" %>
@@ -24,18 +25,26 @@
 <%@ page import=3D"org.jahia.engines.shared.JahiaPageEngineTempBean" %>
 <%@ page import=3D"org.jahia.engines.shared.Page_Field" %>
 <%@ page import=3D"org.jahia.engines.validation.EngineValidationHelper" %>
-<%@ page import=3D"org.jahia.params.ParamBean" %>
+<%@ page import=3D"org.jahia.params.*" %>
 <%@ page import=3D"org.jahia.services.pages.ContentPage" %>
+<%@ page import=3D"org.jahia.content.ContentObject" %>
 <%@ page import=3D"org.jahia.services.pages.JahiaPage" %>
 <%@ page import=3D"org.jahia.services.pages.JahiaPageBaseService" %>
 <%@ page import=3D"org.jahia.services.pages.JahiaPageDefinition" %>
 =

 <%@ page import=3D"org.jahia.utils.JahiaTools" %>
 <%@ page import=3D"java.util.*" %>
+<%@ page import=3D"java.io.*" %>
 <%@ page import=3D"org.jahia.registries.ServicesRegistry"%>
 <%@ page import=3D"org.jahia.engines.EngineLanguageHelper"%>
+<%@ page import=3D"org.jahia.resourcebundle.JahiaResourceBundle"%>
+<%@ page import=3D"org.jahia.hibernate.manager.JahiaObjectDelegate"%>
+<%@ page import=3D"org.jahia.hibernate.manager.JahiaObjectManager"%>
+<%@ page import=3D"org.jahia.hibernate.manager.SpringContextSingleton"%>
+<%@ page import=3D"org.jahia.services.timebasedpublishing.*"%>
 <%@ taglib uri=3D"JahiaLib" prefix=3D"jahia" %>
-
+<%@ taglib uri=3D"contentLib" prefix=3D"content" %>
+<%@ taglib uri=3D"ajaxLib" prefix=3D"ajax" %>
 <%!
     private static final org.apache.log4j.Logger logger =3D
             org.apache.log4j.Logger.getLogger("jsp.jahia.engines.shared.Pa=
ge_Field");
@@ -54,6 +63,30 @@
         }
         return vlist;
     }
+    =

+    private void drawTimeBasedPublishingStatusIcon(ContentObject contentOb=
ject, ProcessingContext jParams, PageContext pageContext)
+    throws IOException  {
+      JspWriter out =3D pageContext.getOut();
+      final String contextPath =3D Jahia.getContextPath();
+      final String actionURL =3D contextPath + "/ajaxaction/GetTimeBasedPu=
blishingState?params=3D/op/edit/pid/" +
+              jParams.getPageID() + "&key=3D" + contentObject.getObjectKey=
();
+
+      String serverURL =3D actionURL + "&displayDialog=3Dtrue";
+      String dialogTitle =3D JahiaResourceBundle.getEngineResource("org.ja=
hia.engines.timebasedpublishing.dialogTitle",
+              jParams, jParams.getLocale(), "Informational");
+      StringBuffer cmdBuffer =3D new StringBuffer("handleTimeBasedPublishi=
ng(event,'");
+      cmdBuffer.append(serverURL).append("','");
+      cmdBuffer.append(contentObject.getObjectKey()).append("',").append("=
'/op/edit/pid/")
+              .append(jParams.getPageID()).append("','").append(dialogTitl=
e).append("')");
+      out.print("<img class=3D\"timeBasedPublishingState\" id=3D\"");
+      out.print("img_");
+      out.print(contentObject.getObjectKey());
+      out.print("\" border=3D\"0\" src=3D\"");
+      out.print(actionURL);
+      out.print("\" onClick=3D\"");
+      out.print(cmdBuffer.toString());
+      out.print("\" />\n");
+    }
 %>
 =

 <%
@@ -224,7 +257,39 @@
             !Page_Field.UPDATE_PAGE.equals(pageBean.getOperation()) ? true=
 : false;
 %>
 =

+<ajax:zimbraInclude/>
+<script language=3D"javascript" src=3D"<content:serverHttpPath/>/jsp/jahia=
/javascript/zimbra/timebasedpublishing/TimeBasedPublishingStatus.js" type=
=3D"text/javascript"></script>
 <script type=3D"text/javascript">
+function showUserShell(){
+  try {
+    Dwt.setVisibility(document.getElementById("userShell"),true);
+  } catch (ex){
+    return;
+  }
+}
+
+function engineCustomHandleOnLoad(){
+  if ( AjxEnv.isIE ){
+    initZimbraShell('MainShell',true,null,null,true,false,'#dddddd');
+  } else {
+    initZimbraShell('MainShell',true,null,'userShell',true,false,'#dddddd'=
);
+  }
+  showUserShell();
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x =3D el.offsetLeft-5;
+  if (el.offsetParent !=3D null)
+    x +=3D getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
 function callSelectPageMove() {
     // Inhibate the engine pop up close
 <%=3DjData.gui().html().drawSelectPageLauncher(SelectPage_Engine.MOVE_OPER=
ATION,
@@ -534,7 +599,7 @@
             if (Page_Field.LINK_JAHIA_PAGE.equals(pageBean.getOperation())=
) {
                 if (sourcePageID !=3D -1) { %>
         <ul>
-            <li><%=3DJahiaTools.text2html(sourceTitle)%>&nbsp;(<jahia:engi=
neResourceBundle
+            <li><%drawTimeBasedPublishingStatusIcon((ContentObject)Content=
Page.getPage(sourcePageID),jParams,pageContext);%>&nbsp;<%=3DJahiaTools.tex=
t2html(sourceTitle)%>&nbsp;(<jahia:engineResourceBundle
                     resourceName=3D"org.jahia.pageId.label"/>:&nbsp;<%=3Ds=
ourcePageID%>)</li>
         </ul>
         <% } else { %>

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript=
/jahia.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/javascript/jahia.js&rev=3D18030&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/jahia=
.js (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/jahia=
.js Wed Jul 18 15:18:09 2007
@@ -729,4 +729,30 @@
     d =3D null;
 }
 =

+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x =3D el.offsetLeft;
+  if (el.offsetParent !=3D null)
+    x +=3D getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y =3D el.offsetTop;
+  if (el.offsetParent !=3D null)
+    y +=3D getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+
 window.onunload =3D closeEngineWinAllPopups;

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript=
/zimbra/complexTree/ComplexTree.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbra/complexTree/ComplexTree=
.js&rev=3D18030&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTree.js (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTree.js Wed Jul 18 15:18:09 2007
@@ -1191,6 +1191,35 @@
         }
         delete lockedUrl;
 =

+    } else if (currentStyle =3D=3D ComplexTreeProperties.SELECT_PAGE_STYLE=
) {
+        var displayImage =3D XmlUtils.getAttrValue(pageInfo, this._props.C=
URRENT_XML_TAG_NAME, "displayImage");
+        if (displayImage) {
+            _keys.add("displayImage");
+            result.displayImage =3D displayImage;
+        }
+        delete displayImage;
+
+        var actionURL =3D XmlUtils.getAttrValue(pageInfo, this._props.CURR=
ENT_XML_TAG_NAME, "timeBasedPublishingActionURL");
+        if (actionURL) {
+            _keys.add("timeBasedPublishingActionURL");
+            result.timeBasedPublishingActionURL =3D actionURL;
+        }
+        delete actionURL;
+
+        var dialogTitle =3D XmlUtils.getAttrValue(pageInfo, this._props.CU=
RRENT_XML_TAG_NAME, "timeBasedPublishingDialogTitle");
+        if (actionURL) {
+            _keys.add("timeBasedPublishingDialogTitle");
+            result.timeBasedPublishingDialogTitle =3D dialogTitle;
+        }
+        delete dialogTitle;
+
+        var pageId =3D XmlUtils.getAttrValue(pageInfo, this._props.CURRENT=
_XML_TAG_NAME, "timeBasedPublishingPageId");
+        if (actionURL) {
+            _keys.add("timeBasedPublishingPageId");
+            result.timeBasedPublishingPageId =3D pageId;
+        }
+        delete pageId;
+
     } else if (currentStyle =3D=3D ComplexTreeProperties.ADMIN_CATEGORY_ST=
YLE) {
         var add =3D XmlUtils.getAttrValue(pageInfo, this._props.CURRENT_XM=
L_TAG_NAME, "add");
         if (add) {

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript=
/zimbra/complexTree/ComplexTreeProperties.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbra/complexTree/ComplexTree=
Properties.js&rev=3D18030&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
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTreeProperties.js (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/javascript/zimbr=
a/complexTree/ComplexTreeProperties.js Wed Jul 18 15:18:09 2007
@@ -83,6 +83,14 @@
 ComplexTreeProperties.MOVE_CATEGORY =3D 18;
 ComplexTreeProperties.DELETE_CATEGORY =3D 19;
 =

+// Time based publishing states
+ComplexTreeProperties.EXPIRED_BUT_WILL_BECOME_VALID =3D 20;
+ComplexTreeProperties.EXPIRED =3D 21;
+ComplexTreeProperties.VALID_BUT_WILL_EXPIRE =3D 22;
+ComplexTreeProperties.VALID =3D 23;
+ComplexTreeProperties.NOT_VALID_BUT_WILL_BECOME_VALID =3D 24;
+ComplexTreeProperties.UNKNOWN =3D 25;
+
 // Define the state images. Don't forget to append the contextPath to the =
icone source paths
 ComplexTreeProperties.ACTIVE_ICONE_SRC =3D "/jsp/jahia/engines/images/icon=
s/workflow/state_active.gif";
 ComplexTreeProperties.WAITING_ICONE_SRC =3D "/jsp/jahia/engines/images/ico=
ns/workflow/state_waiting.gif";
@@ -106,6 +114,15 @@
 ComplexTreeProperties.N_STEP =3D "/jsp/jahia/javascript/zimbra/complexTree=
/ngear.gif";
 ComplexTreeProperties.NO_WFLOW =3D "/jsp/jahia/javascript/zimbra/complexTr=
ee/gear_forbidden.gif";
 =

+// Time based publishing images
+ComplexTreeProperties.EXPIRED_BUT_WILL_BECOME_VALID_SRC =3D "/jsp/jahia/en=
gines/images/icons/timebasedpublishing/yellow_clock.gif";
+ComplexTreeProperties.EXPIRED_SRC =3D "/jsp/jahia/engines/images/icons/tim=
ebasedpublishing/red_clock.gif";
+ComplexTreeProperties.VALID_BUT_WILL_EXPIRE_SRC =3D "/jsp/jahia/engines/im=
ages/icons/timebasedpublishing/orange_clock.gif";
+ComplexTreeProperties.VALID_SRC =3D "/jsp/jahia/engines/images/icons/timeb=
asedpublishing/valid_clock.gif";
+ComplexTreeProperties.NOT_VALID_BUT_WILL_BECOME_VALID_SRC =3D "/jsp/jahia/=
engines/images/icons/timebasedpublishing/yellow_clock.gif";
+ComplexTreeProperties.UNKNOWN_SRC =3D "/jsp/jahia/engines/images/icons/tim=
ebasedpublishing/grey_clock.gif";
+
+
 // SiteMap
 ComplexTreeProperties.EXISTING =3D "/jsp/jahia/javascript/zimbra/complexTr=
ee/check.gif";
 =

@@ -187,7 +204,7 @@
 ComplexTreeProperties.SITEMAP_TREE_STYLE_PATTERN =3D [ComplexTreePropertie=
s.KEY, ComplexTreeProperties.ID, ComplexTreeProperties.LINK_SAME_PAGE];
 ComplexTreeProperties.SITEMAP_LIST_STYLE_PATTERN =3D [[ComplexTreeProperti=
es.IMAGE_LINK_SAME_PAGE, ComplexTreeProperties.BLANK]];
 =

-ComplexTreeProperties.SELECT_TREE_STYLE_PATTERN =3D [ComplexTreeProperties=
.KEY, ComplexTreeProperties.SELECT_RADIO, ComplexTreeProperties.ID, Complex=
TreeProperties.LINK];
+ComplexTreeProperties.SELECT_TREE_STYLE_PATTERN =3D [ComplexTreeProperties=
.KEY, ComplexTreeProperties.SELECT_RADIO, ComplexTreeProperties.ID, Complex=
TreeProperties.SELECT_PAGE_STYLE, ComplexTreeProperties.SPACE, ComplexTreeP=
roperties.LINK];
 ComplexTreeProperties.SELECT_LIST_STYLE_PATTERN =3D [];
 =

 ComplexTreeProperties.VERSIONNING_TREE_STYLE_PATTERN =3D [ComplexTreePrope=
rties.KEY, ComplexTreeProperties.ID, ComplexTreeProperties.LINK];
@@ -332,6 +349,24 @@
         case ComplexTreeProperties.DELETE_CATEGORY:
             return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.D=
ELETE_CATEGORY_SRC;
 =

+        case ComplexTreeProperties.EXPIRED_BUT_WILL_BECOME_VALID:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.E=
XPIRED_BUT_WILL_BECOME_VALID_SRC;
+
+        case ComplexTreeProperties.EXPIRED:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.E=
XPIRED_SRC;
+
+        case ComplexTreeProperties.VALID:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.V=
ALID_SRC;
+
+        case ComplexTreeProperties.VALID_BUT_WILL_EXPIRE:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.V=
ALID_BUT_WILL_EXPIRE_SRC;
+
+        case ComplexTreeProperties.NOT_VALID_BUT_WILL_BECOME_VALID:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.N=
OT_VALID_BUT_WILL_BECOME_VALID_SRC;
+
+        case ComplexTreeProperties.UNKNOWN:
+            return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.U=
NKNOWN_SRC;
+
         case -3:
             ComplexTreeProperties.Error =3D true;
             return ComplexTreeProperties.CONTEXT + ComplexTreeProperties.P=
IX_SRC;
@@ -373,6 +408,7 @@
         case ComplexTreeProperties.SELECTED_FILE:
             return 2;
 =

+        case ComplexTreeProperties.SELECT_PAGE_STYLE:
         case ComplexTreeProperties.FILE_IMAGE:
         case ComplexTreeProperties.IMAGE_LINK:
         case ComplexTreeProperties.IMAGE_LINK_SAME_PAGE:
@@ -524,6 +560,12 @@
                 }
             }
 =

+        case ComplexTreeProperties.SELECT_PAGE_STYLE:
+            if (objectInfo.displayImage) {
+                return [ComplexTreeProperties.getTimeBasedPublishingLaunch=
er(objectInfo), objectInfo.displayImage, objectInfo.key];
+            }
+            return [null, null,null];
+
         case ComplexTreeProperties.W_FLOW_TYPE:
             if (ComplexTreeProperties.activeTab) {
                 if (objectInfo.activeTab && objectInfo.activeTab !=3D Comp=
lexTreeProperties.activeTab && objectInfo.displayImage) {
@@ -820,6 +862,13 @@
             return "<a href=3D\"" + data[0] + "\"><img src=3D'" + ComplexT=
reeProperties.getImageSrc(image) +
                    "' title=3D'" + data[2] + "' alt=3D'" + data[2] + "' bo=
rder=3D'0' /></a>";
 =

+        case ComplexTreeProperties.SELECT_PAGE_STYLE:
+        //DBG.println("W_FLOW_TYPE: " + data[0] + ", " + data[1] + ", " + =
data[2]);
+            var image =3D parseInt(data[1], 10);
+            if (!image || !data[0]) return "";
+            return "<img src=3D'" + ComplexTreeProperties.getImageSrc(imag=
e) + "' id=3D'img_" + data[2] +
+                   "' title=3D'" + data[2] + "' alt=3D'" + data[2] + "' bo=
rder=3D'0' " + " onClick=3D\""+data[0]+"\" />";
+
         case ComplexTreeProperties.LINK:
         //DBG.println("LINK: " + data[0] + ", " + data[1]);
             if (data[0][1]) {
@@ -974,3 +1023,17 @@
 function (param, objectKey) {
     return "javascript:handleActionChanges('display&display=3D" + param + =
"&obj=3D" + objectKey + "');";
 }
+
+ComplexTreeProperties.getTimeBasedPublishingLauncher =3D
+function (objectInfo) {
+    var launcher =3D "handleTimeBasedPublishing(event,'";
+    launcher+=3DobjectInfo.timeBasedPublishingActionURL;
+    launcher+=3D"','";
+    launcher+=3DobjectInfo.key;
+    launcher+=3D"','/op/edit/pid/";
+    launcher+=3DobjectInfo.timeBasedPublishingPageId;
+    launcher+=3D"','";
+    launcher+=3DobjectInfo.timeBasedPublishingDialogTitle;
+    launcher+=3D"');";
+    return launcher;
+}

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

Reply via email to