From e18a26f4f3d1422fc00f2cb333f783bf794ed410 Mon Sep 17 00:00:00 2001 From: Britt Park Date: Wed, 17 May 2006 22:42:03 +0000 Subject: [PATCH] Afternoon merge. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2915 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 9 +- config/alfresco/web-client-config-actions.xml | 12 + config/alfresco/web-client-config-dialogs.xml | 46 +- .../web-client-config-forum-actions.xml | 11 +- .../alfresco/web-client-config-properties.xml | 9 +- config/alfresco/web-client-config.xml | 2 +- .../action/evaluator/UnlockDocEvaluator.java | 36 + .../web/app/servlet/CommandServlet.java | 21 +- .../app/servlet/DownloadContentServlet.java | 4 +- .../app/servlet/ExternalAccessServlet.java | 11 +- .../app/servlet/TemplateContentServlet.java | 25 +- .../app/servlet/command/CommandProcessor.java | 5 +- .../servlet/command/ExecuteScriptCommand.java | 6 +- .../command/ScriptCommandProcessor.java | 23 +- .../command/WorkflowCommandProcessor.java | 5 +- .../alfresco/web/bean/BaseDetailsBean.java | 2 + .../org/alfresco/web/bean/BrowseBean.java | 6 +- .../web/bean/DocumentDetailsBean.java | 37 + .../org/alfresco/web/bean/NavigationBean.java | 6 +- .../org/alfresco/web/bean/TrashcanBean.java | 5 +- .../web/bean/clipboard/ClipboardBean.java | 13 +- .../CreateDiscussionDialog.java} | 105 +- .../web/bean/forums/CreateForumDialog.java | 34 + .../web/bean/forums/CreateForumsDialog.java | 34 + .../web/bean/forums/CreatePostDialog.java | 54 + .../web/bean/forums/CreateReplyDialog.java | 93 ++ .../web/bean/forums/CreateTopicDialog.java | 143 +++ .../web/bean/forums/EditPostDialog.java | 82 ++ .../web/bean/{ => forums}/ForumsBean.java | 4 +- .../web/bean/rules/CreateRuleWizard.java | 10 + .../web/bean/rules/EditRuleWizard.java | 13 + .../web/bean/spaces/CreateSpaceDialog.java | 3 + .../web/bean/spaces/CreateSpaceWizard.java | 37 +- .../web/bean/spaces/EditSpaceDialog.java | 99 +- .../web/bean/wizard/AddContentWizard.java | 316 ------ .../web/bean/wizard/BaseContentWizard.java | 629 ----------- .../web/bean/wizard/CreateContentWizard.java | 296 ------ .../web/bean/wizard/NewForumWizard.java | 67 -- .../web/bean/wizard/NewForumsWizard.java | 67 -- .../web/bean/wizard/NewPostWizard.java | 168 --- .../web/bean/wizard/NewReplyWizard.java | 142 --- .../web/bean/wizard/NewSpaceWizard.java | 974 ------------------ .../web/bean/wizard/NewTopicWizard.java | 174 ---- .../web/bean/wizard/NewUserWizard.java | 9 +- source/web/WEB-INF/faces-config-beans.xml | 115 +-- .../web/WEB-INF/faces-config-navigation.xml | 66 +- source/web/css/main.css | 5 + source/web/images/icons/unlock.gif | Bin 886 -> 989 bytes source/web/jsp/browse/browse.jsp | 2 +- source/web/jsp/dialog/document-details.jsp | 20 +- .../jsp/dialog/edit-document-properties.jsp | 214 ---- source/web/jsp/forums/create-dialog.jsp | 126 +++ source/web/jsp/forums/create-discussion.jsp | 217 ---- source/web/jsp/forums/create-forum.jsp | 216 ---- source/web/jsp/forums/create-forums.jsp | 215 ---- source/web/jsp/forums/create-post-dialog.jsp | 49 + source/web/jsp/forums/create-post.jsp | 177 ---- source/web/jsp/forums/create-reply-dialog.jsp | 81 ++ source/web/jsp/forums/create-reply.jsp | 201 ---- source/web/jsp/forums/create-topic-dialog.jsp | 154 +++ source/web/jsp/forums/create-topic.jsp | 217 ---- source/web/jsp/forums/edit-forum.jsp | 209 ---- source/web/jsp/forums/edit-forums.jsp | 209 ---- source/web/jsp/forums/edit-post.jsp | 178 ---- source/web/jsp/forums/edit-topic.jsp | 203 ---- source/web/jsp/forums/forum-details.jsp | 2 +- source/web/jsp/forums/forums-details.jsp | 2 +- source/web/jsp/forums/topic-details.jsp | 2 +- source/web/jsp/login.jsp | 2 +- source/web/jsp/rules/details.jsp | 6 +- source/web/jsp/spaces/create-space-dialog.jsp | 48 +- .../spaces/create-space-wizard/details.jsp | 34 +- 72 files changed, 1300 insertions(+), 5517 deletions(-) create mode 100644 source/java/org/alfresco/web/action/evaluator/UnlockDocEvaluator.java rename source/java/org/alfresco/web/bean/{wizard/NewDiscussionWizard.java => forums/CreateDiscussionDialog.java} (70%) create mode 100644 source/java/org/alfresco/web/bean/forums/CreateForumDialog.java create mode 100644 source/java/org/alfresco/web/bean/forums/CreateForumsDialog.java create mode 100644 source/java/org/alfresco/web/bean/forums/CreatePostDialog.java create mode 100644 source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java create mode 100644 source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java create mode 100644 source/java/org/alfresco/web/bean/forums/EditPostDialog.java rename source/java/org/alfresco/web/bean/{ => forums}/ForumsBean.java (99%) delete mode 100644 source/java/org/alfresco/web/bean/wizard/AddContentWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/BaseContentWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/CreateContentWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewForumWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewForumsWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewPostWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewReplyWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewSpaceWizard.java delete mode 100644 source/java/org/alfresco/web/bean/wizard/NewTopicWizard.java delete mode 100644 source/web/jsp/dialog/edit-document-properties.jsp create mode 100644 source/web/jsp/forums/create-dialog.jsp delete mode 100644 source/web/jsp/forums/create-discussion.jsp delete mode 100644 source/web/jsp/forums/create-forum.jsp delete mode 100644 source/web/jsp/forums/create-forums.jsp create mode 100644 source/web/jsp/forums/create-post-dialog.jsp delete mode 100644 source/web/jsp/forums/create-post.jsp create mode 100644 source/web/jsp/forums/create-reply-dialog.jsp delete mode 100644 source/web/jsp/forums/create-reply.jsp create mode 100644 source/web/jsp/forums/create-topic-dialog.jsp delete mode 100644 source/web/jsp/forums/create-topic.jsp delete mode 100644 source/web/jsp/forums/edit-forum.jsp delete mode 100644 source/web/jsp/forums/edit-forums.jsp delete mode 100644 source/web/jsp/forums/edit-post.jsp delete mode 100644 source/web/jsp/forums/edit-topic.jsp diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index d4eb7c802f..1956d9b31a 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -172,6 +172,9 @@ rules_count=Number of rules applied to this Space working_copy_document=Working Copy copy_of=Copy of link_to=Link to +icon=Icon +lock=Lock +unlock=Unlock # Properties username=User Name @@ -323,9 +326,12 @@ create_forum_description=Enter information about the new forum then click Create create_topic_description=Enter information about the new topic then click Create Topic. create_post_description=Enter the content of the message then click Post. create_reply_description=Enter message text to reply then click Reply. +modify_forums_properties=Modify Forum Space Properties forums_props=Forum Space Properties +modify_forum_properties=Modify Forum Properties forum_props=Forum Properties topic_props=Topic Properties +modify_topic_properties=Modify Topic Properties create_forums_finish=To create the forum space click Create Forum Space. create_forum_finish=To create the forum click Create Forum. create_topic_finish=To create the topic click Create Topic. @@ -338,7 +344,7 @@ bubble_view=Bubble View replies=Replies on=On reply_message=Reply Message -edit_forums_description=Modify the forums space properties then click OK. +edit_forums_description=Modify the forum space properties then click OK. edit_forum_description=Modify the forum properties then click OK. edit_topic_description=Modify the topic properties then click OK. edit_post_description=Modify the message then click OK. @@ -522,6 +528,7 @@ select_category=Select a category selected_categories=Selected categories no_selected_categories=No categories selected. success_ownership=Successfully took ownership of the object. +success_unlock=Successfully unlocked the document. inherit_permissions=Inherit Parent Space Permissions success_inherit_permissions=Successfully changed Inherit Parent Permissions to 'Yes' success_not_inherit_permissions=Successfully changed Inherit Parent Permissions to 'No' diff --git a/config/alfresco/web-client-config-actions.xml b/config/alfresco/web-client-config-actions.xml index 6aa20cc859..406f207f15 100644 --- a/config/alfresco/web-client-config-actions.xml +++ b/config/alfresco/web-client-config-actions.xml @@ -396,6 +396,17 @@ #{SpaceDetailsBean.takeOwnership} + + + + Unlock + + org.alfresco.web.action.evaluator.UnlockDocEvaluator + unlock + /images/icons/unlock.gif + #{DocumentDetailsBean.unlock} + + @@ -560,6 +571,7 @@ + diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index 2e95fbe78b..935a75351d 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -12,7 +12,7 @@ @@ -25,6 +25,50 @@ managed-bean="EditContentPropertiesDialog" icon="/images/icons/details_large.gif" title-id="modify_content_properties" description-id="edit_content_description" /> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/alfresco/web-client-config-forum-actions.xml b/config/alfresco/web-client-config-forum-actions.xml index 6f9cbf0945..6ce65784fd 100644 --- a/config/alfresco/web-client-config-forum-actions.xml +++ b/config/alfresco/web-client-config-forum-actions.xml @@ -36,7 +36,8 @@ org.alfresco.web.action.evaluator.CreateForumNodeEvaluator start_discussion /images/icons/create_forum.gif - #{CreateDiscussionDialog.startWizard} + dialog:createDiscussion + #{DialogManager.setupParameters} #{actionContext.id} @@ -50,7 +51,6 @@ create_forums /images/icons/create_forums.gif dialog:createForums - #{CreateForumsDialog.startWizard} @@ -61,7 +61,6 @@ create_forum /images/icons/create_forum.gif dialog:createForum - #{CreateForumDialog.startWizard} @@ -100,7 +99,6 @@ create_topic /images/icons/create_topic.gif dialog:createTopic - #{CreateTopicDialog.startWizard} @@ -125,7 +123,6 @@ post_to_topic /images/icons/create_post.gif dialog:createPost - #{CreatePostDialog.startWizard} @@ -136,7 +133,7 @@ post_reply /images/icons/post_reply.gif dialog:createReply - #{CreateReplyDialog.startWizard} + #{BrowseBean.setupContentAction} #{actionContext.id} @@ -150,7 +147,7 @@ edit_post /images/icons/edit_post.gif dialog:editPost - #{EditPostDialog.startWizardForEdit} + #{BrowseBean.setupContentAction} #{actionContext.id} diff --git a/config/alfresco/web-client-config-properties.xml b/config/alfresco/web-client-config-properties.xml index 2c852cd6c1..ab99cb3aee 100644 --- a/config/alfresco/web-client-config-properties.xml +++ b/config/alfresco/web-client-config-properties.xml @@ -16,8 +16,9 @@ + - @@ -26,6 +27,8 @@ + @@ -33,6 +36,8 @@ + @@ -40,6 +45,8 @@ + diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index 37945d35a2..d8c5757dc7 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -81,7 +81,7 @@ org.alfresco.web.ui.common.renderer.data.RichListRenderer$DetailsViewRenderer org.alfresco.web.ui.common.renderer.data.RichListRenderer$IconViewRenderer org.alfresco.web.ui.common.renderer.data.RichListRenderer$ListViewRenderer - org.alfresco.web.bean.ForumsBean$TopicBubbleViewRenderer + org.alfresco.web.bean.forums.ForumsBean$TopicBubbleViewRenderer diff --git a/source/java/org/alfresco/web/action/evaluator/UnlockDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/UnlockDocEvaluator.java new file mode 100644 index 0000000000..11020467c2 --- /dev/null +++ b/source/java/org/alfresco/web/action/evaluator/UnlockDocEvaluator.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * 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.alfresco.web.action.evaluator; + +import org.alfresco.web.action.ActionEvaluator; +import org.alfresco.web.bean.repository.Node; + +/** + * UI Action Evaluator - Unlock a locked document. + * + * @author Kevin Roast + */ +public final class UnlockDocEvaluator implements ActionEvaluator +{ + /** + * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) + */ + public boolean evaluate(Node node) + { + return (node.isLocked() == true); + } +} diff --git a/source/java/org/alfresco/web/app/servlet/CommandServlet.java b/source/java/org/alfresco/web/app/servlet/CommandServlet.java index 3b49327adc..5d10139c1a 100644 --- a/source/java/org/alfresco/web/app/servlet/CommandServlet.java +++ b/source/java/org/alfresco/web/app/servlet/CommandServlet.java @@ -84,14 +84,14 @@ public class CommandServlet extends BaseServlet return; } + uri = uri.substring(req.getContextPath().length()); StringTokenizer t = new StringTokenizer(uri, "/"); int tokenCount = t.countTokens(); - if (tokenCount < 4) + if (tokenCount < 3) { throw new IllegalArgumentException("Command Servlet URL did not contain all required args: " + uri); } - t.nextToken(); // skip web app name t.nextToken(); // skip servlet name // get the command processor to execute the command e.g. "workflow" @@ -101,8 +101,8 @@ public class CommandServlet extends BaseServlet String command = t.nextToken(); // get any remaining uri elements to pass to the processor - String[] args = new String[tokenCount - 4]; - for (int i=0; i= 8) + if (tokenCount >= 7) { storeRef = new StoreRef(t.nextToken(), t.nextToken()); templateRef = new NodeRef(storeRef, t.nextToken()); @@ -165,7 +168,7 @@ public class TemplateContentServlet extends BaseServlet } // create the model - put the supplied noderef in as space/document as appropriate - Object model = getModel(serviceRegistry, req, res, nodeRef); + Object model = getModel(serviceRegistry, req, nodeRef); // process the template against the node content directly to the response output stream // assuming the repo is capable of streaming in chunks, this should allow large files @@ -214,12 +217,12 @@ public class TemplateContentServlet extends BaseServlet * 'person' and also includes the node specified on the servlet URL as 'space' and 'document' * * @param services ServiceRegistry required for TemplateNode construction - * @param session HttpSession for accessing current User + * @param req Http request - for accessing Session and url args * @param nodeRef NodeRef of the space/document to process template against * * @return an object model ready for executing template against */ - private Object getModel(ServiceRegistry services, HttpServletRequest req, HttpServletResponse res, NodeRef nodeRef) + private Object getModel(ServiceRegistry services, HttpServletRequest req, NodeRef nodeRef) { // build FreeMarker default model and merge Map root = DefaultModelHelper.buildDefaultModel(services, Application.getCurrentUser(req.getSession())); @@ -229,6 +232,16 @@ public class TemplateContentServlet extends BaseServlet root.put("space", node); root.put("document", node); + // add URL arguments as a map called 'args' to the root of the model + Map args = new HashMap(8, 1.0f); + Enumeration names = req.getParameterNames(); + while (names.hasMoreElements()) + { + String name = (String)names.nextElement(); + args.put(name, req.getParameter(name)); + } + root.put("args", args); + return root; } diff --git a/source/java/org/alfresco/web/app/servlet/command/CommandProcessor.java b/source/java/org/alfresco/web/app/servlet/command/CommandProcessor.java index 1a68c69eab..17e3701c13 100644 --- a/source/java/org/alfresco/web/app/servlet/command/CommandProcessor.java +++ b/source/java/org/alfresco/web/app/servlet/command/CommandProcessor.java @@ -18,6 +18,7 @@ package org.alfresco.web.app.servlet.command; import java.io.PrintWriter; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.alfresco.service.ServiceRegistry; @@ -60,10 +61,10 @@ public interface CommandProcessor * exception should be thrown to indicate this. * * @param serviceRegistry ServiceRegistry - * @param session HttpSession + * @param request HttpServletRequest * @param command Name of the command to construct and execute */ - public void process(ServiceRegistry serviceRegistry, HttpSession session, String command); + public void process(ServiceRegistry serviceRegistry, HttpServletRequest request, String command); /** * Output a simple status message to the supplied PrintWriter. diff --git a/source/java/org/alfresco/web/app/servlet/command/ExecuteScriptCommand.java b/source/java/org/alfresco/web/app/servlet/command/ExecuteScriptCommand.java index f0c139e8b5..1d01ed4763 100644 --- a/source/java/org/alfresco/web/app/servlet/command/ExecuteScriptCommand.java +++ b/source/java/org/alfresco/web/app/servlet/command/ExecuteScriptCommand.java @@ -39,8 +39,9 @@ public final class ExecuteScriptCommand implements Command public static final String PROP_SCRIPT = "script"; public static final String PROP_DOCUMENT = "document"; public static final String PROP_USERPERSON = "person"; + public static final String PROP_ARGS = "args"; - private static final String[] PROPERTIES = new String[] {PROP_SCRIPT, PROP_DOCUMENT, PROP_USERPERSON}; + private static final String[] PROPERTIES = new String[] {PROP_SCRIPT, PROP_DOCUMENT, PROP_USERPERSON, PROP_ARGS}; /** @@ -90,6 +91,9 @@ public final class ExecuteScriptCommand implements Command spaceRef, DefaultModelHelper.imageResolver); + // add the url arguments map + model.put("args", properties.get(PROP_ARGS)); + // execute the script and return the result return serviceRegistry.getScriptService().executeScript(scriptRef, null, model); } diff --git a/source/java/org/alfresco/web/app/servlet/command/ScriptCommandProcessor.java b/source/java/org/alfresco/web/app/servlet/command/ScriptCommandProcessor.java index 458a1cda92..ab6e2293e2 100644 --- a/source/java/org/alfresco/web/app/servlet/command/ScriptCommandProcessor.java +++ b/source/java/org/alfresco/web/app/servlet/command/ScriptCommandProcessor.java @@ -17,12 +17,14 @@ package org.alfresco.web.app.servlet.command; import java.io.PrintWriter; +import java.util.Enumeration; import java.util.HashMap; import java.util.Map; -import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpServletRequest; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.repo.jscript.ScriptableHashMap; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.StoreRef; @@ -83,16 +85,27 @@ public final class ScriptCommandProcessor implements CommandProcessor } /** - * @see org.alfresco.web.app.servlet.command.CommandProcessor#process(org.alfresco.service.ServiceRegistry, java.lang.String) + * @see org.alfresco.web.app.servlet.command.CommandProcessor#process(org.alfresco.service.ServiceRegistry, javax.servlet.http.HttpServletRequest, java.lang.String) */ - public void process(ServiceRegistry serviceRegistry, HttpSession session, String command) + public void process(ServiceRegistry serviceRegistry, HttpServletRequest request, String command) { - Map properties = new HashMap(2, 1.0f); + Map properties = new HashMap(4, 1.0f); + properties.put(ExecuteScriptCommand.PROP_SCRIPT, this.scriptRef); properties.put(ExecuteScriptCommand.PROP_DOCUMENT, this.docRef); - User user = Application.getCurrentUser(session); + User user = Application.getCurrentUser(request.getSession()); properties.put(ExecuteScriptCommand.PROP_USERPERSON, user.getPerson()); + // add URL arguments as a special Scriptable Map property called 'args' + Map args = new ScriptableHashMap(); + Enumeration names = request.getParameterNames(); + while (names.hasMoreElements()) + { + String name = (String)names.nextElement(); + args.put(name, request.getParameter(name)); + } + properties.put(ExecuteScriptCommand.PROP_ARGS, args); + Command cmd = CommandFactory.getInstance().createCommand(command); if (cmd == null) { diff --git a/source/java/org/alfresco/web/app/servlet/command/WorkflowCommandProcessor.java b/source/java/org/alfresco/web/app/servlet/command/WorkflowCommandProcessor.java index 05bf786b6a..8ec1110c3b 100644 --- a/source/java/org/alfresco/web/app/servlet/command/WorkflowCommandProcessor.java +++ b/source/java/org/alfresco/web/app/servlet/command/WorkflowCommandProcessor.java @@ -20,6 +20,7 @@ import java.io.PrintWriter; import java.util.HashMap; import java.util.Map; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.alfresco.error.AlfrescoRuntimeException; @@ -44,9 +45,9 @@ public final class WorkflowCommandProcessor extends BaseNodeCommandProcessor } /** - * @see org.alfresco.web.app.servlet.command.CommandProcessor#process(org.alfresco.service.ServiceRegistry, java.lang.String) + * @see org.alfresco.web.app.servlet.command.CommandProcessor#process(org.alfresco.service.ServiceRegistry, javax.servlet.http.HttpServletRequest, java.lang.String) */ - public void process(ServiceRegistry serviceRegistry, HttpSession session, String command) + public void process(ServiceRegistry serviceRegistry, HttpServletRequest request, String command) { Map properties = new HashMap(1, 1.0f); // all workflow commands use a "target" Node property as an argument diff --git a/source/java/org/alfresco/web/bean/BaseDetailsBean.java b/source/java/org/alfresco/web/bean/BaseDetailsBean.java index 9c464bab11..65795a5cce 100644 --- a/source/java/org/alfresco/web/bean/BaseDetailsBean.java +++ b/source/java/org/alfresco/web/bean/BaseDetailsBean.java @@ -334,6 +334,8 @@ public abstract class BaseDetailsBean String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc); fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg); + getNode().reset(); + // commit the transaction tx.commit(); } diff --git a/source/java/org/alfresco/web/bean/BrowseBean.java b/source/java/org/alfresco/web/bean/BrowseBean.java index 2a0e5ae3bc..fa47921571 100644 --- a/source/java/org/alfresco/web/bean/BrowseBean.java +++ b/source/java/org/alfresco/web/bean/BrowseBean.java @@ -48,7 +48,6 @@ import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.search.ResultSetRow; import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchService; -import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.web.app.AlfrescoNavigationHandler; @@ -62,7 +61,7 @@ import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.NodePropertyResolver; import org.alfresco.web.bean.repository.QNameNodeMap; import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.bean.wizard.NewSpaceWizard; +import org.alfresco.web.bean.spaces.CreateSpaceWizard; import org.alfresco.web.config.ViewsConfigElement; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils.URLMode; @@ -950,7 +949,7 @@ public class BrowseBean implements IContextListener public Object get(Node node) { QNameNodeMap props = (QNameNodeMap)node.getProperties(); String icon = (String)props.getRaw("app:icon"); - return (icon != null ? icon : NewSpaceWizard.SPACE_ICON_DEFAULT); + return (icon != null ? icon : CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME); } }; @@ -1083,7 +1082,6 @@ public class BrowseBean implements IContextListener { // user can either select a descendant of a node display on the page which means we // must add the it's parent and itself to the breadcrumb - List location = this.navigator.getLocation(); ChildAssociationRef parentAssocRef = nodeService.getPrimaryParent(nodeRef); if (logger.isDebugEnabled()) diff --git a/source/java/org/alfresco/web/bean/DocumentDetailsBean.java b/source/java/org/alfresco/web/bean/DocumentDetailsBean.java index ca259212fd..1a6065b437 100644 --- a/source/java/org/alfresco/web/bean/DocumentDetailsBean.java +++ b/source/java/org/alfresco/web/bean/DocumentDetailsBean.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; @@ -64,6 +65,7 @@ public class DocumentDetailsBean extends BaseDetailsBean private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories"; private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied"; + private static final String MSG_SUCCESS_UNLOCK = "success_unlock"; private static final String MSG_ERROR_ASPECT_INLINEEDITABLE = "error_aspect_inlineeditable"; private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning"; private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify"; @@ -820,6 +822,41 @@ public class DocumentDetailsBean extends BaseDetailsBean } } + /** + * Action Handler to unlock a locked document + */ + public void unlock(ActionEvent event) + { + FacesContext fc = FacesContext.getCurrentInstance(); + + UserTransaction tx = null; + + try + { + tx = Repository.getUserTransaction(fc); + tx.begin(); + + this.lockService.unlock(getNode().getNodeRef()); + + String msg = Application.getMessage(fc, MSG_SUCCESS_UNLOCK); + FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg); + String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc); + fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg); + + getNode().reset(); + + // commit the transaction + tx.commit(); + } + catch (Throwable e) + { + // rollback the transaction + try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} + Utils.addErrorMessage(MessageFormat.format(Application.getMessage( + fc, Repository.ERROR_GENERIC), e.getMessage()), e); + } + } + /** * Applies the inlineeditable aspect to the current document */ diff --git a/source/java/org/alfresco/web/bean/NavigationBean.java b/source/java/org/alfresco/web/bean/NavigationBean.java index d5dddd6139..897aff4c8e 100644 --- a/source/java/org/alfresco/web/bean/NavigationBean.java +++ b/source/java/org/alfresco/web/bean/NavigationBean.java @@ -47,7 +47,7 @@ import org.alfresco.web.app.context.UIContextService; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.User; -import org.alfresco.web.bean.wizard.NewSpaceWizard; +import org.alfresco.web.bean.spaces.CreateSpaceWizard; import org.alfresco.web.config.ClientConfigElement; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.component.IBreadcrumbHandler; @@ -305,6 +305,7 @@ public class NavigationBean * * @return model containing current current space info. */ + @SuppressWarnings("unchecked") public Map getTemplateModel() { HashMap model = new HashMap(1, 1.0f); @@ -375,7 +376,7 @@ public class NavigationBean props = node.getProperties(); } String icon = (String)props.get("app:icon"); - props.put("icon", icon != null ? icon : NewSpaceWizard.SPACE_ICON_DEFAULT); + props.put("icon", icon != null ? icon : CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME); Path path = this.nodeService.getPath(nodeRef); // resolve CIFS network folder location for this node @@ -617,6 +618,7 @@ public class NavigationBean /** * @see org.alfresco.web.ui.common.component.IBreadcrumbHandler#navigationOutcome(org.alfresco.web.ui.common.component.UIBreadcrumb) */ + @SuppressWarnings("unchecked") public String navigationOutcome(UIBreadcrumb breadcrumb) { // set the current node to the specified top level node ID diff --git a/source/java/org/alfresco/web/bean/TrashcanBean.java b/source/java/org/alfresco/web/bean/TrashcanBean.java index 763a9d6c45..85e5d7c6cd 100644 --- a/source/java/org/alfresco/web/bean/TrashcanBean.java +++ b/source/java/org/alfresco/web/bean/TrashcanBean.java @@ -53,7 +53,7 @@ import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.NodePropertyResolver; import org.alfresco.web.bean.repository.QNameNodeMap; import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.bean.wizard.NewSpaceWizard; +import org.alfresco.web.bean.spaces.CreateSpaceWizard; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils.URLMode; import org.alfresco.web.ui.common.component.UIActionLink; @@ -531,7 +531,7 @@ public class TrashcanBean implements IContextListener public Object get(Node node) { QNameNodeMap props = (QNameNodeMap)node.getProperties(); String icon = (String)props.getRaw("app:icon"); - return "/images/icons/" + (icon != null ? icon : NewSpaceWizard.SPACE_ICON_DEFAULT) + ".gif"; + return "/images/icons/" + (icon != null ? icon : CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME) + ".gif"; } }; @@ -949,6 +949,7 @@ public class TrashcanBean implements IContextListener /** * @return the search query to use when displaying the list of deleted items */ + @SuppressWarnings("deprecation") private String buildSearchQuery() { String query; diff --git a/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java b/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java index fe5bbe4163..cef45fff85 100644 --- a/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java +++ b/source/java/org/alfresco/web/bean/clipboard/ClipboardBean.java @@ -306,9 +306,10 @@ public class ClipboardBean if (logger.isDebugEnabled()) logger.debug("Attempting to copy node ID: " + item.Node.getId() + " into node ID: " + destRef.getId()); - if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT)) + if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT) || + dd.isSubClass(item.Node.getType(), ContentModel.TYPE_FOLDER)) { - // call the node ops service to initiate the copy + // copy the file/folder this.fileFolderService.copy( item.Node.getNodeRef(), destRef, @@ -316,6 +317,7 @@ public class ClipboardBean } else { + // copy the node this.copyService.copy( item.Node.getNodeRef(), destRef, @@ -330,13 +332,14 @@ public class ClipboardBean if (logger.isDebugEnabled()) logger.debug("Attempting to move node ID: " + item.Node.getId() + " into node ID: " + destRef.getId()); - if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT)) + if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_CONTENT) || + dd.isSubClass(item.Node.getType(), ContentModel.TYPE_FOLDER)) { - // move the node + // move the file/folder this.fileFolderService.move( item.Node.getNodeRef(), destRef, - name); // TODO: could add "Copy of ..." here if move fails + name); } else { diff --git a/source/java/org/alfresco/web/bean/wizard/NewDiscussionWizard.java b/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java similarity index 70% rename from source/java/org/alfresco/web/bean/wizard/NewDiscussionWizard.java rename to source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java index 7134a0ba81..8d42b33b30 100644 --- a/source/java/org/alfresco/web/bean/wizard/NewDiscussionWizard.java +++ b/source/java/org/alfresco/web/bean/forums/CreateDiscussionDialog.java @@ -1,21 +1,4 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; +package org.alfresco.web.bean.forums; import java.io.Serializable; import java.text.MessageFormat; @@ -23,7 +6,6 @@ import java.util.HashMap; import java.util.Map; import javax.faces.context.FacesContext; -import javax.faces.event.ActionEvent; import javax.transaction.UserTransaction; import org.alfresco.error.AlfrescoRuntimeException; @@ -36,35 +18,64 @@ import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.ui.common.Utils; -import org.alfresco.web.ui.common.component.UIActionLink; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** - * Backing bean class used to create discussions for documents + * Bean implementation for the "Create Discusssion Dialog". * * @author gavinc */ -public class NewDiscussionWizard extends NewTopicWizard +public class CreateDiscussionDialog extends CreateTopicDialog { - private static final Log logger = LogFactory.getLog(NewDiscussionWizard.class); + protected NodeRef discussingNodeRef; + + private static final Log logger = LogFactory.getLog(CreateDiscussionDialog.class); + + // ------------------------------------------------------------------------------ + // Wizard implementation - private NodeRef discussingNodeRef; - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizard(javax.faces.event.ActionEvent) - */ @Override - public void startWizard(ActionEvent event) + public void init(Map parameters) { - UIActionLink link = (UIActionLink)event.getComponent(); - Map params = link.getParameterMap(); - String id = params.get("id"); + super.init(parameters); + + // get the id of the node we are creating the discussion for + String id = parameters.get("id"); if (id == null || id.length() == 0) { - throw new AlfrescoRuntimeException("startDiscussion called without an id"); + throw new AlfrescoRuntimeException("createDiscussion called without an id"); } + // create the topic to hold the discussions + createTopic(id); + } + + @Override + public String cancel() + { + // if the user cancels the creation of a discussion all the setup that was done + // when the dialog started needs to be undone i.e. removing the created forum + // and the discussable aspect + deleteTopic(); + + // as we are cancelling the creation of a discussion we know we need to go back + // to the browse screen, this also makes sure we don't end up in the forum that + // just got deleted! + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse"; + } + + // ------------------------------------------------------------------------------ + // Helper methods + + /** + * Creates a topic for the node with the given id + * + * @param id The id of the node to discuss + */ + protected void createTopic(String id) + { FacesContext context = FacesContext.getCurrentInstance(); UserTransaction tx = null; NodeRef forumNodeRef = null; @@ -78,7 +89,7 @@ public class NewDiscussionWizard extends NewTopicWizard if (this.nodeService.hasAspect(this.discussingNodeRef, ForumModel.ASPECT_DISCUSSABLE)) { - throw new AlfrescoRuntimeException("startDiscussion called for an object that already has a discussion!"); + throw new AlfrescoRuntimeException("createDiscussion called for an object that already has a discussion!"); } // add the discussable aspect @@ -123,23 +134,14 @@ public class NewDiscussionWizard extends NewTopicWizard if (forumNodeRef != null) { this.browseBean.clickSpace(forumNodeRef); - - // now initialise the wizard and navigate to it - super.startWizard(event); - context.getApplication().getNavigationHandler().handleNavigation(context, null, "dialog:createDiscussion"); } } - + /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() + * Deletes the setup performed during the initialisation of the dialog. */ - @Override - public String cancel() + protected void deleteTopic() { - // if we cancel the creation of a discussion all the setup that was done - // when the wizard started needs to be undone i.e. removing the created forum - // and the discussable aspect - FacesContext context = FacesContext.getCurrentInstance(); UserTransaction tx = null; @@ -165,16 +167,5 @@ public class NewDiscussionWizard extends NewTopicWizard Utils.addErrorMessage(MessageFormat.format(Application.getMessage( context, Repository.ERROR_GENERIC), e.getMessage()), e); } - - // do cancel processing - super.cancel(); - - // as we are cancelling the creation of a discussion we know we need to go back - // to the browse screen, this also makes sure we don't end up in the forum that - // just got deleted! - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + - AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse"; } - - } diff --git a/source/java/org/alfresco/web/bean/forums/CreateForumDialog.java b/source/java/org/alfresco/web/bean/forums/CreateForumDialog.java new file mode 100644 index 0000000000..643e9d9451 --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/CreateForumDialog.java @@ -0,0 +1,34 @@ +package org.alfresco.web.bean.forums; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ForumModel; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.spaces.CreateSpaceDialog; + +/** + * Bean used to implement the "Create Forum Dialog". + * + * @author gavinc + */ +public class CreateForumDialog extends CreateSpaceDialog +{ + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + this.spaceType = ForumModel.TYPE_FORUM.toString(); + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "create_forum"); + } +} diff --git a/source/java/org/alfresco/web/bean/forums/CreateForumsDialog.java b/source/java/org/alfresco/web/bean/forums/CreateForumsDialog.java new file mode 100644 index 0000000000..0bc2d8dd1e --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/CreateForumsDialog.java @@ -0,0 +1,34 @@ +package org.alfresco.web.bean.forums; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ForumModel; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.spaces.CreateSpaceDialog; + +/** + * Bean used to implement the "Create Forums Dialog". + * + * @author gavinc + */ +public class CreateForumsDialog extends CreateSpaceDialog +{ + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + this.spaceType = ForumModel.TYPE_FORUMS.toString(); + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "create_forums"); + } +} diff --git a/source/java/org/alfresco/web/bean/forums/CreatePostDialog.java b/source/java/org/alfresco/web/bean/forums/CreatePostDialog.java new file mode 100644 index 0000000000..e71ab4c8bd --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/CreatePostDialog.java @@ -0,0 +1,54 @@ +package org.alfresco.web.bean.forums; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ForumModel; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.content.CreateContentWizard; +import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.ui.common.Utils; + +/** + * Bean implementation of the "New Post Dialog". + * + * @author gavinc + */ +public class CreatePostDialog extends CreateContentWizard +{ + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + // set up for creating a post + this.objectType = ForumModel.TYPE_POST.toString(); + + // make sure we don't show the edit properties dialog after creation + this.showOtherProperties = false; + } + + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + // create appropriate values for filename and content type + this.fileName = ForumsBean.createPostFileName(); + this.mimeType = Repository.getMimeTypeForFileName( + FacesContext.getCurrentInstance(), this.fileName); + + // remove link breaks and replace with
+ this.content = Utils.replaceLineBreaks(this.content); + + return super.finishImpl(context, outcome); + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "post"); + } +} diff --git a/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java b/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java new file mode 100644 index 0000000000..6eb6c0c471 --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/CreateReplyDialog.java @@ -0,0 +1,93 @@ +package org.alfresco.web.bean.forums; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.repository.ContentReader; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.web.app.Application; +import org.alfresco.web.ui.common.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean implementation of the "Create Reply Dialog". + * + * @author gavinc + */ +public class CreateReplyDialog extends CreatePostDialog +{ + protected String replyContent = null; + + private static final Log logger = LogFactory.getLog(CreateReplyDialog.class); + + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + this.replyContent = null; + } + + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + // remove link breaks and replace with
+ this.content = Utils.replaceLineBreaks(this.content); + + super.finishImpl(context, outcome); + + // setup the referencing aspect with the references association + // between the new post and the one being replied to + this.nodeService.addAspect(this.createdNode, ContentModel.ASPECT_REFERENCING, null); + this.nodeService.createAssociation(this.createdNode, this.browseBean.getDocument().getNodeRef(), + ContentModel.ASSOC_REFERENCES); + + if (logger.isDebugEnabled()) + { + logger.debug("created new node: " + this.createdNode); + logger.debug("existing node: " + this.browseBean.getDocument().getNodeRef()); + } + + return outcome; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "reply"); + } + + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + /** + * Returns the content of the post we are replying to + * + * @return The content + */ + public String getReplyContent() + { + if (this.replyContent == null) + { + // get the content reader of the node we are replying to + NodeRef replyNode = this.browseBean.getDocument().getNodeRef(); + if (replyNode != null) + { + ContentReader reader = this.contentService.getReader(replyNode, ContentModel.PROP_CONTENT); + + if (reader != null) + { + this.replyContent = reader.getContentString(); + } + } + } + + return this.replyContent; + } +} diff --git a/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java b/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java new file mode 100644 index 0000000000..5e3529d038 --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java @@ -0,0 +1,143 @@ +package org.alfresco.web.bean.forums; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ContentModel; +import org.alfresco.model.ForumModel; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; +import org.alfresco.web.app.AlfrescoNavigationHandler; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.bean.spaces.CreateSpaceDialog; +import org.alfresco.web.ui.common.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean implementation of the "Create Topic Dialog". + * + * @author gavinc + */ +public class CreateTopicDialog extends CreateSpaceDialog +{ + protected String message; + protected ContentService contentService; + + private static final Log logger = LogFactory.getLog(CreateTopicDialog.class); + + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + this.spaceType = ForumModel.TYPE_TOPIC.toString(); + this.message = null; + } + + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + super.finishImpl(context, outcome); + + // do topic specific processing + + // get the node ref of the node that will contain the content + NodeRef containerNodeRef = this.createdNode; + + // create a unique file name for the message content + String fileName = ForumsBean.createPostFileName(); + + FileInfo fileInfo = this.fileFolderService.create(containerNodeRef, + fileName, ForumModel.TYPE_POST); + NodeRef postNodeRef = fileInfo.getNodeRef(); + + if (logger.isDebugEnabled()) + logger.debug("Created post node with filename: " + fileName); + + // apply the titled aspect - title and description + Map titledProps = new HashMap(3, 1.0f); + titledProps.put(ContentModel.PROP_TITLE, fileName); + this.nodeService.addAspect(postNodeRef, ContentModel.ASPECT_TITLED, titledProps); + + if (logger.isDebugEnabled()) + logger.debug("Added titled aspect with properties: " + titledProps); + + Map editProps = new HashMap(1, 1.0f); + editProps.put(ContentModel.PROP_EDITINLINE, true); + this.nodeService.addAspect(postNodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); + + if (logger.isDebugEnabled()) + logger.debug("Added inlineeditable aspect with properties: " + editProps); + + // get a writer for the content and put the file + ContentWriter writer = contentService.getWriter(postNodeRef, ContentModel.PROP_CONTENT, true); + // set the mimetype and encoding + writer.setMimetype(Repository.getMimeTypeForFileName(context, fileName)); + writer.setEncoding("UTF-8"); + writer.putContent(Utils.replaceLineBreaks(this.message)); + + return outcome; + } + + @Override + protected String doPostCommitProcessing(FacesContext context, String outcome) + { + // if the creation was successful we need to simulate a user + // selecting the topic, the dispatching will take us to the + // correct view. + this.browseBean.clickSpace(this.createdNode); + + return outcome + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "showTopic"; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "create_topic"); + } + + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + /** + * Returns the message entered by the user for the first post + * + * @return The message for the first post + */ + public String getMessage() + { + return this.message; + } + + /** + * Sets the message + * + * @param message The message + */ + public void setMessage(String message) + { + this.message = message; + } + + // ------------------------------------------------------------------------------ + // Service Injection + + /** + * @param contentService The contentService to set. + */ + public void setContentService(ContentService contentService) + { + this.contentService = contentService; + } +} diff --git a/source/java/org/alfresco/web/bean/forums/EditPostDialog.java b/source/java/org/alfresco/web/bean/forums/EditPostDialog.java new file mode 100644 index 0000000000..fd0fa15315 --- /dev/null +++ b/source/java/org/alfresco/web/bean/forums/EditPostDialog.java @@ -0,0 +1,82 @@ +package org.alfresco.web.bean.forums; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.repository.ContentReader; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.ui.common.Utils; +import org.springframework.util.StringUtils; + +/** + * Bean implementation for the "Edit Post Dialog". + * + * @author gavinc + */ +public class EditPostDialog extends CreatePostDialog +{ + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + + // we need to remove the
tags and replace with carriage returns + // and then setup the content member variable + Node currentDocument = this.browseBean.getDocument(); + ContentReader reader = this.contentService.getReader(currentDocument.getNodeRef(), + ContentModel.PROP_CONTENT); + + if (reader != null) + { + String htmlContent = reader.getContentString(); + if (htmlContent != null) + { + this.content = StringUtils.replace(htmlContent, "
", "\r\n"); + } + } + } + + @Override + protected String finishImpl(FacesContext context, String outcome) throws Exception + { + // remove link breaks and replace with
+ this.content = Utils.replaceLineBreaks(this.content); + + // update the content + NodeRef postNode = this.browseBean.getDocument().getNodeRef(); + + // check that the name of this post does not contain the : + // character (used in previous versions), if it does rename + // the post. + String name = (String)this.nodeService.getProperty( + postNode, ContentModel.PROP_NAME); + if (name.indexOf(":") != -1) + { + String newName = name.replace(':', '-'); + this.fileFolderService.rename(postNode, newName); + } + + ContentWriter writer = this.contentService.getWriter(postNode, + ContentModel.PROP_CONTENT, true); + if (writer != null) + { + writer.putContent(this.content); + } + + return outcome; + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "ok"); + } +} diff --git a/source/java/org/alfresco/web/bean/ForumsBean.java b/source/java/org/alfresco/web/bean/forums/ForumsBean.java similarity index 99% rename from source/java/org/alfresco/web/bean/ForumsBean.java rename to source/java/org/alfresco/web/bean/forums/ForumsBean.java index 8f22646c80..3e93b12cbf 100644 --- a/source/java/org/alfresco/web/bean/ForumsBean.java +++ b/source/java/org/alfresco/web/bean/forums/ForumsBean.java @@ -14,7 +14,7 @@ * language governing permissions and limitations under the * License. */ -package org.alfresco.web.bean; +package org.alfresco.web.bean.forums; import java.io.IOException; import java.io.Writer; @@ -54,6 +54,8 @@ import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.Application; import org.alfresco.web.app.context.IContextListener; import org.alfresco.web.app.context.UIContextService; +import org.alfresco.web.bean.BrowseBean; +import org.alfresco.web.bean.NavigationBean; import org.alfresco.web.bean.repository.MapNode; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.NodePropertyResolver; diff --git a/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java b/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java index f811fefb5d..2da95f2e0a 100644 --- a/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java +++ b/source/java/org/alfresco/web/bean/rules/CreateRuleWizard.java @@ -212,6 +212,16 @@ public class CreateRuleWizard extends BaseActionWizard // ------------------------------------------------------------------------------ // Bean Getters and Setters + /** + * Determines whether the rule type drop down list should be enabled. + * + * @return false as the rule type drop down should be enabled + */ + public boolean getRuleTypeDisabled() + { + return false; + } + /** * Returns the properties for all the conditions as a JSF DataModel * diff --git a/source/java/org/alfresco/web/bean/rules/EditRuleWizard.java b/source/java/org/alfresco/web/bean/rules/EditRuleWizard.java index d4286d2961..2f066d1fd0 100644 --- a/source/java/org/alfresco/web/bean/rules/EditRuleWizard.java +++ b/source/java/org/alfresco/web/bean/rules/EditRuleWizard.java @@ -136,6 +136,19 @@ public class EditRuleWizard extends CreateRuleWizard return outcome; } + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + /** + * Determines whether the rule type drop down list should be enabled. + * + * @return true as the rule type drop down should be disabled + */ + public boolean getRuleTypeDisabled() + { + return true; + } + // ------------------------------------------------------------------------------ // Helper methods diff --git a/source/java/org/alfresco/web/bean/spaces/CreateSpaceDialog.java b/source/java/org/alfresco/web/bean/spaces/CreateSpaceDialog.java index 9d30d4e059..b22a746d33 100644 --- a/source/java/org/alfresco/web/bean/spaces/CreateSpaceDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/CreateSpaceDialog.java @@ -14,6 +14,9 @@ import org.alfresco.web.app.Application; */ public class CreateSpaceDialog extends CreateSpaceWizard { + // ------------------------------------------------------------------------------ + // Wizard implementation + @Override public String getFinishButtonLabel() { diff --git a/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java b/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java index f72775087f..ce66577e4c 100644 --- a/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java +++ b/source/java/org/alfresco/web/bean/spaces/CreateSpaceWizard.java @@ -53,6 +53,7 @@ public class CreateSpaceWizard extends BaseWizardBean protected String templateSpaceId; protected String copyPolicy; protected String name; + protected String title; protected String description; protected String templateName; protected boolean saveAsTemplate; @@ -63,6 +64,9 @@ public class CreateSpaceWizard extends BaseWizardBean // the NodeRef of the node created during finish protected NodeRef createdNode; + // ------------------------------------------------------------------------------ + // Wizard implementation + /** * Initialises the wizard */ @@ -85,7 +89,8 @@ public class CreateSpaceWizard extends BaseWizardBean this.existingSpaceId = null; this.templateSpaceId = null; this.name = null; - this.description = ""; + this.title = null; + this.description = null; this.templateName = null; this.saveAsTemplate = false; } @@ -122,7 +127,7 @@ public class CreateSpaceWizard extends BaseWizardBean // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(5); uiFacetsProps.put(ContentModel.PROP_ICON, this.icon); - uiFacetsProps.put(ContentModel.PROP_TITLE, this.name); + uiFacetsProps.put(ContentModel.PROP_TITLE, this.title); uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); @@ -141,7 +146,8 @@ public class CreateSpaceWizard extends BaseWizardBean // copy from existing NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef(); - // also need to set the new description and icon properties + // also need to set the new title, description and icon properties + this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title); this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); @@ -160,7 +166,8 @@ public class CreateSpaceWizard extends BaseWizardBean NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), this.navigator.getCurrentNodeId()); // copy from the template NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef(); - // also need to set the new description and icon properties + // also need to set the new title, description and icon properties + this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title); this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); @@ -202,6 +209,9 @@ public class CreateSpaceWizard extends BaseWizardBean return outcome; } + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + /** * @return Returns the copyPolicy. */ @@ -298,6 +308,22 @@ public class CreateSpaceWizard extends BaseWizardBean this.name = name; } + /** + * @return Returns the title. + */ + public String getTitle() + { + return title; + } + + /** + * @param title The title to set. + */ + public void setTitle(String title) + { + this.title = title; + } + /** * @return Returns the saveAsTemplate. */ @@ -642,6 +668,9 @@ public class CreateSpaceWizard extends BaseWizardBean return icons; } + // ------------------------------------------------------------------------------ + // Helper methods + /** * Formats the error message to display if an error occurs during finish processing * diff --git a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java index f2e30ea812..49bb6dfd0d 100644 --- a/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java +++ b/source/java/org/alfresco/web/bean/spaces/EditSpaceDialog.java @@ -1,36 +1,27 @@ package org.alfresco.web.bean.spaces; import java.io.Serializable; -import java.text.MessageFormat; -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import java.util.Map; import javax.faces.context.FacesContext; -import org.alfresco.config.Config; -import org.alfresco.config.ConfigElement; import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition; -import org.alfresco.service.cmr.model.FileExistsException; import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.alfresco.web.app.Application; -import org.alfresco.web.bean.dialog.BaseDialogBean; import org.alfresco.web.bean.repository.Node; -import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.ui.common.component.UIListItem; /** * Dialog bean to edit an existing space. * * @author gavinc */ -public class EditSpaceDialog extends BaseDialogBean +public class EditSpaceDialog extends CreateSpaceDialog { protected Node editableNode; @@ -41,6 +32,13 @@ public class EditSpaceDialog extends BaseDialogBean // setup the space being edited this.editableNode = this.browseBean.getActionSpace(); + this.spaceType = this.editableNode.getType().toString(); + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "ok"); } /** @@ -52,64 +50,6 @@ public class EditSpaceDialog extends BaseDialogBean { return this.editableNode; } - - /** - * Returns a list of icons to allow the user to select from. - * The list can change according to the type of space being created. - * - * @return A list of icons - */ - @SuppressWarnings("unchecked") - public List getIcons() - { - List icons = null; - - QName type = QName.createQName(this.editableNode.getType().toString()); - String typePrefixForm = type.toPrefixString(this.namespaceService); - - Config config = Application.getConfigService(FacesContext.getCurrentInstance()). - getConfig(typePrefixForm + " icons"); - if (config != null) - { - ConfigElement iconsCfg = config.getConfigElement("icons"); - if (iconsCfg != null) - { - boolean first = true; - for (ConfigElement icon : iconsCfg.getChildren()) - { - String iconName = icon.getAttribute("name"); - String iconPath = icon.getAttribute("path"); - - if (iconName != null && iconPath != null) - { - if (first) - { - icons = new ArrayList(iconsCfg.getChildCount()); - first = false; - } - - UIListItem item = new UIListItem(); - item.setValue(iconName); - item.getAttributes().put("image", iconPath); - icons.add(item); - } - } - } - } - - // if we didn't find any icons display one default choice - if (icons == null) - { - icons = new ArrayList(1); - - UIListItem item = new UIListItem(); - item.setValue("space-icon-default"); - item.getAttributes().put("image", "/images/icons/space-icon-default.gif"); - icons.add(item); - } - - return icons; - } @Override protected String finishImpl(FacesContext context, String outcome) throws Exception @@ -213,27 +153,4 @@ public class EditSpaceDialog extends BaseDialogBean return outcome; } - - /** - * Formats the error message to display if an error occurs during finish processing - * - * @param The exception - * @return The formatted message - */ - @Override - protected String formatErrorMessage(Throwable exception) - { - if (exception instanceof FileExistsException) - { - return MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), Repository.ERROR_EXISTS), - ((FileExistsException)exception).getExisting().getName()); - } - else - { - return MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), "error_space"), - exception.getMessage()); - } - } } diff --git a/source/java/org/alfresco/web/bean/wizard/AddContentWizard.java b/source/java/org/alfresco/web/bean/wizard/AddContentWizard.java deleted file mode 100644 index 7ed89fd53a..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/AddContentWizard.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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.alfresco.web.bean.wizard; - -import java.io.File; -import java.io.Serializable; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.ResourceBundle; - -import javax.faces.context.FacesContext; - -import org.alfresco.model.ContentModel; -import org.alfresco.repo.content.MimetypeMap; -import org.alfresco.repo.content.filestore.FileContentReader; -import org.alfresco.service.cmr.repository.ContentReader; -import org.alfresco.service.namespace.QName; -import org.alfresco.web.app.Application; -import org.alfresco.web.bean.FileUploadBean; -import org.alfresco.web.bean.repository.Repository; - -/** - * Handler class used by the Add Content Wizard - * - * @author gavinc - */ -public class AddContentWizard extends BaseContentWizard -{ - // TODO: retrieve these from the config service - private static final String WIZARD_TITLE_ID = "add_content_title"; - private static final String WIZARD_DESC_ID = "add_content_desc"; - private static final String STEP1_TITLE_ID = "add_conent_step1_title"; - private static final String STEP1_DESCRIPTION_ID = "add_conent_step1_desc"; - private static final String STEP2_TITLE_ID = "add_conent_step2_title"; - private static final String STEP2_DESCRIPTION_ID = "add_conent_step2_desc"; - - // add content wizard specific properties - private File file; - - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#next() - */ - public String next() - { - String outcome = super.next(); - - // if the outcome is "properties" we pre-set the content type and other - // fields accordingly - if (outcome.equals("properties")) - { - this.contentType = Repository.getMimeTypeForFileName( - FacesContext.getCurrentInstance(), this.fileName); - - // set default for in-line editing flag - this.inlineEdit = (this.contentType.equals(MimetypeMap.MIMETYPE_HTML)); - - // Try and extract metadata from the file - ContentReader cr = new FileContentReader(this.file); - cr.setMimetype(this.contentType); - // create properties for content type - Map contentProps = new HashMap(5, 1.0f); - - if (Repository.extractMetadata(FacesContext.getCurrentInstance(), cr, contentProps)) - { - this.author = (String)(contentProps.get(ContentModel.PROP_AUTHOR)); - this.title = (String)(contentProps.get(ContentModel.PROP_TITLE)); - this.description = (String)(contentProps.get(ContentModel.PROP_DESCRIPTION)); - } - if (this.title == null) - { - this.title = this.fileName; - } - } - - return outcome; - } - - /** - * Deals with the finish button being pressed - * - * @return outcome - */ - public String finish() - { - String outcome = saveContent(this.file, null); - - // now we know the new details are in the repository, reset the - // client side node representation so the new details are retrieved - if (this.editMode) - { - this.browseBean.getDocument().reset(); - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardDescription() - */ - public String getWizardDescription() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_DESC_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardTitle() - */ - public String getWizardTitle() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_TITLE_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepDescription() - */ - public String getStepDescription() - { - String stepDesc = null; - - switch (this.currentStep) - { - case 1: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_DESCRIPTION_ID); - break; - } - case 2: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_DESCRIPTION_ID); - break; - } - case 3: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_DESCRIPTION_ID); - break; - } - default: - { - stepDesc = ""; - } - } - - return stepDesc; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepTitle() - */ - public String getStepTitle() - { - String stepTitle = null; - - switch (this.currentStep) - { - case 1: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_TITLE_ID); - break; - } - case 2: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_TITLE_ID); - break; - } - case 3: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_TITLE_ID); - break; - } - default: - { - stepTitle = ""; - } - } - - return stepTitle; - } - - /** - * Initialises the wizard - */ - public void init() - { - super.init(); - - clearUpload(); - - this.file = null; - } - - /** - * @return Returns the message to display when a file has been uploaded - */ - public String getFileUploadSuccessMsg() - { - String msg = Application.getMessage(FacesContext.getCurrentInstance(), "file_upload_success"); - return MessageFormat.format(msg, new Object[] {getFileName()}); - } - - /** - * @return Returns the name of the file - */ - public String getFileName() - { - // try and retrieve the file and filename from the file upload bean - // representing the file we previously uploaded. - FacesContext ctx = FacesContext.getCurrentInstance(); - FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap(). - get(FileUploadBean.FILE_UPLOAD_BEAN_NAME); - if (fileBean != null) - { - this.file = fileBean.getFile(); - this.fileName = fileBean.getFileName(); - } - - return this.fileName; - } - - /** - * @param fileName The name of the file - */ - public void setFileName(String fileName) - { - this.fileName = fileName; - - // we also need to keep the file upload bean in sync - FacesContext ctx = FacesContext.getCurrentInstance(); - FileUploadBean fileBean = (FileUploadBean)ctx.getExternalContext().getSessionMap(). - get(FileUploadBean.FILE_UPLOAD_BEAN_NAME); - if (fileBean != null) - { - fileBean.setFileName(this.fileName); - } - } - - /** - * @return Returns the summary data for the wizard. - */ - public String getSummary() - { - ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); - - return buildSummary( - new String[] {bundle.getString("file_name"), bundle.getString("type"), - bundle.getString("content_type"), bundle.getString("title"), - bundle.getString("description"), bundle.getString("author"), - bundle.getString("inline_editable")}, - new String[] {this.fileName, getSummaryObjectType(), getSummaryContentType(), this.title, - this.description, this.author, Boolean.toString(this.inlineEdit)}); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#determineOutcomeForStep(int) - */ - protected String determineOutcomeForStep(int step) - { - String outcome = null; - - switch(step) - { - case 1: - { - outcome = "upload"; - break; - } - case 2: - { - outcome = "properties"; - break; - } - case 3: - { - outcome = "summary"; - break; - } - default: - { - outcome = CANCEL_OUTCOME; - } - } - - return outcome; - } - - /** - * Deletes the uploaded file and removes the FileUploadBean from the session - */ - private void clearUpload() - { - // delete the temporary file we uploaded earlier - if (this.file != null) - { - this.file.delete(); - } - - // remove the file upload bean from the session - FacesContext ctx = FacesContext.getCurrentInstance(); - ctx.getExternalContext().getSessionMap().remove(FileUploadBean.FILE_UPLOAD_BEAN_NAME); - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/BaseContentWizard.java b/source/java/org/alfresco/web/bean/wizard/BaseContentWizard.java deleted file mode 100644 index 3dafdc1f83..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/BaseContentWizard.java +++ /dev/null @@ -1,629 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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.alfresco.web.bean.wizard; - -import java.io.File; -import java.io.Serializable; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.faces.context.FacesContext; -import javax.faces.model.SelectItem; -import javax.transaction.UserTransaction; - -import org.alfresco.config.Config; -import org.alfresco.config.ConfigElement; -import org.alfresco.config.ConfigService; -import org.alfresco.model.ContentModel; -import org.alfresco.service.ServiceRegistry; -import org.alfresco.service.cmr.dictionary.DictionaryService; -import org.alfresco.service.cmr.dictionary.TypeDefinition; -import org.alfresco.service.cmr.model.FileExistsException; -import org.alfresco.service.cmr.model.FileInfo; -import org.alfresco.service.cmr.repository.ContentData; -import org.alfresco.service.cmr.repository.ContentService; -import org.alfresco.service.cmr.repository.ContentWriter; -import org.alfresco.service.cmr.repository.MimetypeService; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.namespace.QName; -import org.alfresco.web.app.Application; -import org.alfresco.web.bean.repository.Node; -import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.data.IDataContainer; -import org.alfresco.web.data.QuickSort; -import org.alfresco.web.ui.common.Utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Base Handler class used by the Content Wizards - * - * @author gavinc kevinr - */ -public abstract class BaseContentWizard extends AbstractWizardBean -{ - private static Log logger = LogFactory.getLog(BaseContentWizard.class); - - protected static final String FINISH_INSTRUCTION_ID = "content_finish_instruction"; - - // content wizard specific attributes - protected String fileName; - protected String author; - protected String title; - protected String description; - protected String contentType; - protected String objectType; - protected boolean inlineEdit; - protected List contentTypes; - protected List objectTypes; - protected ContentService contentService; - protected DictionaryService dictionaryService; - - // the NodeRef of the node created during finish - protected NodeRef createdNode; - - /** - * Save the specified content using the currently set wizard attributes - * - * @param fileContent File content to save - * @param strContent String content to save - */ - protected String saveContent(File fileContent, String strContent) - { - String outcome = FINISH_OUTCOME; - - UserTransaction tx = null; - - try - { - FacesContext context = FacesContext.getCurrentInstance(); - tx = Repository.getUserTransaction(context); - tx.begin(); - - if (this.editMode) - { - // update the existing node in the repository - Node currentDocument = this.browseBean.getDocument(); - NodeRef nodeRef = currentDocument.getNodeRef(); - - // move the file - location and name checks will be performed - this.fileFolderService.move(nodeRef, null, this.fileName); - // set up the content data - // update the modified timestamp and other content props - Map contentProps = this.nodeService.getProperties(nodeRef); - contentProps.put(ContentModel.PROP_TITLE, this.title); - contentProps.put(ContentModel.PROP_DESCRIPTION, this.description); - - // add author property - if (this.author != null && this.author.length() != 0) - { - if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == false) - { - Map authorProps = new HashMap(1, 1.0f); - authorProps.put(ContentModel.PROP_AUTHOR, this.author); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_AUTHOR, authorProps); - } - else - { - contentProps.put(ContentModel.PROP_AUTHOR, this.author); - } - } - - // set up content properties - copy or create the compound property - ContentData contentData = (ContentData)contentProps.get(ContentModel.PROP_CONTENT); - if (contentData == null) - { - contentData = new ContentData(null, this.contentType, 0L, "UTF-8"); - } - else - { - contentData = new ContentData( - contentData.getContentUrl(), - this.contentType, - contentData.getSize(), - contentData.getEncoding()); - } - contentProps.put(ContentModel.PROP_CONTENT, contentData); - - if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INLINEEDITABLE) == false) - { - Map editProps = new HashMap(1, 1.0f); - editProps.put(ContentModel.PROP_EDITINLINE, this.inlineEdit); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); - } - else - { - contentProps.put(ContentModel.PROP_EDITINLINE, this.inlineEdit); - } - this.nodeService.setProperties(nodeRef, contentProps); - } - else - { - // get the node ref of the node that will contain the content - NodeRef containerNodeRef; - String nodeId = getNavigator().getCurrentNodeId(); - if (nodeId == null) - { - containerNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); - } - else - { - containerNodeRef = new NodeRef(Repository.getStoreRef(), nodeId); - } - - FileInfo fileInfo = fileFolderService.create( - containerNodeRef, - this.fileName, - Repository.resolveToQName(this.objectType)); - NodeRef fileNodeRef = fileInfo.getNodeRef(); - - // set the author aspect (if we have one) - if (this.author != null && this.author.length() > 0) - { - Map authorProps = new HashMap(1, 1.0f); - authorProps.put(ContentModel.PROP_AUTHOR, this.author); - this.nodeService.addAspect(fileNodeRef, ContentModel.ASPECT_AUTHOR, authorProps); - } - - if (logger.isDebugEnabled()) - logger.debug("Created file node for file: " + this.fileName); - - // apply the titled aspect - title and description - Map titledProps = new HashMap(3, 1.0f); - titledProps.put(ContentModel.PROP_TITLE, this.title); - titledProps.put(ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.addAspect(fileNodeRef, ContentModel.ASPECT_TITLED, titledProps); - - if (logger.isDebugEnabled()) - logger.debug("Added titled aspect with properties: " + titledProps); - - // apply the inlineeditable aspect - if (this.inlineEdit == true) - { - Map editProps = new HashMap(1, 1.0f); - editProps.put(ContentModel.PROP_EDITINLINE, this.inlineEdit); - this.nodeService.addAspect(fileNodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); - - if (logger.isDebugEnabled()) - logger.debug("Added inlineeditable aspect with properties: " + editProps); - } - - // get a writer for the content and put the file - ContentWriter writer = contentService.getWriter(fileNodeRef, ContentModel.PROP_CONTENT, true); - // set the mimetype and encoding - writer.setMimetype(this.contentType); - writer.setEncoding("UTF-8"); - if (fileContent != null) - { - writer.putContent(fileContent); - } - else if (strContent != null) - { - writer.putContent(strContent); - } - - // remember the created node now - this.createdNode = fileNodeRef; - } - - // give subclasses a chance to perform custom processing before committing - performCustomProcessing(); - - // commit the transaction - tx.commit(); - } - catch (FileExistsException e) - { - // rollback the transaction - try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} - // print status message - String statusMsg = MessageFormat.format( - Application.getMessage( - FacesContext.getCurrentInstance(), "error_exists"), - e.getExisting().getName()); - Utils.addErrorMessage(statusMsg); - // no outcome - outcome = null; - } - catch (Throwable e) - { - // rollback the transaction - try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} - Utils.addErrorMessage(MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e); - outcome = null; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepInstructions() - */ - public String getStepInstructions() - { - String stepInstruction = null; - - switch (this.currentStep) - { - case 3: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), FINISH_INSTRUCTION_ID); - break; - } - default: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), DEFAULT_INSTRUCTION_ID); - } - } - - return stepInstruction; - } - - /** - * Initialises the wizard - */ - public void init() - { - super.init(); - - this.fileName = null; - this.author = null; - this.title = null; - this.description = null; - this.contentType = null; - this.inlineEdit = false; - this.contentTypes = null; - this.objectTypes = null; - - this.objectType = ContentModel.TYPE_CONTENT.toString(); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#populate() - */ - public void populate() - { - // get hold of the current document and populate the appropriate values - Node currentDocument = this.browseBean.getDocument(); - Map props = currentDocument.getProperties(); - - Boolean inline = (Boolean)props.get("editInline"); - this.inlineEdit = inline != null ? inline.booleanValue() : false; - this.author = (String)props.get("creator"); - this.contentType = null; - ContentData contentData = (ContentData)props.get(ContentModel.PROP_CONTENT); - if (contentData != null) - { - this.contentType = contentData.getMimetype(); - } - this.description = (String)props.get("description"); - this.fileName = currentDocument.getName(); - this.title = (String)props.get("title"); - } - - /** - * @return Returns the contentService. - */ - public ContentService getContentService() - { - return contentService; - } - - /** - * @param contentService The contentService to set. - */ - public void setContentService(ContentService contentService) - { - this.contentService = contentService; - } - - /** - * Sets the dictionary service - * - * @param dictionaryService the dictionary service - */ - public void setDictionaryService(DictionaryService dictionaryService) - { - this.dictionaryService = dictionaryService; - } - - /** - * @return Returns the name of the file - */ - public String getFileName() - { - return this.fileName; - } - - /** - * @param fileName The name of the file - */ - public void setFileName(String fileName) - { - this.fileName = fileName; - } - - /** - * @return Returns the author - */ - public String getAuthor() - { - return this.author; - } - - /** - * @param author Sets the author - */ - public void setAuthor(String author) - { - this.author = author; - } - - /** - * @return Returns the content type currenty selected - */ - public String getContentType() - { - return this.contentType; - } - - /** - * @param contentType Sets the currently selected content type - */ - public void setContentType(String contentType) - { - this.contentType = contentType; - } - - /** - * @return Returns the object type currenty selected - */ - public String getObjectType() - { - return this.objectType; - } - - /** - * @param objectType Sets the currently selected object type - */ - public void setObjectType(String objectType) - { - this.objectType = objectType; - } - - /** - * @return Returns the description - */ - public String getDescription() - { - return this.description; - } - - /** - * @param description Sets the description - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * @return Returns the title - */ - public String getTitle() - { - return this.title; - } - - /** - * @param title Sets the title - */ - public void setTitle(String title) - { - this.title = title; - } - - /** - * @return Returns the inline edit flag. - */ - public boolean isInlineEdit() - { - return this.inlineEdit; - } - - /** - * @param inlineEdit The inline edit flag to set. - */ - public void setInlineEdit(boolean inlineEdit) - { - this.inlineEdit = inlineEdit; - } - - /** - * @return Returns a list of content types to allow the user to select from - */ - public List getContentTypes() - { - if (this.contentTypes == null) - { - this.contentTypes = new ArrayList(80); - ServiceRegistry registry = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); - MimetypeService mimetypeService = registry.getMimetypeService(); - - // get the mime type display names - Map mimeTypes = mimetypeService.getDisplaysByMimetype(); - for (String mimeType : mimeTypes.keySet()) - { - this.contentTypes.add(new SelectItem(mimeType, mimeTypes.get(mimeType))); - } - - // make sure the list is sorted by the values - QuickSort sorter = new QuickSort(this.contentTypes, "label", true, IDataContainer.SORT_CASEINSENSITIVE); - sorter.sort(); - } - - return this.contentTypes; - } - - /** - * @return Returns a list of object types to allow the user to select from - */ - public List getObjectTypes() - { - if (this.objectTypes == null) - { - FacesContext context = FacesContext.getCurrentInstance(); - - // add the well known object type to start with - this.objectTypes = new ArrayList(5); - this.objectTypes.add(new SelectItem(ContentModel.TYPE_CONTENT.toString(), - Application.getMessage(context, "content"))); - - // add any configured content sub-types to the list - ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance()); - Config wizardCfg = svc.getConfig("Content Wizards"); - if (wizardCfg != null) - { - ConfigElement typesCfg = wizardCfg.getConfigElement("content-types"); - if (typesCfg != null) - { - for (ConfigElement child : typesCfg.getChildren()) - { - QName idQName = Repository.resolveToQName(child.getAttribute("name")); - if (idQName != null) - { - TypeDefinition typeDef = this.dictionaryService.getType(idQName); - - if (typeDef != null) - { - if (this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_CONTENT)) - { - // try and get the display label from config - String label = Utils.getDisplayLabel(context, child); - - // if there wasn't a client based label try and get it from the dictionary - if (label == null) - { - label = typeDef.getTitle(); - } - - // finally, just use the localname - if (label == null) - { - label = idQName.getLocalName(); - } - - this.objectTypes.add(new SelectItem(idQName.toString(), label)); - } - else - { - logger.warn("Failed to add '" + child.getAttribute("name") + - "' to the list of content types as the type is not a subtype of cm:content"); - } - } - else - { - logger.warn("Failed to add '" + child.getAttribute("name") + - "' to the list of content types as the type is not recognised"); - } - } - } - - // make sure the list is sorted by the label - QuickSort sorter = new QuickSort(this.objectTypes, "label", true, IDataContainer.SORT_CASEINSENSITIVE); - sorter.sort(); - } - else - { - logger.warn("Could not find 'content-types' configuration element"); - } - } - else - { - logger.warn("Could not find 'Content Wizards' configuration section"); - } - - } - - return this.objectTypes; - } - - /** - * @return Determines whether the next and finish button should be enabled - */ - public boolean getNextFinishDisabled() - { - boolean disabled = false; - - if (this.fileName == null || this.fileName.length() == 0 || - this.title == null || this.title.length() == 0 || - this.contentType == null) - { - disabled = true; - } - - return disabled; - } - - /** - * Returns the display label for the content type currently chosen - * - * @return The human readable version of the content type - */ - protected String getSummaryContentType() - { - ServiceRegistry registry = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); - MimetypeService mimetypeService = registry.getMimetypeService(); - - // get the mime type display name - Map mimeTypes = mimetypeService.getDisplaysByMimetype(); - return mimeTypes.get(this.contentType); - } - - /** - * Returns the display label for the currently selected object type - * - * @return The objevt type label - */ - protected String getSummaryObjectType() - { - String objType = null; - - for (SelectItem item : this.getObjectTypes()) - { - if (item.getValue().equals(this.objectType)) - { - objType = item.getLabel(); - break; - } - } - - return objType; - } - - /** - * Performs any processing sub classes may wish to do before commit is called - */ - protected void performCustomProcessing() throws Exception - { - // used by subclasses if necessary - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/CreateContentWizard.java b/source/java/org/alfresco/web/bean/wizard/CreateContentWizard.java deleted file mode 100644 index c415d20d3d..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/CreateContentWizard.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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.alfresco.web.bean.wizard; - -import java.util.ResourceBundle; - -import javax.faces.context.FacesContext; -import javax.faces.event.ValueChangeEvent; - -import org.alfresco.web.app.Application; -import org.alfresco.web.bean.repository.Repository; - -/** - * Handler class used by the Create In-line Content Wizard - * - * @author Kevin Roast - */ -public class CreateContentWizard extends BaseContentWizard -{ - protected static final String CONTENT_TEXT = "txt"; - protected static final String CONTENT_HTML = "html"; - - // TODO: retrieve these from the config service - private static final String WIZARD_TITLE_ID = "create_content_title"; - private static final String WIZARD_DESC_ID = "create_content_desc"; - private static final String STEP1_TITLE_ID = "create_content_step1_title"; - private static final String STEP1_DESCRIPTION_ID = "create_content_step1_desc"; - private static final String STEP2_TITLE_ID = "create_content_step2_title"; - private static final String STEP2_DESCRIPTION_ID = "create_content_step2_desc"; - private static final String STEP3_TITLE_ID = "create_content_step3_title"; - private static final String STEP3_DESCRIPTION_ID = "create_content_step3_desc"; - - // create content wizard specific properties - protected String content; - protected String createType = CONTENT_HTML; - - - /** - * Deals with the finish button being pressed - * - * @return outcome - */ - public String finish() - { - return saveContent(null, this.content); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardDescription() - */ - public String getWizardDescription() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_DESC_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardTitle() - */ - public String getWizardTitle() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_TITLE_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepDescription() - */ - public String getStepDescription() - { - String stepDesc = null; - - switch (this.currentStep) - { - case 1: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_DESCRIPTION_ID); - break; - } - case 2: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_DESCRIPTION_ID); - break; - } - case 3: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP3_DESCRIPTION_ID); - break; - } - case 4: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_DESCRIPTION_ID); - break; - } - default: - { - stepDesc = ""; - } - } - - return stepDesc; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepInstructions() - */ - public String getStepInstructions() - { - String stepInstruction = null; - - switch (this.currentStep) - { - case 4: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), FINISH_INSTRUCTION_ID); - break; - } - default: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), DEFAULT_INSTRUCTION_ID); - } - } - - return stepInstruction; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepTitle() - */ - public String getStepTitle() - { - String stepTitle = null; - - switch (this.currentStep) - { - case 1: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_TITLE_ID); - break; - } - case 2: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_TITLE_ID); - break; - } - case 3: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP3_TITLE_ID); - break; - } - case 4: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_TITLE_ID); - break; - } - default: - { - stepTitle = ""; - } - } - - return stepTitle; - } - - /** - * @return Returns the content from the edited form. - */ - public String getContent() - { - return this.content; - } - - /** - * @param content The content to edit (should be clear initially) - */ - public void setContent(String content) - { - this.content = content; - } - - /** - * Initialises the wizard - */ - public void init() - { - super.init(); - - this.content = null; - - // created content is inline editable by default - this.inlineEdit = true; - } - - /** - * @return Returns the summary data for the wizard. - */ - public String getSummary() - { - ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); - - // TODO: show first few lines of content here? - return buildSummary( - new String[] {bundle.getString("file_name"), bundle.getString("type"), - bundle.getString("content_type"), bundle.getString("title"), - bundle.getString("description"), bundle.getString("author")}, - new String[] {this.fileName, getSummaryObjectType(), getSummaryContentType(), - this.title, this.description, this.author}); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#determineOutcomeForStep(int) - */ - protected String determineOutcomeForStep(int step) - { - String outcome = null; - - switch(step) - { - case 1: - { - outcome = "select"; - break; - } - case 2: - { - if (getCreateType().equals(CONTENT_HTML)) - { - outcome = "create-html"; - } - else if (getCreateType().equals(CONTENT_TEXT)) - { - outcome = "create-text"; - } - break; - } - case 3: - { - this.fileName = "newfile." + getCreateType(); - this.contentType = Repository.getMimeTypeForFileName( - FacesContext.getCurrentInstance(), this.fileName); - this.title = this.fileName; - - outcome = "properties"; - break; - } - case 4: - { - outcome = "summary"; - break; - } - default: - { - outcome = CANCEL_OUTCOME; - } - } - - return outcome; - } - - /** - * Create content type value changed by the user - */ - public void createContentChanged(ValueChangeEvent event) - { - // clear the content as HTML is not compatible with the plain text box etc. - this.content = null; - } - - /** - * @return Returns the createType. - */ - public String getCreateType() - { - return this.createType; - } - - /** - * @param createType The createType to set. - */ - public void setCreateType(String createType) - { - this.createType = createType; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewForumWizard.java b/source/java/org/alfresco/web/bean/wizard/NewForumWizard.java deleted file mode 100644 index 09b9dc7ccf..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewForumWizard.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; - -import org.alfresco.model.ForumModel; -import org.alfresco.web.app.AlfrescoNavigationHandler; - -/** - * Wizard bean used for creating and editing forum spaces - * - * @author gavinc - */ -public class NewForumWizard extends NewSpaceWizard -{ - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#init() - */ - public void init() - { - super.init(); - - this.spaceType = ForumModel.TYPE_FORUM.toString(); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() - */ - @Override - public String finish() - { - String outcome = super.finish(); - - // if we had a successful outcome from the creation close the dialog - if (outcome != null); - { - outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() - */ - @Override - public String cancel() - { - super.cancel(); - - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewForumsWizard.java b/source/java/org/alfresco/web/bean/wizard/NewForumsWizard.java deleted file mode 100644 index 45501cbf0e..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewForumsWizard.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; - -import org.alfresco.model.ForumModel; -import org.alfresco.web.app.AlfrescoNavigationHandler; - -/** - * Wizard bean used for creating and editing forums spaces - * - * @author gavinc - */ -public class NewForumsWizard extends NewSpaceWizard -{ - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#init() - */ - public void init() - { - super.init(); - - this.spaceType = ForumModel.TYPE_FORUMS.toString(); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() - */ - @Override - public String finish() - { - String outcome = super.finish(); - - // if we had a successful outcome from the creation close the dialog - if (outcome != null); - { - outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() - */ - @Override - public String cancel() - { - super.cancel(); - - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java b/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java deleted file mode 100644 index 8733d49aae..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; - -import javax.faces.context.FacesContext; -import javax.faces.event.ActionEvent; - -import org.alfresco.model.ContentModel; -import org.alfresco.model.ForumModel; -import org.alfresco.service.cmr.repository.ContentReader; -import org.alfresco.service.cmr.repository.ContentWriter; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.web.app.AlfrescoNavigationHandler; -import org.alfresco.web.bean.ForumsBean; -import org.alfresco.web.bean.repository.Node; -import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.ui.common.Utils; -import org.springframework.util.StringUtils; - -/** - * Backing bean for posting forum articles. - * - * @author gavinc - */ -public class NewPostWizard extends CreateContentWizard -{ - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#init() - */ - @Override - public void init() - { - super.init(); - - // set up for creating a post - this.objectType = ForumModel.TYPE_POST.toString(); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizardForEdit(javax.faces.event.ActionEvent) - */ - @Override - public void startWizardForEdit(ActionEvent event) - { - // TODO: Allow action link to have multiple action listeners - // then we wouldn't need to have this coupling back - // to the browse bean in here - - // we need to setup the content in the browse bean first - this.browseBean.setupContentAction(event); - - super.startWizardForEdit(event); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#populate() - */ - @Override - public void populate() - { - super.populate(); - - // we need to remove the
tags and replace with carriage returns - // and then setup the content member variable - Node currentDocument = this.browseBean.getDocument(); - ContentReader reader = this.contentService.getReader(currentDocument.getNodeRef(), - ContentModel.PROP_CONTENT); - - if (reader != null) - { - String htmlContent = reader.getContentString(); - if (htmlContent != null) - { - this.content = StringUtils.replace(htmlContent, "
", "\r\n"); - } - } - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() - */ - @Override - public String finish() - { - if (this.editMode) - { - // remove the line breaks before the save - this.content = Utils.replaceLineBreaks(this.content); - } - else - { - // create appropriate values for filename and content type - this.fileName = ForumsBean.createPostFileName(); - this.contentType = Repository.getMimeTypeForFileName( - FacesContext.getCurrentInstance(), this.fileName); - - // remove link breaks and replace with
- this.content = Utils.replaceLineBreaks(this.content); - } - - String outcome = super.finish(); - - // if we had a successful outcome from the creation close the dialog - if (outcome != null); - { - outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.BaseContentWizard#performCustomProcessing() - */ - @Override - protected void performCustomProcessing() throws Exception - { - if (this.editMode) - { - // update the content - NodeRef postNode = this.browseBean.getDocument().getNodeRef(); - - // check that the name of this post does not contain the : - // character (used in previous versions), if it does rename - // the post. - String name = (String)this.nodeService.getProperty( - postNode, ContentModel.PROP_NAME); - if (name.indexOf(":") != -1) - { - String newName = name.replace(':', '-'); - this.fileFolderService.rename(postNode, newName); - } - - ContentWriter writer = this.contentService.getWriter(postNode, - ContentModel.PROP_CONTENT, true); - if (writer != null) - { - writer.putContent(this.content); - } - } - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() - */ - @Override - public String cancel() - { - super.cancel(); - - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewReplyWizard.java b/source/java/org/alfresco/web/bean/wizard/NewReplyWizard.java deleted file mode 100644 index 0a4730b7ab..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewReplyWizard.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; - -import javax.faces.event.ActionEvent; - -import org.alfresco.model.ContentModel; -import org.alfresco.service.cmr.repository.ContentReader; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.web.app.AlfrescoNavigationHandler; -import org.alfresco.web.ui.common.Utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - - -/** - * Backing bean for posting replies to forum articles. - * - * @author gavinc - */ -public class NewReplyWizard extends NewPostWizard -{ - private static Log logger = LogFactory.getLog(NewReplyWizard.class); - - private String replyContent = null; - - /** - * Returns the content of the post we are replying to - * - * @return The content - */ - public String getReplyContent() - { - if (this.replyContent == null) - { - // get the content reader of the node we are replying to - NodeRef replyNode = this.browseBean.getDocument().getNodeRef(); - if (replyNode != null) - { - ContentReader reader = this.contentService.getReader(replyNode, ContentModel.PROP_CONTENT); - - if (reader != null) - { - this.replyContent = reader.getContentString(); - } - } - } - - return this.replyContent; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#init() - */ - @Override - public void init() - { - super.init(); - - this.replyContent = null; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizard(javax.faces.event.ActionEvent) - */ - @Override - public void startWizard(ActionEvent event) - { - super.startWizard(event); - - // also setup the content in the browse bean - this.browseBean.setupContentAction(event); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() - */ - @Override - public String finish() - { - // remove link breaks and replace with
- this.content = Utils.replaceLineBreaks(this.content); - - String outcome = super.finish(); - - // if we had a successful outcome from the creation close the dialog - if (outcome != null); - { - outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.BaseContentWizard#performCustomProcessing() - */ - @Override - protected void performCustomProcessing() - { - if (this.editMode == false) - { - // setup the referencing aspect with the references association - // between the new post and the one being replied to - this.nodeService.addAspect(this.createdNode, ContentModel.ASPECT_REFERENCING, null); - this.nodeService.createAssociation(this.createdNode, this.browseBean.getDocument().getNodeRef(), - ContentModel.ASSOC_REFERENCES); - - if (logger.isDebugEnabled()) - { - logger.debug("created new node: " + this.createdNode); - logger.debug("existing node: " + this.browseBean.getDocument().getNodeRef()); - } - } - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() - */ - @Override - public String cancel() - { - super.cancel(); - - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewSpaceWizard.java b/source/java/org/alfresco/web/bean/wizard/NewSpaceWizard.java deleted file mode 100644 index f851e6ce87..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewSpaceWizard.java +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the Mozilla Public License version 1.1 - * with a permitted attribution clause. You may obtain a - * copy of the License at - * - * http://www.alfresco.org/legal/license.txt - * - * 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.alfresco.web.bean.wizard; - -import java.io.Serializable; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.ResourceBundle; - -import javax.faces.application.FacesMessage; -import javax.faces.context.FacesContext; -import javax.faces.model.SelectItem; -import javax.transaction.UserTransaction; - -import org.alfresco.config.Config; -import org.alfresco.config.ConfigElement; -import org.alfresco.model.ContentModel; -import org.alfresco.service.cmr.dictionary.DictionaryService; -import org.alfresco.service.cmr.dictionary.TypeDefinition; -import org.alfresco.service.cmr.model.FileExistsException; -import org.alfresco.service.cmr.model.FileInfo; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.cmr.search.SearchService; -import org.alfresco.service.namespace.DynamicNamespacePrefixResolver; -import org.alfresco.service.namespace.NamespaceService; -import org.alfresco.service.namespace.QName; -import org.alfresco.web.app.Application; -import org.alfresco.web.bean.repository.Node; -import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.data.IDataContainer; -import org.alfresco.web.data.QuickSort; -import org.alfresco.web.ui.common.Utils; -import org.alfresco.web.ui.common.component.UIListItem; -import org.alfresco.web.ui.common.component.description.UIDescription; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Handler class used by the New Space Wizard - * - * @author gavinc - */ -public class NewSpaceWizard extends AbstractWizardBean -{ - public static final String SPACE_ICON_DEFAULT = "space-icon-default"; - - private static Log logger = LogFactory.getLog(NewSpaceWizard.class); - - // TODO: retrieve these from the config service - private static final String WIZARD_TITLE_ID = "new_space_title"; - private static final String WIZARD_DESC_ID = "new_space_desc"; - private static final String STEP1_TITLE_ID = "new_space_step1_title"; - private static final String STEP1_DESCRIPTION_ID = "new_space_step1_desc"; - private static final String STEP2_TITLE_ID = "new_space_step2_title"; - private static final String STEP2_DESCRIPTION_ID = "new_space_step2_desc"; - private static final String STEP3_TITLE_ID = "new_space_step3_title"; - private static final String STEP3_DESCRIPTION_ID = "new_space_step3_desc"; - private static final String FINISH_INSTRUCTION_ID = "new_space_finish_instruction"; - - private static final String ERROR = "error_space"; - private static final String DEFAULT_SPACE_TYPE_ICON = "/images/icons/space.gif"; - private static final String ICONS_LOOKUP_KEY = " icons"; - - // new space wizard specific properties - protected SearchService searchService; - protected NamespaceService namespaceService; - protected DictionaryService dictionaryService; - - protected String spaceType; - protected String icon; - protected String createFrom; - protected NodeRef existingSpaceId; - protected String templateSpaceId; - protected String copyPolicy; - protected String name; - protected String description; - protected String templateName; - protected boolean saveAsTemplate; - protected List templates; - protected List folderTypes; - protected List folderTypeDescriptions; - - // the NodeRef of the node created during finish - protected NodeRef createdNode; - - /** - * Deals with the finish button being pressed - * - * @return outcome - */ - public String finish() - { - String outcome = FINISH_OUTCOME; - - UserTransaction tx = null; - - try - { - FacesContext context = FacesContext.getCurrentInstance(); - tx = Repository.getUserTransaction(FacesContext.getCurrentInstance()); - tx.begin(); - - if (this.editMode) - { - // update the existing node in the repository - Node currentSpace = this.browseBean.getActionSpace(); - NodeRef nodeRef = currentSpace.getNodeRef(); - - // rename if necessary - fileFolderService.rename(nodeRef, this.name); - - // update the properties - Map properties = this.nodeService.getProperties(nodeRef); - properties.put(ContentModel.PROP_NAME, this.name); - properties.put(ContentModel.PROP_ICON, this.icon); - properties.put(ContentModel.PROP_DESCRIPTION, this.description); - - // apply properties - this.nodeService.setProperties(nodeRef, properties); - } - else - { - String newSpaceId = null; - - if (this.createFrom.equals("scratch")) - { - // create the space (just create a folder for now) - NodeRef parentNodeRef; - String nodeId = getNavigator().getCurrentNodeId(); - if (nodeId == null) - { - parentNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); - } - else - { - parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId); - } - - FileInfo fileInfo = fileFolderService.create( - parentNodeRef, - this.name, - Repository.resolveToQName(this.spaceType)); - NodeRef nodeRef = fileInfo.getNodeRef(); - newSpaceId = nodeRef.getId(); - - if (logger.isDebugEnabled()) - logger.debug("Created folder node with name: " + this.name); - - // apply the uifacets aspect - icon, title and description props - Map uiFacetsProps = new HashMap(5); - uiFacetsProps.put(ContentModel.PROP_ICON, this.icon); - uiFacetsProps.put(ContentModel.PROP_TITLE, this.name); - uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); - - if (logger.isDebugEnabled()) - logger.debug("Added uifacets aspect with properties: " + uiFacetsProps); - - // remember the created node - this.createdNode = nodeRef; - } - else if (this.createFrom.equals("existing")) - { - // copy the selected space and update the name, description and icon - NodeRef sourceNode = this.existingSpaceId; - NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), getNavigator().getCurrentNodeId()); - - // copy from existing - NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef(); - - // also need to set the new description and icon properties - this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); - - newSpaceId = copiedNode.getId(); - - if (logger.isDebugEnabled()) - logger.debug("Copied space with id of " + sourceNode.getId() + " to " + this.name); - - // remember the created node - this.createdNode = copiedNode; - } - else if (this.createFrom.equals("template")) - { - // copy the selected space and update the name, description and icon - NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), this.templateSpaceId); - NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), getNavigator().getCurrentNodeId()); - // copy from the template - NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef(); - // also need to set the new description and icon properties - this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description); - this.nodeService.setProperty(copiedNode, ContentModel.PROP_ICON, this.icon); - - newSpaceId = copiedNode.getId(); - - if (logger.isDebugEnabled()) - logger.debug("Copied template space with id of " + sourceNode.getId() + " to " + this.name); - - // remember the created node - this.createdNode = copiedNode; - } - - // if the user selected to save the space as a template space copy the new - // space to the templates folder - if (this.saveAsTemplate) - { - // get hold of the Templates node - DynamicNamespacePrefixResolver namespacePrefixResolver = new DynamicNamespacePrefixResolver(null); - namespacePrefixResolver.registerNamespace(NamespaceService.APP_MODEL_PREFIX, NamespaceService.APP_MODEL_1_0_URI); - - String xpath = Application.getRootPath(FacesContext.getCurrentInstance()) + "/" + - Application.getGlossaryFolderName(FacesContext.getCurrentInstance()) + "/" + - Application.getSpaceTemplatesFolderName(FacesContext.getCurrentInstance()); - - NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); - List templateNodeList = this.searchService.selectNodes( - rootNodeRef, - xpath, null, namespacePrefixResolver, false); - if (templateNodeList.size() == 1) - { - // get the first item in the list as we from test above there is only one! - NodeRef templateNode = templateNodeList.get(0); - NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), newSpaceId); - // copy this to the template location - fileFolderService.copy(sourceNode, templateNode, this.templateName); - } - } - } - - // give subclasses a chance to perform custom processing before committing - performCustomProcessing(context); - - // commit the transaction - tx.commit(); - - // now we know the new details are in the repository, reset the - // client side node representation so the new details are retrieved - String statusMsg = null; - if (this.editMode) - { - this.browseBean.getActionSpace().reset(); - statusMsg = MessageFormat.format(Application.getMessage(context, "status_space_updated"), - new Object[]{this.name}); - } - else - { - // add a message to inform the user that the creation was OK - statusMsg = MessageFormat.format(Application.getMessage(context, "status_space_created"), - new Object[]{this.name}); - } - - // add the status message - Utils.addStatusMessage(FacesMessage.SEVERITY_INFO, statusMsg); - } - catch (FileExistsException e) - { - // rollback the transaction - try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} - // print status message - String statusMsg = MessageFormat.format( - Application.getMessage( - FacesContext.getCurrentInstance(), "error_exists"), - e.getExisting().getName()); - Utils.addErrorMessage(statusMsg); - // no outcome - outcome = null; - } - catch (Throwable e) - { - // rollback the transaction - try { if (tx != null) {tx.rollback();} } catch (Exception ex) {} - Utils.addErrorMessage(MessageFormat.format(Application.getMessage( - FacesContext.getCurrentInstance(), ERROR), e.getMessage()), e); - outcome = null; - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardDescription() - */ - public String getWizardDescription() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_DESC_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardTitle() - */ - public String getWizardTitle() - { - return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_TITLE_ID); - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepDescription() - */ - public String getStepDescription() - { - String stepDesc = null; - - switch (this.currentStep) - { - case 1: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_DESCRIPTION_ID); - break; - } - case 2: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_DESCRIPTION_ID); - break; - } - case 3: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), STEP3_DESCRIPTION_ID); - break; - } - case 4: - { - stepDesc = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_DESCRIPTION_ID); - break; - } - default: - { - stepDesc = ""; - } - } - - return stepDesc; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepTitle() - */ - public String getStepTitle() - { - String stepTitle = null; - - switch (this.currentStep) - { - case 1: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP1_TITLE_ID); - break; - } - case 2: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP2_TITLE_ID); - break; - } - case 3: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), STEP3_TITLE_ID); - break; - } - case 4: - { - stepTitle = Application.getMessage(FacesContext.getCurrentInstance(), SUMMARY_TITLE_ID); - break; - } - default: - { - stepTitle = ""; - } - } - - return stepTitle; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getStepInstructions() - */ - public String getStepInstructions() - { - String stepInstruction = null; - - switch (this.currentStep) - { - case 4: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), FINISH_INSTRUCTION_ID); - break; - } - default: - { - stepInstruction = Application.getMessage(FacesContext.getCurrentInstance(), DEFAULT_INSTRUCTION_ID); - } - } - - return stepInstruction; - } - - /** - * Initialises the wizard - */ - public void init() - { - super.init(); - - // clear the cached query results - if (this.templates != null) - { - this.templates.clear(); - this.templates = null; - } - - // reset all variables - this.createFrom = "scratch"; - this.spaceType = ContentModel.TYPE_FOLDER.toString(); - this.icon = null; - this.copyPolicy = "contents"; - this.existingSpaceId = null; - this.templateSpaceId = null; - this.name = null; - this.description = ""; - this.templateName = null; - this.saveAsTemplate = false; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#populate() - */ - public void populate() - { - // get hold of the current node and populate the appropriate values - Node currentSpace = browseBean.getActionSpace(); - Map props = currentSpace.getProperties(); - - this.name = (String)props.get("name"); - this.description = (String)props.get("description"); - this.icon = (String)props.get("app:icon"); - } - - /** - * @return Returns the summary data for the wizard. - */ - public String getSummary() - { - String summaryCreateType = null; - ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); - - if (this.createFrom.equals("scratch")) - { - summaryCreateType = bundle.getString("scratch"); - } - else if (this.createFrom.equals("existing")) - { - summaryCreateType = bundle.getString("an_existing_space"); - } - else if (this.createFrom.equals("template")) - { - summaryCreateType = bundle.getString("a_template"); - } - -// String summarySaveAsTemplate = this.saveAsTemplate ? bundle.getString("yes") : bundle.getString("no"); -// bundle.getString("save_as_template"), bundle.getString("template_name")}, -// summarySaveAsTemplate, this.templateName - - String spaceTypeLabel = null; - for (UIListItem item : this.getFolderTypes()) - { - if (item.getValue().equals(this.spaceType)) - { - spaceTypeLabel = item.getLabel(); - break; - } - } - - return buildSummary( - new String[] {bundle.getString("space_type"), bundle.getString("name"), - bundle.getString("description"), bundle.getString("creating_from")}, - new String[] {spaceTypeLabel, this.name, this.description, summaryCreateType}); - } - - /** - * @return Returns a list of template spaces currently in the system - */ - public List getTemplateSpaces() - { - if (this.templates == null) - { - this.templates = new ArrayList(); - - FacesContext context = FacesContext.getCurrentInstance(); - String xpath = Application.getRootPath(context) + "/" + Application.getGlossaryFolderName(context) + - "/" + Application.getSpaceTemplatesFolderName(context) + "/*"; - NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef()); - NamespaceService resolver = Repository.getServiceRegistry(context).getNamespaceService(); - List results = this.searchService.selectNodes(rootNodeRef, xpath, null, resolver, false); - - if (results.size() > 0) - { - for (NodeRef assocRef : results) - { - Node childNode = new Node(assocRef); - this.templates.add(new SelectItem(childNode.getId(), childNode.getName())); - } - - // make sure the list is sorted by the label - QuickSort sorter = new QuickSort(this.templates, "label", true, IDataContainer.SORT_CASEINSENSITIVE); - sorter.sort(); - } - - // add an entry (at the start) to instruct the user to select a template - this.templates.add(0, new SelectItem("none", Application.getMessage(FacesContext.getCurrentInstance(), "select_a_template"))); - } - - return this.templates; - } - - /** - * Returns a list of UIListItem objects representing the folder types - * and also constructs the list of descriptions for each type - * - * @return List of UIListItem components - */ - @SuppressWarnings("unchecked") - public List getFolderTypes() - { - if (this.folderTypes == null) - { - FacesContext context = FacesContext.getCurrentInstance(); - this.folderTypes = new ArrayList(2); - this.folderTypeDescriptions = new ArrayList(2); - - // add the well known 'container space' type to start with - UIListItem defaultItem = new UIListItem(); - String defaultLabel = Application.getMessage(context, "container"); - defaultItem.setValue(ContentModel.TYPE_FOLDER.toString()); - defaultItem.setLabel(defaultLabel); - defaultItem.setTooltip(defaultLabel); - defaultItem.getAttributes().put("image", DEFAULT_SPACE_TYPE_ICON); - this.folderTypes.add(defaultItem); - - UIDescription defaultDesc = new UIDescription(); - defaultDesc.setControlValue(ContentModel.TYPE_FOLDER.toString()); - defaultDesc.setText(Application.getMessage(context, "container_desc")); - this.folderTypeDescriptions.add(defaultDesc); - - // add any configured content sub-types to the list - Config wizardCfg = Application.getConfigService(FacesContext.getCurrentInstance()). - getConfig("Space Wizards"); - if (wizardCfg != null) - { - ConfigElement typesCfg = wizardCfg.getConfigElement("folder-types"); - if (typesCfg != null) - { - for (ConfigElement child : typesCfg.getChildren()) - { - QName idQName = Repository.resolveToQName(child.getAttribute("name")); - TypeDefinition typeDef = this.dictionaryService.getType(idQName); - - if (typeDef != null && - this.dictionaryService.isSubClass(typeDef.getName(), ContentModel.TYPE_FOLDER)) - { - // try and get the display label from config - String label = Utils.getDisplayLabel(context, child); - - // if there wasn't a client based label try and get it from the dictionary - if (label == null) - { - label = typeDef.getTitle(); - } - - // finally use the localname if we still haven't found a label - if (label == null) - { - label = idQName.getLocalName(); - } - - // resolve a description string for the type - String description = Utils.getDescription(context, child); - - // if we don't have a local description just use the label - if (description == null) - { - description = label; - } - - // extract the icon to use from the config - String icon = child.getAttribute("icon"); - if (icon == null || icon.length() == 0) - { - icon = DEFAULT_SPACE_TYPE_ICON; - } - - UIListItem item = new UIListItem(); - item.getAttributes().put("value", idQName.toString()); - item.getAttributes().put("label", label); - item.getAttributes().put("tooltip", label); - item.getAttributes().put("image", icon); - this.folderTypes.add(item); - - UIDescription desc = new UIDescription(); - desc.setControlValue(idQName.toString()); - desc.setText(description); - this.folderTypeDescriptions.add(desc); - } - } - } - else - { - logger.warn("Could not find 'folder-types' configuration element"); - } - } - else - { - logger.warn("Could not find 'Space Wizards' configuration section"); - } - - } - - return this.folderTypes; - } - - /** - * Returns a list of UIDescription objects for the folder types - * - * @return A list of UIDescription objects - */ - public List getFolderTypeDescriptions() - { - if (this.folderTypeDescriptions == null) - { - // call the getFolderType method to construct the list - getFolderTypes(); - } - - return this.folderTypeDescriptions; - } - - /** - * Returns a list of icons to allow the user to select from. - * The list can change according to the type of space being created. - * - * @return A list of icons - */ - @SuppressWarnings("unchecked") - public List getIcons() - { - // NOTE: we can't cache this list as it depends on the space type - // which the user can change during the advanced space wizard - - List icons = null; - - QName type = QName.createQName(this.spaceType); - String typePrefixForm = type.toPrefixString(this.namespaceService); - - Config config = Application.getConfigService(FacesContext.getCurrentInstance()). - getConfig(typePrefixForm + ICONS_LOOKUP_KEY); - if (config != null) - { - ConfigElement iconsCfg = config.getConfigElement("icons"); - if (iconsCfg != null) - { - boolean first = true; - for (ConfigElement icon : iconsCfg.getChildren()) - { - String iconName = icon.getAttribute("name"); - String iconPath = icon.getAttribute("path"); - - if (iconName != null && iconPath != null) - { - if (first) - { - // if this is the first icon create the list and make - // the first icon in the list the default - - icons = new ArrayList(iconsCfg.getChildCount()); - if (this.icon == null) - { - // set the default if it is not already - this.icon = iconName; - } - first = false; - } - - UIListItem item = new UIListItem(); - item.setValue(iconName); - item.getAttributes().put("image", iconPath); - icons.add(item); - } - } - } - } - - // if we didn't find any icons display one default choice - if (icons == null) - { - icons = new ArrayList(1); - this.icon = SPACE_ICON_DEFAULT; - - UIListItem item = new UIListItem(); - item.setValue("space-icon-default"); - item.getAttributes().put("image", "/images/icons/space-icon-default.gif"); - icons.add(item); - } - - return icons; - } - - /** - * @return Returns the searchService. - */ - public SearchService getSearchService() - { - return searchService; - } - - /** - * @param searchService The searchService to set. - */ - public void setSearchService(SearchService searchService) - { - this.searchService = searchService; - } - - /** - * @param namespaceService The NamespaceService - */ - public void setNamespaceService(NamespaceService namespaceService) - { - this.namespaceService = namespaceService; - } - - /** - * Sets the dictionary service - * - * @param dictionaryService the dictionary service - */ - public void setDictionaryService(DictionaryService dictionaryService) - { - this.dictionaryService = dictionaryService; - } - - /** - * @return Returns the copyPolicy. - */ - public String getCopyPolicy() - { - return copyPolicy; - } - - /** - * @param copyPolicy The copyPolicy to set. - */ - public void setCopyPolicy(String copyPolicy) - { - this.copyPolicy = copyPolicy; - } - - /** - * @return Returns the createFrom. - */ - public String getCreateFrom() - { - return createFrom; - } - - /** - * @param createFrom The createFrom to set. - */ - public void setCreateFrom(String createFrom) - { - this.createFrom = createFrom; - } - - /** - * @return Returns the description. - */ - public String getDescription() - { - return description; - } - - /** - * @param description The description to set. - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * @return Returns the existingSpaceId. - */ - public NodeRef getExistingSpaceId() - { - return existingSpaceId; - } - - /** - * @param existingSpaceId The existingSpaceId to set. - */ - public void setExistingSpaceId(NodeRef existingSpaceId) - { - this.existingSpaceId = existingSpaceId; - } - - /** - * @return Returns the icon. - */ - public String getIcon() - { - return icon; - } - - /** - * @param icon The icon to set. - */ - public void setIcon(String icon) - { - this.icon = icon; - } - - /** - * @return Returns the name. - */ - public String getName() - { - return name; - } - - /** - * @param name The name to set. - */ - public void setName(String name) - { - this.name = name; - } - - /** - * @return Returns the saveAsTemplate. - */ - public boolean isSaveAsTemplate() - { - return saveAsTemplate; - } - - /** - * @param saveAsTemplate The saveAsTemplate to set. - */ - public void setSaveAsTemplate(boolean saveAsTemplate) - { - this.saveAsTemplate = saveAsTemplate; - } - - /** - * @return Returns the spaceType. - */ - public String getSpaceType() - { - return spaceType; - } - - /** - * @param spaceType The spaceType to set. - */ - public void setSpaceType(String spaceType) - { - this.spaceType = spaceType; - } - - /** - * @return Returns the templateName. - */ - public String getTemplateName() - { - return templateName; - } - - /** - * @param templateName The templateName to set. - */ - public void setTemplateName(String templateName) - { - this.templateName = templateName; - } - - /** - * @return Returns the templateSpaceId. - */ - public String getTemplateSpaceId() - { - return templateSpaceId; - } - - /** - * @param templateSpaceId The templateSpaceId to set. - */ - public void setTemplateSpaceId(String templateSpaceId) - { - this.templateSpaceId = templateSpaceId; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#determineOutcomeForStep(int) - */ - protected String determineOutcomeForStep(int step) - { - String outcome = null; - - switch(step) - { - case 1: - { - outcome = "create-from"; - break; - } - case 2: - { - if (createFrom.equalsIgnoreCase("scratch")) - { - outcome = "from-scratch"; - } - else if (createFrom.equalsIgnoreCase("existing")) - { - outcome = "from-existing"; - } - else if (createFrom.equalsIgnoreCase("template")) - { - outcome = "from-template"; - } - - break; - } - case 3: - { - outcome = "details"; - break; - } - case 4: - { - outcome = "summary"; - break; - } - default: - { - outcome = CANCEL_OUTCOME; - } - } - - return outcome; - } - - /** - * Performs any processing sub classes may wish to do before commit is called - * - * @param context Faces context - */ - protected void performCustomProcessing(FacesContext context) throws Exception - { - // used by subclasses if necessary - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewTopicWizard.java b/source/java/org/alfresco/web/bean/wizard/NewTopicWizard.java deleted file mode 100644 index 478485c472..0000000000 --- a/source/java/org/alfresco/web/bean/wizard/NewTopicWizard.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2005 Alfresco, Inc. - * - * Licensed under the GNU Lesser General Public License as - * published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * You may obtain a copy of the License at - * - * http://www.gnu.org/licenses/lgpl.txt - * - * 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.alfresco.web.bean.wizard; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -import javax.faces.context.FacesContext; - -import org.alfresco.model.ContentModel; -import org.alfresco.model.ForumModel; -import org.alfresco.service.cmr.model.FileInfo; -import org.alfresco.service.cmr.repository.ContentService; -import org.alfresco.service.cmr.repository.ContentWriter; -import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.namespace.QName; -import org.alfresco.web.app.AlfrescoNavigationHandler; -import org.alfresco.web.bean.ForumsBean; -import org.alfresco.web.bean.repository.Repository; -import org.alfresco.web.ui.common.Utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Wizard bean used for creating and editing topic spaces - * - * @author gavinc - */ -public class NewTopicWizard extends NewSpaceWizard -{ - private static final Log logger = LogFactory.getLog(NewTopicWizard.class); - - protected String message; - - protected ContentService contentService; - - /** - * Returns the message entered by the user for the first post - * - * @return The message for the first post - */ - public String getMessage() - { - return this.message; - } - - /** - * Sets the message - * - * @param message The message - */ - public void setMessage(String message) - { - this.message = message; - } - - /** - * @param contentService The contentService to set. - */ - public void setContentService(ContentService contentService) - { - this.contentService = contentService; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#init() - */ - public void init() - { - super.init(); - - this.spaceType = ForumModel.TYPE_TOPIC.toString(); - this.message = null; - } - - /** - * @see org.alfresco.web.bean.wizard.NewSpaceWizard#performCustomProcessing(javax.faces.context.FacesContext) - */ - @Override - protected void performCustomProcessing(FacesContext context) throws Exception - { - if (this.editMode == false) - { - // get the node ref of the node that will contain the content - NodeRef containerNodeRef = this.createdNode; - - // create a unique file name for the message content - String fileName = ForumsBean.createPostFileName(); - - FileInfo fileInfo = this.fileFolderService.create(containerNodeRef, - fileName, ForumModel.TYPE_POST); - NodeRef postNodeRef = fileInfo.getNodeRef(); - - if (logger.isDebugEnabled()) - logger.debug("Created post node with filename: " + fileName); - - // apply the titled aspect - title and description - Map titledProps = new HashMap(3, 1.0f); - titledProps.put(ContentModel.PROP_TITLE, fileName); - this.nodeService.addAspect(postNodeRef, ContentModel.ASPECT_TITLED, titledProps); - - if (logger.isDebugEnabled()) - logger.debug("Added titled aspect with properties: " + titledProps); - - Map editProps = new HashMap(1, 1.0f); - editProps.put(ContentModel.PROP_EDITINLINE, true); - this.nodeService.addAspect(postNodeRef, ContentModel.ASPECT_INLINEEDITABLE, editProps); - - if (logger.isDebugEnabled()) - logger.debug("Added inlineeditable aspect with properties: " + editProps); - - // get a writer for the content and put the file - ContentWriter writer = contentService.getWriter(postNodeRef, ContentModel.PROP_CONTENT, true); - // set the mimetype and encoding - writer.setMimetype(Repository.getMimeTypeForFileName(context, fileName)); - writer.setEncoding("UTF-8"); - writer.putContent(Utils.replaceLineBreaks(this.message)); - } - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() - */ - @Override - public String finish() - { - String outcome = super.finish(); - - // if we had a successful outcome work out the outcome to return - if (outcome != null) - { - outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - - if (this.editMode == false) - { - // if we are successful in creating the topic we need to setup - // the browse context for the new topic and pass an override - // outcome of 'showTopic' - this.browseBean.clickSpace(this.createdNode); - - outcome = outcome + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "showTopic"; - } - } - - return outcome; - } - - /** - * @see org.alfresco.web.bean.wizard.AbstractWizardBean#cancel() - */ - @Override - public String cancel() - { - super.cancel(); - - return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; - } -} diff --git a/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java b/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java index 9089f7074f..68228babe6 100644 --- a/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/NewUserWizard.java @@ -45,6 +45,7 @@ import org.alfresco.web.app.Application; import org.alfresco.web.app.context.UIContextService; import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; +import org.alfresco.web.bean.spaces.CreateSpaceWizard; import org.alfresco.web.bean.users.UsersBean; import org.alfresco.web.config.ClientConfigElement; import org.alfresco.web.ui.common.Utils; @@ -98,9 +99,6 @@ public class NewUserWizard extends AbstractWizardBean /** action context */ private Node person = null; - /** ref to system people folder */ - private NodeRef peopleRef = null; - /** ref to the company home space folder */ private NodeRef companyHomeSpaceRef = null; @@ -497,7 +495,6 @@ public class NewUserWizard extends AbstractWizardBean props.put(ContentModel.PROP_ORGID, this.companyId); // create the node to represent the Person - String assocName = QName.createValidLocalName(this.userName); NodeRef newPerson = this.personService.createPerson(props); // ensure the user can access their own Person object @@ -867,7 +864,6 @@ public class NewUserWizard extends AbstractWizardBean */ private NodeRef createHomeSpace(String locationId, String spaceName, boolean error) { - String homeSpaceId = locationId; NodeRef homeSpaceNodeRef = null; if (spaceName != null && spaceName.length() != 0) { @@ -908,7 +904,7 @@ public class NewUserWizard extends AbstractWizardBean // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(3); - uiFacetsProps.put(ContentModel.PROP_ICON, NewSpaceWizard.SPACE_ICON_DEFAULT); + uiFacetsProps.put(ContentModel.PROP_ICON, CreateSpaceWizard.DEFAULT_SPACE_ICON_NAME); uiFacetsProps.put(ContentModel.PROP_TITLE, spaceName); this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); @@ -916,7 +912,6 @@ public class NewUserWizard extends AbstractWizardBean // return the ID of the created space homeSpaceNodeRef = nodeRef; - homeSpaceId = nodeRef.getId(); } return homeSpaceNodeRef; diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 05f90c42fc..d6c63c3fff 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -1115,7 +1115,7 @@ The bean that holds forums state. ForumsBean - org.alfresco.web.bean.ForumsBean + org.alfresco.web.bean.forums.ForumsBean session nodeService @@ -1152,40 +1152,7 @@ The bean that backs up the Create Forums Dialog CreateForumsDialog - org.alfresco.web.bean.wizard.NewForumsWizard - session - - nodeService - #{NodeService} - - - fileFolderService - #{FileFolderService} - - - searchService - #{SearchService} - - - navigator - #{NavigationBean} - - - browseBean - #{BrowseBean} - - - namespaceService - #{NamespaceService} - - - - - - The bean that backs up the Edit Forums Dialog - - EditForumsDialog - org.alfresco.web.bean.wizard.NewForumsWizard + org.alfresco.web.bean.forums.CreateForumsDialog session nodeService @@ -1218,7 +1185,7 @@ The bean that backs up the Create Forum Dialog CreateForumDialog - org.alfresco.web.bean.wizard.NewForumWizard + org.alfresco.web.bean.forums.CreateForumDialog session nodeService @@ -1246,45 +1213,12 @@ - - - The bean that backs up the Edit Forum Dialog - - EditForumDialog - org.alfresco.web.bean.wizard.NewForumWizard - session - - nodeService - #{NodeService} - - - fileFolderService - #{FileFolderService} - - - searchService - #{SearchService} - - - navigator - #{NavigationBean} - - - browseBean - #{BrowseBean} - - - namespaceService - #{NamespaceService} - - - The bean that backs up the Create Topic Dialog CreateTopicDialog - org.alfresco.web.bean.wizard.NewTopicWizard + org.alfresco.web.bean.forums.CreateTopicDialog session nodeService @@ -1316,45 +1250,12 @@ - - - The bean that backs up the Edit Topic Dialog - - EditTopicDialog - org.alfresco.web.bean.wizard.NewTopicWizard - session - - nodeService - #{NodeService} - - - fileFolderService - #{FileFolderService} - - - searchService - #{SearchService} - - - navigator - #{NavigationBean} - - - browseBean - #{BrowseBean} - - - namespaceService - #{NamespaceService} - - - The bean that backs up the Create Post Dialog CreatePostDialog - org.alfresco.web.bean.wizard.NewPostWizard + org.alfresco.web.bean.forums.CreatePostDialog session nodeService @@ -1391,7 +1292,7 @@ The bean that backs up the Edit Post Dialog EditPostDialog - org.alfresco.web.bean.wizard.NewPostWizard + org.alfresco.web.bean.forums.EditPostDialog session nodeService @@ -1428,7 +1329,7 @@ The bean that backs up the Create Reply Dialog CreateReplyDialog - org.alfresco.web.bean.wizard.NewReplyWizard + org.alfresco.web.bean.forums.CreateReplyDialog session nodeService @@ -1465,7 +1366,7 @@ The bean that backs up the Create Discussion Dialog CreateDiscussionDialog - org.alfresco.web.bean.wizard.NewDiscussionWizard + org.alfresco.web.bean.forums.CreateDiscussionDialog session nodeService diff --git a/source/web/WEB-INF/faces-config-navigation.xml b/source/web/WEB-INF/faces-config-navigation.xml index 9379bce93f..e9dcf7a6c3 100644 --- a/source/web/WEB-INF/faces-config-navigation.xml +++ b/source/web/WEB-INF/faces-config-navigation.xml @@ -778,70 +778,36 @@ /jsp/forums/* - - createForums - /jsp/forums/create-forums.jsp - showForumsDetails /jsp/forums/forums-details.jsp - - editForumsProperties - /jsp/forums/edit-forums.jsp - - - deleteForums - /jsp/forums/delete-forums.jsp - - - createForum - /jsp/forums/create-forum.jsp - - - deleteForum - /jsp/forums/delete-forum.jsp - showForumDetails /jsp/forums/forum-details.jsp - editForumProperties - /jsp/forums/edit-forum.jsp + showTopicDetails + /jsp/forums/topic-details.jsp + + + + deleteForums + /jsp/forums/delete-forums.jsp - createTopic - /jsp/forums/create-topic.jsp + deleteForum + /jsp/forums/delete-forum.jsp deleteTopic /jsp/forums/delete-topic.jsp - - showTopicDetails - /jsp/forums/topic-details.jsp - - - editTopicProperties - /jsp/forums/edit-topic.jsp - - - createPost - /jsp/forums/create-post.jsp - - - createReply - /jsp/forums/create-reply.jsp - - - editPost - /jsp/forums/edit-post.jsp - deletePost /jsp/forums/delete-post.jsp + manageInvitedUsers /jsp/roles/manage-invited-users.jsp @@ -854,18 +820,6 @@ export /jsp/dialog/export.jsp - - createDiscussion - /jsp/forums/create-discussion.jsp - - - - - /jsp/forums/create-topic.jsp - - showTopic - /jsp/forums/topic.jsp - diff --git a/source/web/css/main.css b/source/web/css/main.css index e14fded8b0..b9ae62af06 100644 --- a/source/web/css/main.css +++ b/source/web/css/main.css @@ -483,3 +483,8 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl { vertical-align: -20%; } + +.alignTop +{ + vertical-align: top; +} diff --git a/source/web/images/icons/unlock.gif b/source/web/images/icons/unlock.gif index d8c2e48a7c22e084d0a05b15d2c143494d8f6413..70c331a788634115d7d1a035d8a1fa175bc5fbfb 100644 GIT binary patch delta 607 zcmV-l0-*i&2HgjLM@dFFIbje05CHc803Hi{Dj9?=D~&ESl2vG}Q+Tv)VytR=w|#uH ze}A?nlfEaEz9^KxDwV$~mB1^Oz$}))FqpwInZh!f!ZVt}HJigXoWnks!8o17I-SHj zp2a<%#Xq3NK%mA!p~ga?$3mjVL!!q?rO8aD%1x)rPpHa&P^rsNsmoKU%vP(-SFFui ztr_Pb8(4?cv zrlZKMs?4u{tj)c=*@3~@gTmT{!`q9++>6HCjKXA>bl+Qzu)Y_!P~>Z+sMY<)6wJK-s{8R?ZxBn$mH(P z=<(9&^403{*6Z`w?DOX3@8sn0=JWXI^!WDn`v3m~|NsC0u|bRhe?U4lL*NJ5n>%8Q7T$2f<|M)I!Dxa95}}Y z4=Y!s^r+E-1dBNcW1Nw52M?V#V6*_C!2#inF>c_*c|*nv79TJ)AawCXOc^svlx&%T zV}%8TDY9_sasWVpQ5-yAl$d~U#1AS}2mmmkLk0>D5DML_@n literal 886 zcmZ?wbhEHb*15 z*v8AMHp9d4U^6SXNXC_p1rEp9_+(518W <%-- View mode settings --%> - diff --git a/source/web/jsp/dialog/document-details.jsp b/source/web/jsp/dialog/document-details.jsp index 2586e7d60c..4436c21d32 100644 --- a/source/web/jsp/dialog/document-details.jsp +++ b/source/web/jsp/dialog/document-details.jsp @@ -77,22 +77,22 @@
- : - + : +
-
+
<%-- Navigation --%> - + - + @@ -116,8 +116,6 @@
- - <%-- wrapper comment used by the panel to add additional component facets --%> @@ -222,7 +220,8 @@ action="#{DocumentDetailsBean.applyInlineEditable}" rendered="#{DocumentDetailsBean.inlineEditable == false}" /> - + +
@@ -253,7 +252,8 @@ columns="1" mode="view" labelStyleClass="propertiesLabel" externalConfig="true" /> - + + @@ -383,7 +383,7 @@
- +
diff --git a/source/web/jsp/dialog/edit-document-properties.jsp b/source/web/jsp/dialog/edit-document-properties.jsp deleted file mode 100644 index 1020a67575..0000000000 --- a/source/web/jsp/dialog/edit-document-properties.jsp +++ /dev/null @@ -1,214 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- Error Messages --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
''
-
-
- -
- - - - - - -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: -  * -
: -  * -
: - -
: - -
: - -
- - -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <%-- messages tag to show messages not handled by other specific message tags --%> - -
-
- -
- -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-dialog.jsp b/source/web/jsp/forums/create-dialog.jsp new file mode 100644 index 0000000000..019f4a9220 --- /dev/null +++ b/source/web/jsp/forums/create-dialog.jsp @@ -0,0 +1,126 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + 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. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + +
+ + + + + + + +
+ + + + +
+ + + + + +
+
+
+ diff --git a/source/web/jsp/forums/create-discussion.jsp b/source/web/jsp/forums/create-discussion.jsp deleted file mode 100644 index ae21c97c35..0000000000 --- a/source/web/jsp/forums/create-discussion.jsp +++ /dev/null @@ -1,217 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - - - - - -
: -  * -
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
 
