incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r225689 - in /incubator/graffito/trunk/applications/browser/src: java/org/apache/portals/graffito/portlets/browser/actions/ java/org/apache/portals/graffito/portlets/browser/dto/ webapp/WEB-INF/velocity/ webapp/WEB-INF/view/document/ webapp...
Date Thu, 28 Jul 2005 05:33:20 GMT
Author: clombart
Date: Wed Jul 27 22:33:07 2005
New Revision: 225689

URL: http://svn.apache.org/viewcvs?rev=225689&view=rev
Log:
Review object model (see GRFT-25)

Modified:
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-metadata.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-text.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-text-html.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-upload.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-browser.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-children.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-metadata.vm

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
Wed Jul 27 22:33:07 2005
@@ -19,10 +19,10 @@
 import javax.portlet.ActionRequest;
 import javax.portlet.PortletException;
 
-import org.apache.portals.graffito.ContentModelService;
 import org.apache.portals.graffito.exception.ContentManagementException;
 import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
 import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.services.core.ContentModelService;
 
 /**
  * Portlet Action used to manage all common action on Cms object like delete, ...

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
Wed Jul 27 22:33:07 2005
@@ -27,10 +27,9 @@
 import javax.portlet.RenderResponse;
 
 import org.apache.commons.fileupload.FileItem;
-import org.apache.portals.graffito.ContentModelService;
-import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
-import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.core.Folder;
+import org.apache.portals.graffito.model.dm.Document;
 import org.apache.portals.graffito.portlets.bean.BeanUtil;
 import org.apache.portals.graffito.portlets.browser.BrowserPortlet;
 import org.apache.portals.graffito.portlets.browser.dto.DocumentDTO;
@@ -41,6 +40,9 @@
 import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
 import org.apache.portals.graffito.portlets.upload.PortletDiskFileUpload;
 import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.services.core.ContentModelService;
+import org.apache.portals.graffito.services.core.ContentServerService;
+import org.apache.portals.graffito.services.dm.DocumentModelService;
 import org.apache.portals.graffito.util.UriUtil;
 
 /**
@@ -61,7 +63,7 @@
             RenderResponse response = (RenderResponse) actionInfo.getResponse();
             PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
 
-            ContentModelService modelService = ServiceUtil.getModelService();
+            DocumentModelService modelService = ServiceUtil.getDocumentService();
             ContentServerService serverService = ServiceUtil.getServerService();
             response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
             
@@ -111,6 +113,7 @@
             PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
 
             ContentModelService modelService = ServiceUtil.getModelService();
+            DocumentModelService documentService = ServiceUtil.getDocumentService();
             ContentServerService serverService = ServiceUtil.getServerService();
             
             response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
@@ -121,13 +124,11 @@
             // First step in the wizard : init the document
             if (document == null)
             {
-                org.apache.portals.graffito.model.Folder parentFolder = modelService.getFolder(parentUri);
-                document = modelService.createDocument();
+                Folder parentFolder = modelService.getFolder(parentUri);
+                document = documentService.createDocument();
                 document.setParentFolder(parentFolder);
             }
             
-            
-            
             // Init the path DTO 
             PathDTO pathDTO =  new PathDTO();
             String scopeServer = UriUtil.getServerScope(parentUri);
@@ -159,12 +160,15 @@
         ActionRequest request = (ActionRequest) actionInfo.getRequest();
         ActionResponse response = (ActionResponse) actionInfo.getResponse();
         PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
-
-        ContentModelService modelService = ServiceUtil.getModelService();
+        
         BrowserSession browserSession = SessionUtil.getBrowserSession(request);
 
         Document document = (Document) SessionUtil.getWizardInfo(request);
         BeanUtil.populate(request, document);
+        document.setProperty("title", request.getParameter("title"));
+        document.setProperty("description", request.getParameter("description"));
+        document.setProperty("owner", request.getParameter("owner"));
+        
         document.setCreationDate(new Timestamp(System.currentTimeMillis()));
         document.setLastModified(new Timestamp(System.currentTimeMillis()));
         document.setUri(browserSession.getUri() + "/" + document.getName());
@@ -201,7 +205,7 @@
             ActionRequest request = (ActionRequest) actionInfo.getRequest();
             ActionResponse response = (ActionResponse) actionInfo.getResponse();
             PortletPageManager portletPageManager = actionInfo.getPortletPageManager(); 
    
-
+            DocumentModelService documentService = ServiceUtil.getDocumentService();
             BrowserSession browserSession = SessionUtil.getBrowserSession(request);
             Document document = (Document) browserSession.getWizardInfo();
             
@@ -211,17 +215,17 @@
             {
                 try
                 {
-                    document.getContent().setContent(documentContent.getBytes(request.getCharacterEncoding()));
-                    document.getContent().setEncoding(request.getCharacterEncoding());
+                    document.getDocumentStream().setContent(documentContent.getBytes(request.getCharacterEncoding()));
+                    document.getDocumentStream().setEncoding(request.getCharacterEncoding());
                 }
                 catch (UnsupportedEncodingException e)
                 {
-                    document.getContent().setContent(documentContent.getBytes());
+                    document.getDocumentStream().setContent(documentContent.getBytes());
                 }
                 document.setSize(documentContent.length());
             }
-            ContentModelService modelService = ServiceUtil.getModelService();
-            modelService.addDocument(document);
+            
+            documentService.addDocument(document);
             portletPageManager.setSelectedEditPageId(request, "folderEdit");
             SessionUtil.setOperation(request, null);
                         
@@ -241,29 +245,34 @@
             ActionRequest request = (ActionRequest) actionInfo.getRequest();
             ActionResponse response = (ActionResponse) actionInfo.getResponse();
             PortletPageManager portletPageManager = actionInfo.getPortletPageManager(); 
    
-
+            DocumentModelService documentService = ServiceUtil.getDocumentService();
+            
             BrowserSession browserSession = SessionUtil.getBrowserSession(request);
-            ContentModelService modelService = ServiceUtil.getModelService();
+            
             String uri = this.getUri(request);
-            Document document = modelService.getDocument(uri);
+            Document document = documentService.getDocument(uri);
             
             BeanUtil.populate(request, document);
+            document.setProperty("title", request.getParameter("title"));
+            document.setProperty("description", request.getParameter("description"));
+            document.setProperty("owner", request.getParameter("owner"));
+            
             String documentContent = request.getParameter("documentContent");
             if (documentContent != null)
             {
                 try
                 {
-                    document.getContent().setContent(documentContent.getBytes(request.getCharacterEncoding()));
-                    document.getContent().setEncoding(request.getCharacterEncoding());
+                    document.getDocumentStream().setContent(documentContent.getBytes(request.getCharacterEncoding()));
+                    document.getDocumentStream().setEncoding(request.getCharacterEncoding());
                 }
                 catch (UnsupportedEncodingException e)
                 {
-                    document.getContent().setContent(documentContent.getBytes());
+                    document.getDocumentStream().setContent(documentContent.getBytes());
                 }
                 document.setSize(documentContent.length());
             }
             
-            modelService.updateDocument(document);
+            documentService.updateDocument(document);
 
                         
         }
@@ -283,7 +292,7 @@
             ActionResponse response = (ActionResponse) actionInfo.getResponse();
             PortletPageManager portletPageManager = actionInfo.getPortletPageManager(); 
         
             BrowserSession browserSession = SessionUtil.getBrowserSession(request);
-            ContentModelService modelService = ServiceUtil.getModelService();  
+            DocumentModelService documentService = ServiceUtil.getDocumentService();
             
             Document document = null;
             if (browserSession.isInsert())
@@ -292,27 +301,27 @@
             }
             else
             {
-                document = modelService.getDocument(browserSession.getUri());           
   
+                document = documentService.getDocument(browserSession.getUri());        
      
             }
             
             PortletDiskFileUpload diskFileUpload = actionInfo.getDiskFileUpload();
             diskFileUpload.setRepositoryPath(ServiceUtil.getUploadFolder());
             FileItem fileItem = diskFileUpload.getFileItem(request, "file");
             document.setContentType(fileItem.getContentType());
-            document.getContent().setContent(fileItem.get());
-            document.getContent().setEncoding(request.getCharacterEncoding());
+            document.getDocumentStream().setContent(fileItem.get());
+            document.getDocumentStream().setEncoding(request.getCharacterEncoding());
 
             document.setSize(fileItem.getSize());
                       
             if (browserSession.isInsert())
             {
-                modelService.addDocument(document);
+                documentService.addDocument(document);
                 portletPageManager.setSelectedEditPageId(request, "folderEdit");
                 SessionUtil.setOperation(request, null);
             }
             else
             {
-                modelService.updateDocument(document);
+                documentService.updateDocument(document);
             }
                         
             

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
Wed Jul 27 22:33:07 2005
@@ -22,10 +22,8 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-import org.apache.portals.graffito.ContentModelService;
-import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
-import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.model.core.Folder;
 import org.apache.portals.graffito.portlets.bean.BeanUtil;
 import org.apache.portals.graffito.portlets.browser.dto.FolderDTO;
 import org.apache.portals.graffito.portlets.browser.dto.PathDTO;
@@ -34,6 +32,8 @@
 import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
 import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
 import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.services.core.ContentModelService;
+import org.apache.portals.graffito.services.core.ContentServerService;
 import org.apache.portals.graffito.util.UriUtil;
 
 /**
@@ -75,7 +75,7 @@
             // Init the folder DTO
             FolderDTO folderDTO = new FolderDTO();            
             folderDTO.setFolder(folder);            
-            folderDTO.setDocuments(modelService.getDocuments(uri));
+            folderDTO.setContents(modelService.getContents(uri));
             folderDTO.setFolders(modelService.getFolders(uri));
             SessionUtil.setWizardInfo(request, null);
             portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO,
folderDTO);
@@ -117,7 +117,7 @@
                throw new PortletException("FolderDTO is not initialised");
             }
                                     
-            folderDTO.setDocuments(modelService.getDocuments(uri));
+            folderDTO.setContents(modelService.getContents(uri));
             folderDTO.setFolders(modelService.getFolders(uri));            
             portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO,
folderDTO);
             
@@ -188,6 +188,8 @@
 
                 Folder folder = modelService.createFolder();
                 BeanUtil.populate(request, folder);
+                folder.setProperty("title", request.getParameter("title"));
+                folder.setProperty("description", request.getParameter("description"));
                 folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
                 folder.setLastModified(new Timestamp(System.currentTimeMillis()));
                 
@@ -201,6 +203,9 @@
             {
                 Folder folder = modelService.getFolder(this.getUri(request));
                 BeanUtil.populate(request, folder);
+                folder.setProperty("title", request.getParameter("title"));
+                folder.setProperty("description", request.getParameter("description"));
+                
                 folder.setLastModified(new Timestamp(System.currentTimeMillis()));
                 modelService.updateFolder(folder);
             }

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
Wed Jul 27 22:33:07 2005
@@ -23,14 +23,9 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
-import org.apache.portals.graffito.ContentModelService;
-import org.apache.portals.graffito.ContentPermissionService;
-import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
-import org.apache.portals.graffito.model.CmsObject;
-import org.apache.portals.graffito.model.CmsPermission;
-import org.apache.portals.graffito.portlets.browser.BrowserPortlet;
+import org.apache.portals.graffito.model.core.CmsObject;
+import org.apache.portals.graffito.model.permission.CmsPermission;
 import org.apache.portals.graffito.portlets.browser.dto.PathDTO;
 import org.apache.portals.graffito.portlets.browser.dto.PermissionDTO;
 import org.apache.portals.graffito.portlets.browser.dto.PermissionsDTO;
@@ -39,8 +34,10 @@
 import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
 import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
 import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.services.core.ContentModelService;
+import org.apache.portals.graffito.services.core.ContentPermissionService;
+import org.apache.portals.graffito.services.core.ContentServerService;
 import org.apache.portals.graffito.util.UriUtil;
-import org.apache.velocity.context.Context;
 
 
 

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
Wed Jul 27 22:33:07 2005
@@ -14,10 +14,11 @@
 
 import java.util.ArrayList;
 
-import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.core.Content;
+import org.apache.portals.graffito.model.dm.Document;
 
 /**
- * Main information on the current folder object displayed in the Graffito Browser Portlet.
+ * Main information on the current document object displayed in the Graffito Browser Portlet.
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
@@ -44,10 +45,11 @@
     }
             
     
-    public Document getDocument()
+    public Content getDocument()
     {
         return document;
     }
+    
     public void setDocument(Document document)
     {
         this.document = document;
@@ -72,12 +74,12 @@
     
     public boolean isHTML()
     {
-        return (document.getContentType().equals("text/html"));
+        return (((Document)document).getContentType().equals("text/html"));
     }
 
     public boolean isText()
     {
-        return (document.getContentType().equals("text/plain"));
+        return (((Document)document).getContentType().equals("text/plain"));
     }
                     
     public boolean isBinary()

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
Wed Jul 27 22:33:07 2005
@@ -12,12 +12,9 @@
  */
 package org.apache.portals.graffito.portlets.browser.dto;
 
