[jboss-svn-commits] JBoss Portal SVN: r5535 - in trunk/core/src: bin/portal-core-war/images/cms/admin resources/portal-core-war/WEB-INF/jsp/cms/admin

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Oct 31 14:46:17 EST 2006


Author: roy.russo at jboss.com
Date: 2006-10-31 14:46:14 -0500 (Tue, 31 Oct 2006)
New Revision: 5535

Modified:
   trunk/core/src/bin/portal-core-war/images/cms/admin/edit.gif
   trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp
Log:
JBPORTAL-1088 - Finished viewfile page changes

Modified: trunk/core/src/bin/portal-core-war/images/cms/admin/edit.gif
===================================================================
(Binary files differ)

Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp	2006-10-31 18:04:36 UTC (rev 5534)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp	2006-10-31 19:46:14 UTC (rev 5535)
@@ -6,6 +6,8 @@
 <%@ page import="org.jboss.portal.cms.model.Content,
                  org.jboss.portal.cms.util.NodeUtil" %>
 <%@ page import="org.jboss.portal.core.portlet.cms.admin.CMSAdminConstants" %>
+<%@ page import="java.text.Format" %>
+<%@ page import="java.text.SimpleDateFormat" %>
 <%@ page import="java.util.List" %>
 <%@ page import="java.util.StringTokenizer" %>
 <%@ page import="java.util.Vector" %>
@@ -13,132 +15,129 @@
 <portlet:defineObjects/>
 
 <%
-   String sCurrPath = (String) request.getAttribute("currpath");
-   Vector vContents = (Vector) request.getAttribute("contents");
+   String sCurrPath = (String)request.getAttribute("currpath");
+   Vector vContents = (Vector)request.getAttribute("contents");
    String sType = "";
-   if(vContents.size() > 0)
+   if (vContents.size() > 0)
    {
-      List contentList = (List) vContents.elementAt(0);
-      if(contentList.size() > 0)
+      List contentList = (List)vContents.elementAt(0);
+      if (contentList.size() > 0)
       {
-         Content content = (Content) contentList.get(0);
+         Content content = (Content)contentList.get(0);
          sType = content.getMimeType();
       }
    }
-   String sPreviewPath = (String) request.getAttribute("previewpath");
+   String sPreviewPath = (String)request.getAttribute("previewpath");
+
+   String createDate = "";
+   String modifiedDate = "";
 %>
 <br>
 
-<div align="center"><b>${n:i18n("TITLE_FILEBROWSE")}</b></div>
+Use the CMS Administration portlet to manage the content of your portal.
 
-<a href="<portlet:renderURL>
+<hr/>
+
+Browsing: <a href="<portlet:renderURL>
 <portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
 <portlet:param name="path" value="/"/>
-        </portlet:renderURL>">
-   <img align="absmiddle"
-        src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/folder_home.gif"
-        border="0"></a>
+        </portlet:renderURL>">Home</a>
 
 <%
    StringTokenizer parser = new StringTokenizer(sCurrPath, "/");
    String sPathBuilder = "";
-   while(parser.hasMoreTokens())
+   while (parser.hasMoreTokens())
    {
       String sPathChunk = parser.nextToken();
       sPathBuilder += "/" + sPathChunk;
-      if(parser.hasMoreTokens())
+      if (parser.hasMoreTokens())
       {
 %>
-:&nbsp;<a href="<portlet:renderURL>
+>&nbsp;<a href="
+<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
    <portlet:param name="path" value="<%= sPathBuilder %>"/>
-</portlet:renderURL>"><%= sPathChunk %></a>
+</portlet:renderURL>
+"><%= sPathChunk %></a>
 <%
 }
 else
 {
 %>
-:&nbsp;<%= sPathChunk %>
+>&nbsp;<%= sPathChunk %>
 <%
       }
    }
 %>
 
+<br/><br/>
 