: -  * -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-forum.jsp b/source/web/jsp/forums/create-forum.jsp deleted file mode 100644 index f5b38efc3e..0000000000 --- a/source/web/jsp/forums/create-forum.jsp +++ /dev/null @@ -1,216 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - - - - - -
: -  * -
: - -
 
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-forums.jsp b/source/web/jsp/forums/create-forums.jsp deleted file mode 100644 index 499ba7cc16..0000000000 --- a/source/web/jsp/forums/create-forums.jsp +++ /dev/null @@ -1,215 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - - - - - -
: -  * -
: - -
 
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-post-dialog.jsp b/source/web/jsp/forums/create-post-dialog.jsp new file mode 100644 index 0000000000..5c5c8a0b85 --- /dev/null +++ b/source/web/jsp/forums/create-post-dialog.jsp @@ -0,0 +1,49 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + 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. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + + + + + + + + + + + + diff --git a/source/web/jsp/forums/create-post.jsp b/source/web/jsp/forums/create-post.jsp deleted file mode 100644 index dc4dcfdae7..0000000000 --- a/source/web/jsp/forums/create-post.jsp +++ /dev/null @@ -1,177 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - -
: - -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-reply-dialog.jsp b/source/web/jsp/forums/create-reply-dialog.jsp new file mode 100644 index 0000000000..b6494456ae --- /dev/null +++ b/source/web/jsp/forums/create-reply-dialog.jsp @@ -0,0 +1,81 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + 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. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page import="org.alfresco.web.bean.forums.ForumsBean.TopicBubbleViewRenderer" %> + + + + + + + + + + + + + + + + + + + + +
+ <% TopicBubbleViewRenderer.renderBubbleTop(out, request.getContextPath(), "yellow", "#FFF5A3"); %> + + + + + + + <% TopicBubbleViewRenderer.renderBubbleMiddle(out, request.getContextPath(), "yellow"); %> + + + + <% TopicBubbleViewRenderer.renderBubbleBottom(out, request.getContextPath(), "yellow"); %> + + + + + +
+
+ + diff --git a/source/web/jsp/forums/create-reply.jsp b/source/web/jsp/forums/create-reply.jsp deleted file mode 100644 index cb69fa2acf..0000000000 --- a/source/web/jsp/forums/create-reply.jsp +++ /dev/null @@ -1,201 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> -<%@ page import="org.alfresco.web.bean.ForumsBean.TopicBubbleViewRenderer" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - -
: - -
- - - - - -
- <% TopicBubbleViewRenderer.renderBubbleTop(out, request.getContextPath(), "yellow", "#FFF5A3"); %> -   - - - - <% TopicBubbleViewRenderer.renderBubbleMiddle(out, request.getContextPath(), "yellow"); %> - - <% TopicBubbleViewRenderer.renderBubbleBottom(out, request.getContextPath(), "yellow"); %> - -
- -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/create-topic-dialog.jsp b/source/web/jsp/forums/create-topic-dialog.jsp new file mode 100644 index 0000000000..2b2e52817a --- /dev/null +++ b/source/web/jsp/forums/create-topic-dialog.jsp @@ -0,0 +1,154 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + 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. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + +
+ + + + + + + +
+ + + + +
+ + + + + +
+
+ + + +
+ + + + + + + + + + + +
+
+ diff --git a/source/web/jsp/forums/create-topic.jsp b/source/web/jsp/forums/create-topic.jsp deleted file mode 100644 index 7f95b3b253..0000000000 --- a/source/web/jsp/forums/create-topic.jsp +++ /dev/null @@ -1,217 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - - - - - -
: -  * -
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
 