-import java.util.ArrayList;
 import java.util.Collection;
 
-
-import org.apache.portals.graffito.model.Folder;
-import org.apache.portals.graffito.model.Server;
+import org.apache.portals.graffito.model.core.Folder;
 
 /**
  * Main information on the current folder object displayed in the Graffito Browser Portlet.
@@ -34,7 +31,7 @@
     private Folder folder;
     
     /** Document children found in the current folder */ 
-    private Collection documents;
+    private Collection contents;
 
     /** Folder children found in the current folder */
     private Collection folders;
@@ -60,17 +57,17 @@
     /**
      * @return Returns the document children.
      */
-    public Collection getDocuments()
+    public Collection getContents()
     {
-        return documents;
+        return contents;
     }
 
     /**
      * @param documents The document children to set.
      */
-    public void setDocuments(Collection documents)
+    public void setContents(Collection documents)
     {
-        this.documents = documents;
+        this.contents = documents;
     }
 
     /**
@@ -111,7 +108,7 @@
      */
     public boolean isEmpty()
     {
-        if ((((documents == null) || (documents.size() == 0))) &&
+        if ((((contents == null) || (contents.size() == 0))) &&
             (((folders == null) || (folders.size() == 0)))) 
         {
             return true;

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
Wed Jul 27 22:33:07 2005
@@ -14,10 +14,9 @@
 
 import java.util.ArrayList;
 
-
-import org.apache.portals.graffito.model.CmsObject;
-import org.apache.portals.graffito.model.Folder;
-import org.apache.portals.graffito.model.Server;
+import org.apache.portals.graffito.model.core.CmsObject;
+import org.apache.portals.graffito.model.core.Folder;
+import org.apache.portals.graffito.model.server.Server;
 
 /**
  * This DTO is used to displat the path from the root folder to a selected cms object.

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java
Wed Jul 27 22:33:07 2005
@@ -14,8 +14,6 @@
 
 import java.security.Permissions;
 
-import org.apache.portals.graffito.model.CmsPermission;
-
 
 /**
  * Information on the current cms object permissions.

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm
Wed Jul 27 22:33:07 2005
@@ -187,17 +187,17 @@
    #end
 #end
 
-#macro (documentLink $document $graffitoTools $renderResponse)
+#macro (contentLink $content $graffitoTools $renderResponse)
 	
-	#if ($graffitoTools.requireGraffitoViewer($document))			
-		<a href="$graffitoTools.getViewerServlet()?uri=$document.getUri()">$document.getTitle()</a>
	
+	#if ($graffitoTools.requireGraffitoViewer($content))			
+		<a href="$graffitoTools.getViewerServlet()?uri=$content.getUri()">$content.getProperty("title")</a>
	
 	#else
-		<a href="$renderResponse.createActionURL()?uri=$document.getUri()&portletForward_documentHtmlTextViewer">$document.getTitle()</a>
+		<a href="$renderResponse.createActionURL()?uri=$content.getUri()&portletForward_documentHtmlTextViewer">$content.getProperty("title")</a>
 
 	#end		
-	<font class="portlet-font-dim"> by $document.getOwner()</font>
+	<font class="portlet-font-dim"> by $content.getProperty("owner")</font>
 	<br>
-	<font class="portlet-section-text">$document.getDescription()</font>
+	<font class="portlet-section-text">$content.getProperty("description")</font>
 	<br><br><br>
     
 #end

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-metadata.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-metadata.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-metadata.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-metadata.vm
Wed Jul 27 22:33:07 2005
@@ -41,9 +41,9 @@
 		#else	
  		   #formFieldText('field.name' "$!document.getName()" $MESSAGES $ERRORS)	
 		#end		
-        #formFieldInput('field.title' "$!document.getTitle()" "25" 'title' $MESSAGES $ERRORS)
-        #formFieldInput('field.description' "$!document.getDescription()" "50" 'description'
$MESSAGES $ERRORS)		
-        #formFieldInput('field.owner' "$!document.getOwner()" "25" 'owner' $MESSAGES $ERRORS)
			
+        #formFieldInput('field.title' "$!document.getProperty('title')" "25" 'title' $MESSAGES
$ERRORS)
+        #formFieldInput('field.description' "$!document.getProperty('description')" "50"
'description' $MESSAGES $ERRORS)		
+        #formFieldInput('field.owner' "$!document.getProperty('owner')" "25" 'owner' $MESSAGES
$ERRORS)				
 		#formFieldSelect('field.language' $documentDTO.getDocumentLanguages() 'language' $MESSAGES
$ERRORS )
 		
 		#if($browserSession.isInsert())

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-text.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-text.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-text.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-edit-text.vm
Wed Jul 27 22:33:07 2005
@@ -31,7 +31,7 @@
 #end
 
 <form action="$renderResponse.createActionURL()" method="post">
-	#formFieldTextArea($document.getContent().getContentAsString() "documentContent" $MESSAGES
$ERRORS)    
+	#formFieldTextArea($document.getDocumentStream().getContentAsString() "documentContent"
$MESSAGES $ERRORS)    
 	<div class="portlet-section-footer">
 		#if ($browserSession.isInsert())
   		    <input type="submit" name="portletAction_document.insert" value="Insert the document"
class="portlet-dlg-icon-label"/>		

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-text-html.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-text-html.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-text-html.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-text-html.vm
Wed Jul 27 22:33:07 2005
@@ -25,4 +25,4 @@
 
 <div class="portlet-menu">$MESSAGES.getString('div.path') #cmsPathLink($pathDTO.getServer()
$pathDTO.getPath() "folderViewer" $renderResponse $MESSAGES ) >> $document.getName()
</div>
 <br>
-$document.getContent().getContentAsString()
+$document.getDocumentStream().getContentAsString()

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-upload.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-upload.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-upload.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-view-upload.vm
Wed Jul 27 22:33:07 2005
@@ -27,5 +27,5 @@
 <div class="portlet-menu">$MESSAGES.getString('div.path') #cmsPathLink($pathDTO.getServer()
$pathDTO.getPath() "folderViewer" $renderResponse $MESSAGES ) >> $document.getName()
</div>
 
 In order to see the document, click on the following link :<br><br><br>
-#documentLink($document $graffitoTools $renderResponse)
+#contentLink($document $graffitoTools $renderResponse)
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-browser.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-browser.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-browser.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-browser.vm
Wed Jul 27 22:33:07 2005
@@ -48,10 +48,11 @@
 		<!-- /div -->
 	#end
 
-	#set ($documents = $folderDTO.getDocuments())	
-	#if($documents.size() > 0)	
-		#foreach ($document in $documents)			
-			#documentLink($document $graffitoTools $renderResponse)
+	#set ($contents = $folderDTO.getContents())	
+	#if($contents.size() > 0)	
+		#foreach ($content in $contents)	
+            		
+			#contentLink($content $graffitoTools $renderResponse)
 		#end	
 	#end
 #end

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-children.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-children.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-children.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-children.vm
Wed Jul 27 22:33:07 2005
@@ -22,11 +22,9 @@
 *#
 #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
 
-
-
 <form action="$renderResponse.createActionURL()" method="post">
 	#set ($folders = $folderDTO.getFolders())
-	#set ($documents = $folderDTO.getDocuments())
+	#set ($contents = $folderDTO.getContents())
 	#set ($count = 0)
 	#if($folderDTO.isEmpty())
 		<div class="portlet-msg-info">$MESSAGES.getString('info.nocontent')</div>
@@ -53,15 +51,15 @@
 				<td class="$cssClass"><input type="checkbox" name="uri" value="$folder.getUri()"
/></td>
 				<td class="$cssClass">$MESSAGES.getString('div.folder')</td>
 				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$folder.getUri()&portletForward_folderEdit=selected">$folder.getName()</a></td>
-				<td class="$cssClass">$folder.getTitle()</td>
-				<td class="$cssClass">$folder.getDescription()</td>
+				<td class="$cssClass">$folder.getProperty("title")</td>
+				<td class="$cssClass">$folder.getProperty("description")</td>
 				<td class="$cssClass">$!folder.getCreationDate()</td>
 				<td class="$cssClass">$!folder.getLastModified()</td>				
 			</tr>
 
 		#end
 		
-		#foreach ($document in $documents)
+		#foreach ($content in $contents)
 			#set ($count = $count + 1)
 			#set ($cssClass = "portlet-section-alternate")
 
@@ -69,13 +67,13 @@
 				#set ($cssClass = "portlet-section-body")
 			#end			
 			<tr>
-				<td class="$cssClass"><input type="checkbox" name="uri" value="$document.getUri()"
 /></td>
-				<td class="$cssClass">$document.getContentType() </td>		
-				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$document.getUri()&portletForward_documentEdit">$document.getName()</a></td>
-				<td class="$cssClass">$document.getTitle()</td>
-				<td class="$cssClass">$document.getDescription()</td>
-				<td class="$cssClass">$!document.getCreationDate()</td>
-				<td class="$cssClass">$!document.getLastModified()</td>								
+				<td class="$cssClass"><input type="checkbox" name="uri" value="$content.getUri()"
 /></td>
+				<td class="$cssClass">$!content.getContentType() </td>		
+				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$content.getUri()&portletForward_documentEdit">$content.getName()</a></td>
+				<td class="$cssClass">$content.getProperty("title")</td>
+				<td class="$cssClass">$content.getProperty("description")</td>
+				<td class="$cssClass">$!content.getCreationDate()</td>
+				<td class="$cssClass">$!content.getLastModified()</td>								
 			</tr>
 
 		#end

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-metadata.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-metadata.vm?rev=225689&r1=225688&r2=225689&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-metadata.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-metadata.vm
Wed Jul 27 22:33:07 2005
@@ -42,8 +42,8 @@
     		#else	
      		   #formFieldText('field.name' "$!folder.getName()" $MESSAGES $ERRORS)	
     		#end
-            #formFieldInput('field.title' "$!folder.getTitle()" "25" 'title' $MESSAGES $ERRORS)
-            #formFieldInput('field.description' "$!folder.getDescription()" "50" 'description'
$MESSAGES $ERRORS)		
+            #formFieldInput('field.title' "$!folder.getProperty('title')" "25" 'title' $MESSAGES
$ERRORS)
+            #formFieldInput('field.description' "$!folder.getProperty('description')" "50"
'description' $MESSAGES $ERRORS)		
     	</table>
     	<div class="portlet-section-footer">
     		<input type="submit" name="portletAction_folder.save" value="Save" class="portlet-dlg-icon-label"/>



Mime
View raw message