-<table width="100%" border="0">
-   <tr>
-      <td colspan="3" class="portlet-section-header">${n:i18n("CMS_MENU")}</td>
-   </tr>
-   <tr>
-      <td align="left" class="portlet-section-alternate">
-         <%
-            if(sType.equals("text/html") || sType.equals("text/plain"))
-            {
-         %>
-         <a href="<portlet:renderURL>
+<!-- file-level action dropdown -->
+<div class="menu">
+   <ul>
+      <li><a href="#">Select Action <img
+         src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/downarrow.gif"
+         border="0"></a>
+         <ul>
+            <%
+               if (sType.equals("text/html") || sType.equals("text/plain"))
+               {
+            %>
+            <li><a href="<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_CREATENEWTEXT %>"/>
    <portlet:param name="path" value="<%= NodeUtil.getParentPath(sCurrPath) %>"/>
-   </portlet:renderURL>">
-            <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/edit.gif"
-                 alt="${n:i18n("CMS_EDIT")}" border="0">
-         </a>
-         <%
-         }
-         else
-         {
-         %>
-         <a href="<portlet:renderURL>
+   </portlet:renderURL>">${n:i18n("CMS_CREATE")}</a></li>
+            <%
+            }
+            else
+            {
+            %>
+            <li><a href="<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_UPLOADCONFIRM %>"/>
    <portlet:param name="path" value="<%= NodeUtil.getParentPath(sCurrPath) %>"/>
-   </portlet:renderURL>">
-            <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/edit.gif"
-                 alt="${n:i18n("CMS_EDIT")}" border="0">
-         </a>
-         <%
-            }
-         %>
-         <a href="<portlet:renderURL>
+   </portlet:renderURL>">${n:i18n("CMS_EDIT")}></a></li>
+            <%
+               }
+            %>
+            <li><a href="<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_CONFIRMCOPY %>"/>
    <portlet:param name="path" value="<%= sCurrPath %>"/>
    <portlet:param name="type" value="fi"/>
-   </portlet:renderURL>">
-            <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/copy.gif"
-                 alt="${n:i18n("CMS_COPY")}" border="0"></a>&nbsp;
-         <a href="<portlet:renderURL>
+   </portlet:renderURL>">${n:i18n("CMS_COPY")}</a></li>
+            <li><a href="<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_CONFIRMMOVE %>"/>
    <portlet:param name="path" value="<%= sCurrPath %>"/>
    <portlet:param name="type" value="fi"/>
-   </portlet:renderURL>">
-            <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/move.gif"
-                 alt="${n:i18n("CMS_MOVE")}" border="0"></a>&nbsp;
-         <a href="<portlet:renderURL>
+   </portlet:renderURL>">${n:i18n("CMS_MOVE")}</a></li>
+            <li><a href="<portlet:renderURL>
    <portlet:param name="op" value="<%= CMSAdminConstants.OP_CONFIRMDELETE %>"/>
    <portlet:param name="path" value="<%= sCurrPath %>"/>
-   </portlet:renderURL>">
-            <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/delete.gif"
-                 alt="${n:i18n("CMS_DELETE")}" border="0">
-         </a>
-      </td>
-   </tr>
-</table>
-<br>
+   </portlet:renderURL>">${n:i18n("CMS_DELETE")}</a></li>
+         </ul>
+      </li>
+   </ul>
+</div>
 
+<br/><br/>
+
 <table width="100%" border="0" cellspacing="2" cellpadding="2">
 <%