: -  * -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-forum.jsp b/source/web/jsp/forums/edit-forum.jsp deleted file mode 100644 index 759fa9d5e4..0000000000 --- a/source/web/jsp/forums/edit-forum.jsp +++ /dev/null @@ -1,209 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
''
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - -
: -  * -
: - -
 
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-forums.jsp b/source/web/jsp/forums/edit-forums.jsp deleted file mode 100644 index 92325a2157..0000000000 --- a/source/web/jsp/forums/edit-forums.jsp +++ /dev/null @@ -1,209 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
''
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - - - - - -
: -  * -
: - -
 
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-post.jsp b/source/web/jsp/forums/edit-post.jsp deleted file mode 100644 index 9f6ecf10d0..0000000000 --- a/source/web/jsp/forums/edit-post.jsp +++ /dev/null @@ -1,178 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - -
: - -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-topic.jsp b/source/web/jsp/forums/edit-topic.jsp deleted file mode 100644 index 66a4d3d966..0000000000 --- a/source/web/jsp/forums/edit-topic.jsp +++ /dev/null @@ -1,203 +0,0 @@ -<%-- - Copyright (C) 2005 Alfresco, Inc. - - Licensed under the Mozilla Public License version 1.1 - with a permitted attribution clause. You may obtain a - copy of the License at - - http://www.alfresco.org/legal/license.txt - - 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. ---%> -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> -<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> - -<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> -<%@ page isELIgnored="false" %> -<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> - - - - - - - - <%-- load a bundle of properties with I18N strings --%> - - - - - <%-- Main outer table --%> - - - <%-- Title bar --%> - - - - - <%-- Main area --%> - - <%-- Shelf --%> - - - <%-- Work Area --%> - - -
- <%@ include file="../parts/titlebar.jsp" %> -
- <%@ include file="../parts/shelf.jsp" %> - - - <%-- Breadcrumb --%> - <%@ include file="../parts/breadcrumb.jsp" %> - - <%-- Status and Actions --%> - - - - - - - <%-- separator row with gradient shadow --%> - - - - - - - <%-- Details --%> - - - - - - - <%-- separator row with bottom panel graphics --%> - - - - - - -
- - <%-- Status and Actions inner contents table --%> - <%-- Generally this consists of an icon, textual summary and actions for the current object --%> - - - - - -
- -
''
-
-
- -
- - - - - - -
- - - - <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> - - - - - - - - - - - - - - - - -
: -  * -
 
