incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r154214 [1/10] - in incubator/graffito/trunk/applications: ./ browser/ browser/src/ browser/src/java/ browser/src/java/org/ browser/src/java/org/apache/ browser/src/java/org/apache/portals/ browser/src/java/org/apache/portals/graffito/ browser/src/java/org/apache/portals/graffito/portlets/ browser/src/java/org/apache/portals/graffito/portlets/resources/ browser/src/java/org/apache/portals/graffito/portlets/util/ browser/src/java/org/apache/portals/graffito/servlets/ browser/src/java/org/apache/portals/graffito/util/ browser/src/webapp/ browser/src/webapp/WEB-INF/ browser/src/webapp/WEB-INF/tabs/ browser/src/webapp/WEB-INF/velocity/ browser/src/webapp/WEB-INF/view/ browser/src/webapp/WEB-INF/view/document/ browser/src/webapp/WEB-INF/view/folder/ browser/src/webapp/WEB-INF/view/security/ browser/src/webapp/kupu/ browser/src/webapp/kupu/kupudrawers/ browser/src/webapp/kupu/kupudrawers/logos/ browser/src/webapp/kupu/kupuimages/ browser/src/webapp/kupu/kupupopups/
Date Thu, 17 Feb 2005 23:57:30 GMT
Author: clombart
Date: Thu Feb 17 15:57:09 2005
New Revision: 154214

URL: http://svn.apache.org/viewcvs?view=rev&rev=154214
Log:
1. Rename the project "portlets" into "applications"*
2. Add the Graffito viewer servlet which can be used for binary documents (PDF, Ms Office, ...)
3. Add upload features
4. Add the Kupu editor for XHTML documents.

Added:
    incubator/graffito/trunk/applications/
    incubator/graffito/trunk/applications/browser/
    incubator/graffito/trunk/applications/browser/.classpath
    incubator/graffito/trunk/applications/browser/.project
    incubator/graffito/trunk/applications/browser/maven.xml
    incubator/graffito/trunk/applications/browser/project.properties
    incubator/graffito/trunk/applications/browser/project.xml
    incubator/graffito/trunk/applications/browser/src/
    incubator/graffito/trunk/applications/browser/src/java/
    incubator/graffito/trunk/applications/browser/src/java/org/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/TabReader.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTab.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletDiskFileUpload.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUpload.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/servlets/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/servlets/GraffitoViewerServlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/util/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/util/GraffitoTools.java
    incubator/graffito/trunk/applications/browser/src/webapp/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/jetspeed-portlet.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/tabs/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/tabs/tabs.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/graffito-macros.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/toolbox.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/velocity-macros.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/velocity/velocity.properties
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-html-view.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/edit-tab-sample.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/
    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-detail.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/help.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/security/
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/security/security.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/tab.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/web.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/fulldoc.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupu.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupu.vm
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupubasetools.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupubeforeunload.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupublank.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupucnftable.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupucontentfilters.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupucontextmenu.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/allimages.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/drawer.xsl
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/imagelibrary.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/kupubuttons.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/linklibrary.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/bitflux_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/bitflux_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/bubnbros.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/bubnbros_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/codespeak_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/codespeak_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/diver_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/diver_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/eth_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/eth_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/infrae_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/infrae_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/kupu_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/kupu_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/lenya_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/lenya_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/opensource.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/opensource_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/oscom4_banner.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/oscom4_banner_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/oscom_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/oscom_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/plone_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/plone_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/pypy_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/pypy_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/silva_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/silva_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/twiki_logo.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/twiki_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/zea_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/zea_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/zope_logo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawers/logos/zope_logo_preview.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupudrawerstyles.css
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupueditor.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuform.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuhelpers.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/background-color.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/bgcolor.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/bold.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/bold.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/buttons.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/caret.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/centre.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/copy.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/create-new.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/cut.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/definitionlist.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/definitionlist.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/document.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/exit.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/exthyperlink.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/exthyperlink.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/folder.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/fonts.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/format.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/hr.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/hr.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/hyperlink.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/image.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/image.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/indent.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/indent.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/inthyperlink.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/inthyperlink.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/italic.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/italic.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/justify-center.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/justify-full.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/justify-left.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/justify-right.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/kupu_icon.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/kupulibrary.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/kupusearch_icon.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/larger-text.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/left_just.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/link.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/list.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/numbered.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/ordered-list.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/outdent.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/outdent.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/paste.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/redo-disabled.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/redo.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/redo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/remove.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/right_just.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/save.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/save.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/size.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/smaller-text.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/source.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/space.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/strikethrough.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/subscript.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/subscript.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/superscript.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/superscript.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/table.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/table.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/text-color.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/textcolor.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/toolbox.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/underline.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/underline.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/undo-disabled.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/undo.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/undo.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/unlink.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/unordered-list.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/view-source.png   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/zoom-in.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuimages/zoom-out.gif   (with props)
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_experimental.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_genericelements.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_multi.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinspector.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuloggers.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupumulti.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupumultieditor.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupupopups/
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupupopups/image.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupupopups/link.html
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupusaveonpart.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupusourceedit.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupustart.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupustart_form.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupustart_multi.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupustyles.css
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/sarissa.js