-   if(vContents.size() > 0)
+   if (vContents.size() > 0)
    {
-      for(int j = 0; j < vContents.size(); j++) // cycle thru list of content nodes
+      for (int j = 0; j < vContents.size(); j++) // cycle thru list of content nodes
       {
-         List contentList = (List) vContents.elementAt(j);
-         if(contentList.size() > 0)
+         List contentList = (List)vContents.elementAt(j);
+         if (contentList.size() > 0)
          {
-            Content content = (Content) contentList.get(0);
+            Content content = (Content)contentList.get(0);
 %>
-<tr><td height="10"></td></tr>
 <tr>
+   <td height="10"></td>
+</tr>
+<tr>
    <td colspan="8">
       <%
-         if(sType.equals("text/html") || sType.equals("text/plain"))
+         if (sType.equals("text/html") || sType.equals("text/plain"))
          {
       %>
       <a href="<portlet:renderURL>
@@ -166,17 +165,10 @@
          }
       %>
 
-      <%= content.getLocale().getDisplayLanguage() %></td>
+      <%= content.getLocale().getDisplayLanguage() %>
+   </td>
 </tr>
 <tr>
-   <%
-      if(sType.equals("text/html") || sType.equals("text/plain"))
-      {
-   %>
-   <td class="portlet-section-header">${n:i18n("CMS_EDIT")}</td>
-   <%
-      }
-   %>
    <td class="portlet-section-header">${n:i18n("CMS_TYPE")}</td>
    <td class="portlet-section-header">${n:i18n("CMS_SIZE")}</td>
    <td class="portlet-section-header">${n:i18n("CMS_VERSION")}</td>
@@ -185,13 +177,13 @@
    <td class="portlet-section-header">${n:i18n("CMS_TITLE")}</td>
 </tr>
 <%
-   for(int i = 0; i < contentList.size(); i++) // cycle thru list of version nodes
+   for (int i = 0; i < contentList.size(); i++) // cycle thru list of version nodes
    {
-      Content version = (Content) contentList.get(i);
+      Content version = (Content)contentList.get(i);
 %>
 <tr onmouseover="this.className='portlet-section-alternate';" onmouseout="this.className='portlet-section-body';">
    <%
-      if(sType.equals("text/html") || sType.equals("text/plain"))
+      if (sType.equals("text/html") || sType.equals("text/plain"))
       {
    %>
    <td>
@@ -204,15 +196,15 @@
          <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/edit.gif"
               alt="${n:i18n("CMS_EDIT")}" border="0">
       </a>
+      <%
+         }
+      %>
+      <%= version.getMimeType() %>
    </td>
-   <%
-      }
-   %>
-   <td><%= version.getMimeType() %></td>
    <td><%= version.getBytes().length / 1024 %>kb</td>
    <td>
       <%
-         if(sType.equals("text/html") || sType.equals("text/plain"))
+         if (sType.equals("text/html") || sType.equals("text/plain"))
          {
       %>
       <%= version.getVersionNumber() %>
@@ -221,10 +213,12 @@
       {
       %>
       <a target="_blank"
-         href="<%= request.getContextPath() %>/cmspreview?v=<%= version.getVersionNumber() %>&l=<%= content.getLocale().getLanguage() %>&p=<%= sCurrPath %>"><%= version.getVersionNumber() %></a>
+         href="<%= request.getContextPath() %>/cmspreview?v=<%= version.getVersionNumber() %>&l=<%= content.getLocale().getLanguage() %>&p=<%= sCurrPath %>"><%=
+         version.getVersionNumber() %>
+      </a>
       <%
          }
-         if(version.isLive())
+         if (version.isLive())
          {
       %>
       <img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/live.gif"
@@ -233,9 +227,30 @@
          }
       %>
    </td>
-   <td><%= version.getCreationDate() %></td>
-   <td><%= version.getLastModified() %>
-   <td><%= version.getTitle() %></td>
+   <td>
+      <%
+         if (version.getCreationDate() != null)
+         {
+            Format formatter;
+            formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+            createDate = formatter.format(version.getCreationDate());
+         }
+      %>
+      <%= createDate %>
+   </td>
+   <td>
+      <%
+         if (version.getLastModified() != null)
+         {
+            Format formatter;
+            formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+            modifiedDate = formatter.format(version.getLastModified());
+         }
+      %>
+      <%= modifiedDate %>
+   </td>
+   <td><%= version.getTitle() %>
+   </td>
 </tr>
 <%
             }




More information about the jboss-svn-commits mailing list