: -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> -
- <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
- <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> -
-
-
- -
- - - -
- -
\ No newline at end of file diff --git a/source/web/jsp/forums/forum-details.jsp b/source/web/jsp/forums/forum-details.jsp index df495f904a..21a0570f3d 100644 --- a/source/web/jsp/forums/forum-details.jsp +++ b/source/web/jsp/forums/forum-details.jsp @@ -129,7 +129,7 @@ + action="dialog:editForum" /> diff --git a/source/web/jsp/forums/forums-details.jsp b/source/web/jsp/forums/forums-details.jsp index ab10ae0a8a..8d76a3b5e4 100644 --- a/source/web/jsp/forums/forums-details.jsp +++ b/source/web/jsp/forums/forums-details.jsp @@ -129,7 +129,7 @@ + action="dialog:editForums" /> diff --git a/source/web/jsp/forums/topic-details.jsp b/source/web/jsp/forums/topic-details.jsp index 969b7c9863..7225f2ef29 100644 --- a/source/web/jsp/forums/topic-details.jsp +++ b/source/web/jsp/forums/topic-details.jsp @@ -130,7 +130,7 @@ + action="dialog:editTopic" /> diff --git a/source/web/jsp/login.jsp b/source/web/jsp/login.jsp index e5b1552ac5..c7f4e1209a 100644 --- a/source/web/jsp/login.jsp +++ b/source/web/jsp/login.jsp @@ -112,7 +112,7 @@ <%-- language selection drop-down --%> - + diff --git a/source/web/jsp/rules/details.jsp b/source/web/jsp/rules/details.jsp index 9048abe903..235d878755 100644 --- a/source/web/jsp/rules/details.jsp +++ b/source/web/jsp/rules/details.jsp @@ -45,10 +45,8 @@ - <%-- - disabled="#{WizardManager.bean.inEditMode}" - --%> - + diff --git a/source/web/jsp/spaces/create-space-dialog.jsp b/source/web/jsp/spaces/create-space-dialog.jsp index 38170ad0f8..f43cc76e3e 100644 --- a/source/web/jsp/spaces/create-space-dialog.jsp +++ b/source/web/jsp/spaces/create-space-dialog.jsp @@ -66,26 +66,45 @@ - + - + + + + + + - - - - +
+ - +
+ + + + + -  * + onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> +
+ + + + + + + +
@@ -97,18 +116,11 @@
  - - - -
- + @@ -122,14 +134,6 @@
- - - -
- - - - diff --git a/source/web/jsp/spaces/create-space-wizard/details.jsp b/source/web/jsp/spaces/create-space-wizard/details.jsp index f7c9feda8e..ff77fabf70 100644 --- a/source/web/jsp/spaces/create-space-wizard/details.jsp +++ b/source/web/jsp/spaces/create-space-wizard/details.jsp @@ -88,26 +88,45 @@ - + - + + + + + + - - - +
+
+ + + + + -  * +
+ + + + + + + +
@@ -120,15 +139,10 @@
  - - -
- +