Added: incubator/graffito/trunk/applications/browser/.classpath
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/.classpath?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/.classpath (added)
+++ incubator/graffito/trunk/applications/browser/.classpath Thu Feb 17 15:57:09 2005
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<classpath>
+  <classpathentry excluding="" kind="src" path="src/java">
+  </classpathentry>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/graffito/jars/graffito-api-1.0-a1-dev.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/portlet-api/jars/portlet-api-1.0.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/jetspeed2/jars/jetspeed-commons-2.0-M2-dev.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/jetspeed2/jars/jetspeed-components-2.0-M2-dev.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/portals-bridges/jars/portals-bridges-common-0.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/portals-bridges/jars/portals-bridges-velocity-0.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/velocity/jars/velocity-1.4.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/velocity-tools/jars/velocity-tools-1.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-beanutils/jars/commons-beanutils-1.6.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-codec/jars/commons-codec-1.2.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-2.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-digester/jars/commons-digester-1.5.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-el/jars/commons-el-1.0.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar">
+  </classpathentry>
+  <classpathentry kind="output" path="target/classes">
+  </classpathentry>
+</classpath>
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/.project
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/.project?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/.project (added)
+++ incubator/graffito/trunk/applications/browser/.project Thu Feb 17 15:57:09 2005
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<projectDescription>
+  <name>graffito-browser</name>
+  <comment>Graffito Browser Portlet</comment>
+  <projects>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments>
+      </arguments>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/maven.xml?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/maven.xml (added)
+++ incubator/graffito/trunk/applications/browser/maven.xml Thu Feb 17 15:57:09 2005
@@ -0,0 +1,36 @@
+<project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define">
+	<!-- ================================================================  -->
+	<!-- Deploy                                                                                        -->
+	<!-- ================================================================ -->
+	<goal name="deploy">
+		<echo message="Deploy portal war into ${org.apache.jetspeed.deploy.war.dir}"/>
+		<j:set var="maven.build.dir" value="./target" />
+		<j:set var="maven.war.final.name" value="${pom.artifactId}.war" />
+		<attainGoal name="jetspeed2:deploy" />
+	</goal>
+	
+	<preGoal name="deploy">
+		<attainGoal name= "war:install"/>
+	</preGoal>
+	<goal name="undeploy">
+		<echo message="Undeploy ${org.apache.jetspeed.deploy.war.dir}jetspeed/WEB-INF/deploy/${pom.artifactId}.war"/>
+		<delete file="${org.apache.jetspeed.deploy.war.dir}jetspeed/WEB-INF/deploy/${pom.artifactId}.war"/>
+	</goal>
+	<!-- ================================================================ -->
+	<!-- Hot Deploy for mundane everyday development under Catalina       -->
+	<!-- ================================================================ -->
+	<goal name="hotdeploy">
+		<echo message="Hot Deploying ${org.apache.jetspeed.portlet.app.name} to ${org.apache.jetspeed.deploy.war.dir}"/>
+		<copy todir="${org.apache.jetspeed.deploy.war.dir}/${org.apache.jetspeed.portlet.app.name}/WEB-INF/classes">
+			<fileset dir="${maven.build.dir}/classes">
+			</fileset>
+		</copy>
+		<copy todir="${org.apache.jetspeed.deploy.war.dir}/${org.apache.jetspeed.portlet.app.name}/">
+			<fileset dir="./src/webapp">
+			</fileset>
+		</copy>
+	</goal>
+	<preGoal name="hotdeploy">
+		<attainGoal name= "java:compile"/>
+	</preGoal>
+</project>
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/project.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/project.properties?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/project.properties (added)
+++ incubator/graffito/trunk/applications/browser/project.properties Thu Feb 17 15:57:09 2005
@@ -0,0 +1,41 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: project.properties,v 1.7 2004/12/01 01:28:47 taylor Exp $
+#
+
+#-----------------------------------------------------------------------------------------------------
+# MAVEN REPORISTORIES
+#-----------------------------------------------------------------------------------------------------
+maven.repo.remote = http://www.bluesunrise.com/maven/, http://www.ibiblio.org/maven/, http://dist.codehaus.org/, http://cvs.apache.org/repository
+
+#-----------------------------------------------------------------------------------------------------
+# DOC : SITE & PDF DOC
+#-----------------------------------------------------------------------------------------------------
+maven.docs.dest=${basedir}/../../site/portlets
+# Display the date on the Maven web site
+maven.xdoc.date = left
+
+maven.xdoc.version = ${pom.currentVersion}
+maven.pdf.navigationFile=navigation_pdf.xml
+
+#-----------------------------------------------------------------------------------------------------
+# COMPILE & WAR
+#-----------------------------------------------------------------------------------------------------
+maven.compile.deprecation=on
+org.apache.jetspeed.portlet.app.name=graffito-browser
+
+
+
+

Added: incubator/graffito/trunk/applications/browser/project.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/project.xml?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/project.xml (added)
+++ incubator/graffito/trunk/applications/browser/project.xml Thu Feb 17 15:57:09 2005
@@ -0,0 +1,188 @@
+<project>
+	<extend>${basedir}/./../../project.xml</extend>
+	<pomVersion>3</pomVersion>
+	<artifactId>graffito-browser</artifactId>
+	<name>Graffito Browser Portlet</name>
+	<groupId>graffito</groupId>
+	<description>Graffito Browser Portlet</description>
+	<shortDescription>Graffito Browser Portlet</shortDescription>
+	<repository>
+		<connection>scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</connection>
+		<developerConnection>
+			scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</developerConnection>
+		<url>http://svn.apache.org/viewcvs</url>
+	</repository>
+	<dependencies>
+		<dependency>
+			<id>graffito-api</id>
+			<groupId>graffito</groupId>
+			<version>1.0-a1-dev</version>
+		</dependency>
+		<dependency>
+			<id>servletapi</id>
+			<version>2.3</version>
+			<properties>
+				<war.bundle>false</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>portlet-api</groupId>
+			<artifactId>portlet-api</artifactId>
+			<version>1.0</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>false</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>jetspeed2</groupId>
+			<artifactId>jetspeed-commons</artifactId>
+			<version>2.0-M2-dev</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>false</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>jetspeed2</groupId>
+			<artifactId>jetspeed-components</artifactId>
+			<version>2.0-M2-dev</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>portals-bridges</groupId>
+			<artifactId>portals-bridges-common</artifactId>
+			<version>0.1</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>portals-bridges</groupId>
+			<artifactId>portals-bridges-velocity</artifactId>
+			<version>0.1</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<id>velocity</id>
+			<version>1.4</version>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<id>velocity-tools</id>
+			<version>1.1</version>
+			<url>http://jakarta.apache.org/velocity</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.8</version>
+			<type>jar</type>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>1.0.3</version>
+			<type>jar</type>
+			<url>http://jakarta.apache.org/commons/logging.html</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>1.6.1</version>
+			<url>http://jakarta.apache.org/commons/beanutils.html</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-codec</groupId>
+			<artifactId>commons-codec</artifactId>
+			<version>1.2</version>
+			<url>http://jakarta.apache.org/commons/codec/</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-collections</groupId>
+			<artifactId>commons-collections</artifactId>
+			<version>2.1</version>
+			<url>http://jakarta.apache.org/commons/collections.html</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-digester</groupId>
+			<artifactId>commons-digester</artifactId>
+			<version>1.5</version>
+			<url>http://jakarta.apache.org/commons/digester.html</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-el</groupId>
+			<artifactId>commons-el</artifactId>
+			<version>1.0</version>
+			<url>http://jakarta.apache.org/commons/el/</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.0</version>
+			<url>http://jakarta.apache.org/commons/fileupload/</url>
+			<properties>
+				<war.bundle>true</war.bundle>
+			</properties>
+		</dependency>
+	</dependencies>
+	<build>
+		<sourceDirectory>src/java</sourceDirectory>
+		<resources>
+			<resource>
+				<directory>${basedir}/src/java/</directory>
+				<includes>
+					<include>**/*.properties</include>
+				</includes>
+				<filtering>false</filtering>
+			</resource>
+		</resources>
+	</build>
+	<reports>
+		<report>maven-jdepend-plugin</report>
+		<report>maven-checkstyle-plugin</report>
+		<report>maven-pmd-plugin</report>
+		<report>maven-changelog-plugin</report>
+		<report>maven-file-activity-plugin</report>
+		<report>maven-developer-activity-plugin</report>
+		<report>maven-license-plugin</report>
+		<report>maven-javadoc-plugin</report>
+		<report>maven-jxr-plugin</report>
+		<report>maven-junit-report-plugin</report>
+		<report>maven-tasklist-plugin</report>
+	</reports>
+	<properties/>
+</project>
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.portals.graffito.model.CmsObject;
+import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.model.Server;
+
+/**
+ * Information on the current content folder displayed in the Graffito Browser Portlet.
+ * This is the DTO used between the velocity template et the portlet methods
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class BrowserInfo
+{
+    /** All document type available */
+    public static String[] DOCUMENT_TYPES = { "document.type.upload", "document.type.text", "document.type.html", "document.type.news" };
+            
+    /** Current folder display in the Browser portlet, can be null if it is a server root folder */    
+    private Folder currentFolder;
+    
+    /** Server object associated to the current folder */
+    private Server currentServer;
+
+    /** Current cms object display in the Browser porlet, can be null if there is no "edited" cms object  */
+    private CmsObject currentCmsObject;
+    
+    /** Document children found in the current folder */ 
+    private Collection documents;
+
+    /** Folder children found in the current folder */
+    private Collection folders;
+    
+    /** All document types that can be created */ 
+    private ArrayList documentTypes = new ArrayList();
+    
+    /** All document languages can be used */
+    private Collection languages = new ArrayList();
+    
+    public static final String INSERT = "insert";
+    
+    public static final String UPDATE = "update";
+    
+    public static final String DELETE = "delete";
+    
+    private String operation; 
+    
+    /**
+     * Contructor 
+     *  
+     * @param documentTypes list of all available document types   
+     * @param languages list of all available languages
+     */
+    public BrowserInfo (Collection documentTypes, Collection languages)
+    {
+         this.documentTypes.addAll(documentTypes);
+         this.languages.addAll(languages);
+    }
+    
+    /**
+     * Get all document type that can be created in this Graffito application
+     * @return all document types (collection of String)
+     */
+    public Collection getDocumentTypes()
+    {
+         return documentTypes;    
+    }
+
+    /**
+     * Get all document type that can be created in this Graffito application
+     * @return all document types (collection of String)
+     */
+    public Collection getDocumentLanguages()
+    {
+         return languages;    
+    }
+    
+    /**
+     * @return Returns the document children.
+     */
+    public Collection getDocuments()
+    {
+        return documents;
+    }
+
+    /**
+     * @param documents The document children to set.
+     */
+    public void setDocuments(Collection documents)
+    {
+        this.documents = documents;
+    }
+
+    /**
+     * @return Returns the folders children.
+     */
+    public Collection getFolders()
+    {
+        return folders;
+    }
+
+    /**
+     * @param folders The folders to set.
+     */
+    public void setFolders(Collection folders)
+    {
+        this.folders = folders;
+    }
+
+    /** 
+     * @param currentCmsObject Current Cms object to set
+     */
+    public void setCurrentCmsObject(CmsObject currentCmsObject)
+    {
+        this.currentCmsObject = currentCmsObject;
+    }
+    
+    /**
+     * @return the current folder
+     */
+    public Folder getCurrentFolder()
+    {
+        return currentFolder;
+    }
+    
+    /**
+     * @param currentFolder The current folder to set
+     */
+    public void setCurrentFolder(Folder currentFolder)
+    {
+        this.currentFolder = currentFolder;
+    }
+    
+    /**
+     * @return the current cms object
+     */
+    public CmsObject getCurrentCmsObject()
+    {
+        return currentCmsObject;
+    }
+    
+    /**
+     * @return the current server
+     */
+    public Server getCurrentServer()
+    {
+        return currentServer;
+    }
+    
+    /**
+     * 
+     * @param currentServer The current server to set
+     */
+    public void setCurrentServer(Server currentServer)
+    {
+        this.currentServer = currentServer;
+    }
+    
+    public ArrayList getFolderPath()
+    {
+        ArrayList cmsPath = new ArrayList();
+        if (currentFolder != null)
+        {
+            cmsPath.add(currentFolder);
+            Folder parentFolder = currentFolder.getParentFolder();
+            while (parentFolder != null)
+            {
+                cmsPath.add(0, parentFolder);
+                parentFolder = parentFolder.getParentFolder();
+            }
+        }
+        
+        if (currentCmsObject instanceof Document)
+        {
+            cmsPath.add(currentCmsObject);
+        }
+        
+        return cmsPath;
+        
+    }
+    
+        
+    public String getOperation()
+    {
+        return operation;
+    }
+    public void setOperation(String operation)
+    {
+        this.operation = operation;
+    }
+    /**
+     * @return true if the Browser is empty, else false
+     */
+    public boolean isEmpty()
+    {
+        if ((((documents == null) || (documents.size() == 0))) &&
+            (((folders == null) || (folders.size() == 0)))) 
+        {
+            return true;
+        }
+        else 
+        {
+            return false;
+        }
+    }
+    
+    
+    
+    
+    
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,664 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+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.CmsObject;
+import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.portlets.util.PortletDiskFileUpload;
+import org.apache.portals.graffito.portlets.util.PortletFileUploadBase;
+import org.apache.portals.graffito.util.CmsUtil;
+import org.apache.velocity.context.Context;
+
+/**
+ * Graffito Content Browser.
+ * 
+ * In the view mode, this browser gives a way to navigate across the complete content tree. In the edit mode, this browser can
+ * manager folders & documents (edit, add, delete, manage security, versionning, ...).
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart </a>
+ * @version $Id: BrowserPortlet.java,v 1.1 2004/12/28 14:29:11 christophe Exp $
+ */
+public class BrowserPortlet extends GenericTabVelocityPortlet
+{
+
+    /** Velocity variable to set the browser info object in the Velocity context */
+    private static final String VELOCITY_BROWSER_INFO = "browserInfo";
+
+    /** Portlet session attribute name used to set the Browser info */
+    private static final String SESSION_BROWSER_INFO = "graffito.browser.info";
+
+    /** Default uri used to display the content browser */
+    private static final String DEFAULT_CONTENT_SCOPE = "/graffito";
+
+    /** Portlet preference attritube containing the root uri used to display the content browser */
+    private static final String CONTENT_SCOPE = "gaffito.content.scope";
+
+    /** Portlet init param containing all available document types */
+    private ArrayList documentTypes = new ArrayList();
+
+    /** Portlet init param containing all available document languages */
+    private ArrayList documentLanguages = new ArrayList();
+
+    private ContentModelService modelService;
+
+    private ContentServerService serverService;
+
+    /**
+     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+     */
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+
+        PortletContext context = getPortletContext();
+
+        modelService = (ContentModelService) context.getAttribute("cps:ContentModel");
+        if (null == modelService)
+        {
+            throw new PortletException("Failed to find the content model service on portlet initialization");
+        }
+
+        serverService = (ContentServerService) context.getAttribute("cps:ContentServer");
+        if (null == serverService)
+        {
+            throw new PortletException("Failed to find the content server service on portlet initialization");
+        }
+
+        String param = config.getInitParameter("DocumentTypes");
+        if (null == param)
+        {
+            throw new PortletException("Failed to read the init paramater : DocumentTypes");
+        }
+        initDocumentTypes(param);
+
+        param = config.getInitParameter("DocumentLanguages");
+        if (null == param)
+        {
+            throw new PortletException("Failed to read the init paramater : DocumentLanguages");
+        }
+
+        initDocumentLanguages(param);
+
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+
+        response.setContentType("text/html");
+        Context velocityContext = this.getContext(request);
+
+        BrowserInfo browserInfo = null;
+        String uri = request.getParameter("uri");
+        if (uri == null)
+        {
+            uri = this.getDefaultContentScope(request);
+            browserInfo = this.getSessionBrowserInfo(request);
+        }
+
+        if (null == browserInfo)
+        {
+            browserInfo = this.initBrowserInfo(uri, request, response);
+            this.setSessionContentBrowser(request, browserInfo);
+        }
+
+        this.selectViewTemplate(browserInfo, request, response);
+
+        velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
+        super.doView(request, response);
+        
+
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+    
+        response.setContentType("text/html");
+        Context velocityContext = this.getContext(request);
+
+        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+        browserInfo.setOperation(BrowserInfo.UPDATE);
+        this.selectEditTemplate(browserInfo, request, response);
+        velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
+
+        super.doEdit(request, response);     
+    }
+
+    /**
+     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+     */
+    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
+    {
+
+        if (request.getPortletMode() == PortletMode.EDIT)
+        {
+            PortletDiskFileUpload diskFileUpload = new PortletDiskFileUpload();
+
+            if (this.hasFieldForm(request, diskFileUpload, "folder.add"))
+            {
+                this.createFolder(request, response);
+                return;
+            }
+
+            if (this.hasFieldForm(request, diskFileUpload, "document.add"))
+            {
+                this.createDocument(request, response);
+                return;
+            }
+
+            if (this.hasFieldForm(request, diskFileUpload, "document.new.step2"))
+            {
+                this.createDocumentStep2(request, response);
+                return;
+            }
+
+            if (this.hasFieldForm(request, diskFileUpload, "folder.save"))
+            {
+                this.saveFolder(request, response);
+                return;
+            }
+
+            if (this.hasFieldForm(request, diskFileUpload, "document.save"))
+            {
+                this.saveDocument(request, response);
+                return;
+            }
+            
+            if (this.hasFieldForm(request, diskFileUpload, "document.upload"))
+            {
+                this.uploadDocument(request, response, diskFileUpload);
+                return;
+            }
+            
+            if (this.hasFieldForm(request, diskFileUpload, "cmsobject.delete"))
+            {
+                this.deleteCmsObject(request, response);
+                return;
+            }
+
+            if (this.hasFieldForm(request, diskFileUpload, "cancel"))
+            {
+                request.setAttribute(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+                return;
+            }
+            
+            super.processAction(request, response);
+
+        }
+
+    }
+
+    protected BrowserInfo getSessionBrowserInfo(PortletRequest request)
+    {
+        Object sessionBrowserInfo = request.getPortletSession().getAttribute(SESSION_BROWSER_INFO, PortletSession.PORTLET_SCOPE);
+        
+        // After deploying a new graffito war file into jetspeed, there is a classpath exception whith the
+        // current object in the session
+        if (sessionBrowserInfo instanceof BrowserInfo)
+        {
+            return (BrowserInfo) sessionBrowserInfo;
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    protected void setSessionContentBrowser(PortletRequest request, BrowserInfo browserInfo)
+    {
+        request.getPortletSession().setAttribute(SESSION_BROWSER_INFO, browserInfo);
+    }
+
+    protected void removeSessionContentBrowser(PortletRequest request)
+    {
+        request.getPortletSession().removeAttribute(SESSION_BROWSER_INFO);
+    }
+
+    protected String getDefaultContentScope(PortletRequest request)
+    {
+
+        return request.getPreferences().getValue(CONTENT_SCOPE, DEFAULT_CONTENT_SCOPE);
+    }
+
+    protected void createFolder(ActionRequest request, ActionResponse response) throws PortletException
+    {
+
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            Folder folder = modelService.createFolder();
+            browserInfo.setCurrentCmsObject(folder);
+            browserInfo.setOperation(BrowserInfo.INSERT);
+            this.setSessionContentBrowser(request, browserInfo);            
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-detail.vm");
+
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }
+    }
+
+    protected void createDocument(ActionRequest request, ActionResponse response) throws PortletException
+    {
+
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            Document document = modelService.createDocument();
+            browserInfo.setCurrentCmsObject(document);
+            browserInfo.setOperation(BrowserInfo.INSERT);
+            this.setSessionContentBrowser(request, browserInfo);
+            
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-type.vm");
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a document ", e);
+        }
+    }
+
+    protected void createDocumentStep2(ActionRequest request, ActionResponse response) throws PortletException
+    {
+
+        //        try
+        //        {
+        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+        Document document = (Document) browserInfo.getCurrentCmsObject();
+        String name = request.getParameter("name");
+        String title = request.getParameter("title");
+        String description = request.getParameter("description");
+        String owner = request.getParameter("owner");
+        String language = request.getParameter("language");
+
+        document.setCreationDate(new Date());
+        document.setDescription(description);
+        document.setLastModified(new Date());
+        document.setName(name);
+        document.setTitle(title);
+        document.setOwner(owner);
+        document.setLanguage(language);
+
+        String parentFolderUri = null;
+        if (browserInfo.getCurrentFolder() == null)
+        {
+            parentFolderUri = browserInfo.getCurrentServer().getScope();
+        }
+        else
+        {
+            parentFolderUri = browserInfo.getCurrentFolder().getUri();
+        }
+
+        document.setUri(parentFolderUri + "/" + name);
+        document.setVersionNumber("1.0");
+
+        String type = request.getParameter("documentType");
+        if (type.equals("document.type.text"))
+        {
+            document.setContentType("text/plain");
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-text-edit.vm");
+        }
+
+        if (type.equals("document.type.html"))
+        {
+            document.getContent().setContent("[Add your text here]".getBytes());
+            document.setContentType("text/html");
+            //response.setRenderParameter(PARAM_EDIT_PAGE, "/fckeditor/htmleditor.vm");
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/kupu/kupu.vm");
+
+        }
+
+        if (type.equals("document.type.upload"))
+        {
+           response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-upload-edit.vm");
+        }
+
+        browserInfo.setCurrentCmsObject(document);
+        this.setSessionContentBrowser(request, browserInfo);
+
+        //        }
+        //        catch (ContentManagementException e)
+        //        {
+        //            throw new PortletException("Impossible to create a document ", e);
+        //        }
+    }
+
+    protected void saveFolder(ActionRequest request, ActionResponse response) throws PortletException
+    {
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            Folder folder = (Folder) browserInfo.getCurrentCmsObject();
+            String name = request.getParameter("name");
+            String title = request.getParameter("title");
+            String description = request.getParameter("description");
+
+            folder.setCreationDate(new Date());
+            folder.setDescription(description);
+            folder.setLastModified(new Date());
+            folder.setName(name);
+            folder.setTitle(title);
+
+            String parentFolderUri = null;
+            if (browserInfo.getCurrentFolder() == null)
+            {
+                parentFolderUri = browserInfo.getCurrentServer().getScope();
+            }
+            else
+            {
+                parentFolderUri = browserInfo.getCurrentFolder().getUri();
+            }
+
+            folder.setUri(parentFolderUri + "/" + name);
+            if (browserInfo.getOperation().equals(BrowserInfo.INSERT))
+            {
+                modelService.addFolder(folder);
+            }
+            else
+            {
+                modelService.updateFolder(folder);
+            }
+
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+
+            response.setPortletMode(PortletMode.VIEW);
+            this.removeSessionContentBrowser(request);
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }
+    }
+
+    protected void saveDocument(ActionRequest request, ActionResponse response) throws PortletException
+    {
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            Document document = (Document) browserInfo.getCurrentCmsObject();
+
+            //Other attributes has been initialised in the method createDocumentStep2
+            String content = request.getParameter("content");
+            try
+            {
+                document.getContent().setContent(content.getBytes(request.getCharacterEncoding()));
+                document.getContent().setEncoding(request.getCharacterEncoding());
+            }
+            catch (UnsupportedEncodingException e)
+            {
+                document.getContent().setContent(content.getBytes());
+            }
+            document.setSize(content.length());
+            if (browserInfo.getOperation().equals(BrowserInfo.INSERT))
+            {
+                modelService.addDocument(document);
+            }
+            else
+            {
+                modelService.updateDocument(document);
+            }
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+            response.setPortletMode(PortletMode.VIEW);
+            this.removeSessionContentBrowser(request);
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a document ", e);
+        }
+    }
+
+    protected void uploadDocument(ActionRequest request, ActionResponse response, PortletDiskFileUpload diskFileUpload) throws PortletException
+    {
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            Document document = (Document) browserInfo.getCurrentCmsObject();
+
+            diskFileUpload.setRepositoryPath("c:/tmp/upload");
+            FileItem fileItem = diskFileUpload.getFileItem(request, "file");
+            document.setContentType(fileItem.getContentType());
+            document.getContent().setContent(fileItem.get());
+            document.getContent().setEncoding(request.getCharacterEncoding());
+
+            document.setSize(fileItem.getSize());
+            if (browserInfo.getOperation().equals(BrowserInfo.INSERT))
+            {
+                modelService.addDocument(document);
+            }
+            else
+            {
+                modelService.updateDocument(document);
+            }
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+            response.setPortletMode(PortletMode.VIEW);
+            this.removeSessionContentBrowser(request);
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to upload a document ", e);
+        }
+    }
+    
+    protected void deleteCmsObject(ActionRequest request, ActionResponse response) throws PortletException
+    {
+        try
+        {
+            String[] uriToDelete = request.getParameterValues("uri");
+            if (uriToDelete == null)
+            {
+                // No cms object has been selected
+                return;
+            }
+
+            for (int i = 0; i < uriToDelete.length; i++)
+            {
+                modelService.removeAll(uriToDelete);
+            }
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+            response.setPortletMode(PortletMode.VIEW);
+            this.removeSessionContentBrowser(request);
+
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to delete all cms objects ", e);
+        }
+    }
+
+    /**
+     * Initialise the list of the available document types
+     * 
+     * @param documentTypes
+     *            comma separated document types
+     */
+    private void initDocumentTypes(String documentTypes)
+    {
+        String[] types = documentTypes.split(",");
+
+        for (int i = 0; i < types.length; i++)
+        {
+            this.documentTypes.add(types[i].trim());
+        }
+    }
+
+    /**
+     * Initialise the list of the available document types
+     * 
+     * @param documentLanguages
+     *            comma separated document types
+     */
+    private void initDocumentLanguages(String documentLanguages)
+    {
+        String[] types = documentLanguages.split(",");
+
+        for (int i = 0; i < types.length; i++)
+        {
+            this.documentLanguages.add(types[i].trim());
+        }
+    }
+
+    /**
+     * Initialise the DTO browserInfo. This DTO is used by the velocity templates to display the content browser infos.
+     * 
+     * @param uri
+     *            The uri associated to the cms object to display
+     * @param request
+     *            RenderRequest
+     * @param response
+     *            RenderResponse
+     * @return a new initialised {@link BrowserInfo}
+     * @throws PortletException
+     *             when it is not possible to initialise the
+     */
+    private BrowserInfo initBrowserInfo(String uri, RenderRequest request, RenderResponse response) throws PortletException
+    {
+        try
+        {
+            BrowserInfo browserInfo = new BrowserInfo(this.documentTypes, this.documentLanguages);
+            CmsObject cmsObject = modelService.getCmsObject(uri);
+            browserInfo.setCurrentCmsObject(cmsObject);
+            if ((cmsObject instanceof Folder) || (cmsObject == null)) // cms object is null if the uri match to a server root
+            {
+                browserInfo.setDocuments(modelService.getDocuments(uri));
+                browserInfo.setFolders(modelService.getFolders(uri));
+                browserInfo.setCurrentFolder(modelService.getFolder(uri));
+
+            }
+            else
+            {
+                browserInfo.setCurrentFolder(cmsObject.getParentFolder());
+            }
+            String scopeServer = CmsUtil.getServerScope(uri);
+            browserInfo.setCurrentServer(serverService.getServer(scopeServer));
+
+            return browserInfo;
+
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Failed to view the portlet - impossible to access to Graffito content store : "
+                    + e.getMessage());
+        }
+
+    }
+
+    private void selectViewTemplate(BrowserInfo browserInfo, RenderRequest request, RenderResponse response)
+    {
+        CmsObject cmsObject = browserInfo.getCurrentCmsObject();
+        if ((cmsObject instanceof Folder) || (cmsObject == null))
+        {
+           request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/folder/folder-browser.vm" );
+        }
+        else
+        {
+            Document document = (Document) cmsObject;
+            if (document.getContentType().equals("text/plain"))
+            {
+                request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/document/document-text-html-view.vm" );
+                return;
+            }
+
+            if (document.getContentType().equals("text/html"))
+            {
+                request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/document/document-text-html-view.vm");
+
+            }
+            else
+            {
+                request.setAttribute("uri", cmsObject.getUri());                
+                request.setAttribute(PARAM_VIEW_PAGE, "/viewer");
+            }
+
+        }
+    }
+
+    private void selectEditTemplate(BrowserInfo browserInfo, RenderRequest request, RenderResponse response)
+            throws PortletException
+    {
+
+        
+        // Check if the edit template has been already defined (from the processAction method)
+        String editPageParam = request.getParameter(PARAM_EDIT_PAGE);
+        if (editPageParam != null &&  (! editPageParam.equals(this.getDefaultEditPage())))
+        {
+            request.setAttribute(PARAM_EDIT_PAGE, editPageParam);
+        }
+        else
+        {
+            CmsObject cmsObject = browserInfo.getCurrentCmsObject();
+            
+            if ((cmsObject == null) || (cmsObject instanceof Folder))
+            {
+                request.setAttribute(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
+            }
+            else
+            {
+                Document document = (Document) cmsObject;
+                if (document.getContentType().equals("text/plain"))
+                {
+                    request.setAttribute(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-text-edit.vm");
+                }
+
+                if (document.getContentType().equals("text/html"))
+                {
+                    request.setAttribute(PARAM_EDIT_PAGE, "/kupu/kupu.vm");
+                }
+
+            }
+        }                
+    }
+    
+    
+    private boolean hasFieldForm(ActionRequest request, PortletDiskFileUpload diskFileUpload,  String fieldName)
+    {
+        if (! PortletFileUploadBase.isMultipartContent(request))
+        {
+            return (request.getParameter(fieldName) != null);
+        }
+        else
+        {
+            return diskFileUpload.hasFieldName(request, fieldName);
+        }
+    }
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.portals.graffito.util.GraffitoTools;
+import org.apache.velocity.context.Context;
+
+/**
+ * Velocity portlet which can manage tab pages in the view & edit mode.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * @version $Id:  Exp $
+ */
+public class GenericTabVelocityPortlet extends GenericVelocityPortlet
+{
+
+    private static final String TAB_CONFIG = "TabConfig";        
+    protected HashMap tabs = new HashMap();
+    
+    protected Log log = LogFactory.getLog(GenericTabVelocityPortlet.class);
+
+    /**
+     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+     */
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+                        
+        PortletContext context = getPortletContext();
+        String tabConfig = config.getInitParameter(TAB_CONFIG);
+        if (null == tabConfig)
+        {
+            throw new PortletException("Portlet init parameter TabConfig not found");
+        }
+        
+        String xmlFile = context.getRealPath(tabConfig);
+        try
+        {
+            tabs = TabReader.getTabs(xmlFile);            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to read the tab xml file : " + xmlFile );            
+        }
+                
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+        
+        Context velocityContext = this.getContext(request);
+        velocityContext.put("tabs", tabs);   
+        velocityContext.put("graffitoTools", new GraffitoTools());
+        
+        super.doView(request, response);
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+        Context velocityContext = this.getContext(request);
+        velocityContext.put("tabs", tabs); 
+        velocityContext.put("graffitoTools", new GraffitoTools());
+        super.doEdit(request, response);
+    }
+
+    /**
+     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+     */
+    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
+    {
+                
+        if (request.getPortletMode() == PortletMode.EDIT)
+        {           
+            String tabId = request.getParameter("selectTab");
+            if (tabId != null)
+            {                
+                
+                VelocityTab tab = (VelocityTab) tabs.get(tabId);
+                String pageId = request.getParameter("selectPage");
+                    
+                if (pageId == null)
+                {
+                    throw new PortletException("Impossible to find the selected page");
+                }
+                
+                tab.setSelectedPage(pageId);
+            }            
+        }            
+    }
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/TabReader.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/TabReader.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/TabReader.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/TabReader.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * This utility class build a collection of {@link org.apache.portals.graffito.portlets.VelocityTab}
+ * from a xml config file. The structure of the xml file is : 
+ * <code>
+ * <tabs>
+ *	<tab id="document">
+ *	    <page id="General" label="tab.general" view= "/WEB-INF/view/doc-general.vm" />
+ * 	    <page id="Security" label="tab.security" view= "/WEB-INF/view/security.vm" />
+ * 	    <page id="History" label="tab.history" view= "/WEB-INF/view/version.vm" />
+ *	</tab>
+ *  <tab id="...">
+ *      <page ... />
+ *  </tab>	
+ * </tabs>
+ * </code>
+ *  
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class TabReader
+{
+
+    /**
+     * Build a collection of {@link VelocityTab} from an xml file.
+     * 
+     * @param xmlFile
+     * @return a HashMap of {@link VelocityTab}
+     * @throws IOException
+     * @throws SAXException
+     * @throws ParserConfigurationException
+     */
+    public static HashMap getTabs(String xmlFile) throws IOException, SAXException, ParserConfigurationException
+    {
+
+        HashMap tabs = new HashMap();
+
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document document = builder.parse(xmlFile);
+        Node root = document.getFirstChild();
+        NodeList tabList = root.getChildNodes();
+        for (int tabIndex = 0; tabIndex < tabList.getLength(); tabIndex++)
+        {
+            Node tabNode = tabList.item(tabIndex);
+            if (tabNode.getNodeType() == Node.ELEMENT_NODE)
+            {
+
+                //String tabId = no
+                String tabId = tabNode.getAttributes().getNamedItem("id").getNodeValue();
+                VelocityTab tab = new VelocityTab(tabId);
+                NodeList pageList = tabNode.getChildNodes();
+                
+                for (int pageIndex = 0; pageIndex < pageList.getLength(); pageIndex++)
+                {
+                    Node pageNode = pageList.item(pageIndex);
+                    if (pageNode.getNodeType() == Node.ELEMENT_NODE)
+                    {
+                        String id = pageNode.getAttributes().getNamedItem("id").getNodeValue();
+                        String label = pageNode.getAttributes().getNamedItem("label").getNodeValue();
+                        String view = pageNode.getAttributes().getNamedItem("view").getNodeValue();
+                        VelocityTabPage page = new VelocityTabPage(id, label, view);
+                        tab.addPage(page);
+                    }
+                }
+
+                tabs.put(tabId, tab);
+            }
+        }
+
+        return tabs;
+
+    }
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTab.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTab.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTab.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTab.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.util.ArrayList;
+
+/**
+ * Velocity Tab containse a series of {@link org.apache.portals.graffito.portlets.VelocityTabPage}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class VelocityTab
+{
+     private ArrayList tabPages = new ArrayList();
+     private int selectedPage = 0;
+     private String id;
+     
+     public VelocityTab(String id)
+     {
+         this.id = id;
+     }
+     
+     public String getId()
+     {
+         return id;
+     }
+     
+     
+     public void addPage(VelocityTabPage page)
+     {         
+         tabPages.add(page);
+     }
+     
+     public VelocityTabPage[] getPages()
+     {
+         return (VelocityTabPage[]) tabPages.toArray(new VelocityTabPage[tabPages.size()]);
+     }
+     
+     public VelocityTabPage getSelectedPage()
+     {
+         return (VelocityTabPage) tabPages.get(selectedPage);
+     }
+     
+     public void setSelectedPage(String pageId)
+     {
+         VelocityTabPage[] pages = this.getPages();
+         for (int i = 0; i<pages.length; i++)
+         {
+             if (pages[i].getId().equals(pageId))
+             {
+                 this.selectedPage= i;
+                 break;
+             }
+         }
+         
+     }
+     
+     public boolean isSelected(VelocityTabPage page)
+     {
+         return ((VelocityTabPage) tabPages.get(selectedPage)).getId().equals(page.getId());   
+     }
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java Thu Feb 17 15:57:09 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+/**
+ * Information on one view in a VelocityTab. See {@link org.apache.portals.graffito.portlets.VelocityTab}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class VelocityTabPage
+{
+    private String id;
+    private String label;
+    private String view;    
+
+    /**
+     * @param label
+     * @param view
+     */
+    public VelocityTabPage(String id, String label, String view)
+    {
+        this.id = id;
+        this.label = label;
+        this.view = view;       
+    }
+    
+    
+    public String getId()
+    {
+        return id;
+    }
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+    
+    public String getLabel()
+    {
+        return label;
+    }
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+    public String getView()
+    {
+        return view;
+    }
+    public void setView(String view)
+    {
+        this.view = view;
+    }
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties Thu Feb 17 15:57:09 2005
@@ -0,0 +1,51 @@
+javax.portlet.title = Graffito Content Browser
+javax.portlet.short-title = Content Browser
+javax.portlet.keywords = cms, document management
+help.title= Help Mode
+
+help.text.view = This Graffito portlet provides a browser of the portal content. Use the view mode to navigate across the content repository.
+help.text.edit = Use the edit mode to modify, add or delete folders & documents.
+
+div.path= You are in :  
+div.newfolder= Add new folder in : 
+div.newdocument= Add new document in : 
+div.updatedocument = Update Document : 
+div.folders = Folders
+div.documents = Documents 
+div.server = Server
+
+edit.tab.select=Select
+edit.tab.type=Type
+edit.tab.name=Name
+edit.tab.title=Title
+edit.tab.description=Description
+edit.tab.creationdate=Creation Date
+edit.tab.modificationdate=Modification Date
+
+field.name = Name
+field.title= Title
+field.description= Description
+field.type= Document Type
+field.owner = Owner
+field.language = Document Language
+
+link.addfolder= Add Folder
+link.adddocument = Add Document
+link.delete = Delete
+
+file.upload=Select a file to upload
+
+tab.folder = Folder Info
+tab.security=Security
+
+info.nocontent= No content found in this folder.
+error.servers=No content server found
+
+document.type.upload = Updload a Document 
+document.type.text = Simple Text
+document.type.html = Html page 
+document.type.news = Graffito News
+
+
+document.en = English
+document.fr = French
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties Thu Feb 17 15:57:09 2005
@@ -0,0 +1,29 @@
+javax.portlet.title = Graffito Content Browser
+javax.portlet.short-title = Content Browser
+javax.portlet.keywords = cms, document management
+help.title = Help Mode
+
+help.text.view = This Graffito portlet provides a browser of the portal content. Use the view mode to navigate across the content repository.
+help.text.edit = Use the edit mode to modity, add or delete folders & documents.
+
+
+div.path= You are in :
+div.newfolder= Add new folder in :  
+div.folders = Folders
+div.documents = Documents 
+
+edit.tab.select=Select
+edit.tab.name=Name
+edit.tab.title=Title
+edit.tab.description=Description
+
+link.addfolder= Add Folder
+link.adddocument = Add Document
+link.delete = Delete
+
+tab.general=General
+tab.security=Security
+
+
+info.nocontent= No content found in this folder. Use the edit mode to add new content.
+error.servers=No content server found

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties?view=auto&rev=154214
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties Thu Feb 17 15:57:09 2005
@@ -0,0 +1,26 @@
+javax.portlet.title = Navigateur de contenu
+javax.portlet.short-title = Navigateur
+javax.portlet.keywords = cms, gestion de contenu, gestion documentaire
+help.title = Aide
+help.text.view = Ce portlet affiche l'ensemble du contenu disponible dans ce portail. Utilisez le mode view pour naviguer dans le répertoire documentaire.
+help.text.edit = Utilisez le mode edit pour ajouter, modifier ou effacer des documents et répertoires.
+
+div.path = Vous êtes dans   
+div.newfolder= Ajout d'un nouveau répertoire dans  
+div.folders = Répertoires  
+div.documents = Documents 
+
+edit.tab.select=Selection
+edit.tab.name=Nom
+edit.tab.title=Titre
+edit.tab.description=Description
+
+link.addfolder= Ajouter un répertoire
+link.adddocument = Ajouter un document
+link.delete = Supprimer
+
+tab.general=Information Générale
+tab.security=Securité
+  
+info.nocontent= Ce répertoire n'a pas de contenu. Utilisez le mode d'édition pour gérer votre contenu. 
+error.servers=Impossible de trouver un serveur de contenu 
\ No newline at end of file



Mime
View raw message