mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Afternoon merge.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2915 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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'
|
||||
|
@@ -396,6 +396,17 @@
|
||||
<action-listener>#{SpaceDetailsBean.takeOwnership}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Unlock document -->
|
||||
<action id="unlock_doc">
|
||||
<permissions>
|
||||
<permission allow="true">Unlock</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.action.evaluator.UnlockDocEvaluator</evaluator>
|
||||
<label-id>unlock</label-id>
|
||||
<image>/images/icons/unlock.gif</image>
|
||||
<action-listener>#{DocumentDetailsBean.unlock}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Manage Content Users -->
|
||||
<action id="manage_content_users">
|
||||
<permissions>
|
||||
@@ -560,6 +571,7 @@
|
||||
<action idref="cut_node" />
|
||||
<action idref="copy_node" />
|
||||
<action idref="delete_doc" />
|
||||
<action idref="unlock_doc" />
|
||||
<action idref="take_ownership_doc" />
|
||||
<action idref="manage_content_users" />
|
||||
<action idref="create_shortcut" />
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
<!-- Definition of the edit space dialog -->
|
||||
<dialog name="editSpace" page="/jsp/spaces/edit-space-dialog.jsp" managed-bean="EditSpaceDialog"
|
||||
icon="/images/icons/create_space_large.gif" title-id="modify_space_properties"
|
||||
icon="/images/icons/details_large.gif" title-id="modify_space_properties"
|
||||
description-id="editspace_description" />
|
||||
|
||||
<!-- Definition of the set content properties dialog -->
|
||||
@@ -25,6 +25,50 @@
|
||||
managed-bean="EditContentPropertiesDialog" icon="/images/icons/details_large.gif"
|
||||
title-id="modify_content_properties" description-id="edit_content_description" />
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Forums Dialogs -->
|
||||
|
||||
<!-- Definition of the create forums dialog -->
|
||||
<dialog name="createForums" page="/jsp/forums/create-dialog.jsp" managed-bean="CreateForumsDialog"
|
||||
icon="/images/icons/create_forums_large.gif" title-id="create_forums"
|
||||
description-id="create_forums_description" error-message-id="error_create_forums_dialog" />
|
||||
|
||||
<dialog name="editForums" page="/jsp/spaces/edit-space-dialog.jsp" managed-bean="EditSpaceDialog"
|
||||
icon="/images/icons/details_large.gif" title-id="modify_forums_properties"
|
||||
description-id="edit_forums_description" />
|
||||
|
||||
<dialog name="createForum" page="/jsp/forums/create-dialog.jsp" managed-bean="CreateForumDialog"
|
||||
icon="/images/icons/create_forum_large.gif" title-id="create_forum"
|
||||
description-id="create_forum_description" error-message-id="error_create_forum_dialog" />
|
||||
|
||||
<dialog name="editForum" page="/jsp/spaces/edit-space-dialog.jsp" managed-bean="EditSpaceDialog"
|
||||
icon="/images/icons/details_large.gif" title-id="modify_forum_properties"
|
||||
description-id="edit_forum_description" />
|
||||
|
||||
<dialog name="createTopic" page="/jsp/forums/create-topic-dialog.jsp" managed-bean="CreateTopicDialog"
|
||||
icon="/images/icons/create_topic_large.gif" title-id="create_topic"
|
||||
description-id="create_topic_description" error-message-id="error_create_topic_dialog" />
|
||||
|
||||
<dialog name="editTopic" page="/jsp/spaces/edit-space-dialog.jsp" managed-bean="EditSpaceDialog"
|
||||
icon="/images/icons/details_large.gif" title-id="modify_topic_properties"
|
||||
description-id="edit_topic_description" />
|
||||
|
||||
<dialog name="createPost" page="/jsp/forums/create-post-dialog.jsp" managed-bean="CreatePostDialog"
|
||||
icon="/images/icons/create_post_large.gif" title-id="create_post"
|
||||
description-id="create_post_description" error-message-id="error_create_post_dialog" />
|
||||
|
||||
<dialog name="createReply" page="/jsp/forums/create-reply-dialog.jsp" managed-bean="CreateReplyDialog"
|
||||
icon="/images/icons/post_reply_large.gif" title-id="post_reply"
|
||||
description-id="create_reply_description" error-message-id="error_create_reply_dialog" />
|
||||
|
||||
<dialog name="editPost" page="/jsp/forums/create-post-dialog.jsp" managed-bean="EditPostDialog"
|
||||
icon="/images/icons/edit_post_large.gif" title-id="edit_post"
|
||||
description-id="edit_post_description" error-message-id="error_create_post_dialog" />
|
||||
|
||||
<dialog name="createDiscussion" page="/jsp/forums/create-topic-dialog.jsp" managed-bean="CreateDiscussionDialog"
|
||||
icon="/images/icons/create_topic_large.gif" title-id="create_topic"
|
||||
description-id="create_topic_description" error-message-id="error_create_topic_dialog" />
|
||||
</dialogs>
|
||||
</config>
|
||||
|
||||
|
@@ -36,7 +36,8 @@
|
||||
<evaluator>org.alfresco.web.action.evaluator.CreateForumNodeEvaluator</evaluator>
|
||||
<label-id>start_discussion</label-id>
|
||||
<image>/images/icons/create_forum.gif</image>
|
||||
<action-listener>#{CreateDiscussionDialog.startWizard}</action-listener>
|
||||
<action>dialog:createDiscussion</action>
|
||||
<action-listener>#{DialogManager.setupParameters}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
</params>
|
||||
@@ -50,7 +51,6 @@
|
||||
<label-id>create_forums</label-id>
|
||||
<image>/images/icons/create_forums.gif</image>
|
||||
<action>dialog:createForums</action>
|
||||
<action-listener>#{CreateForumsDialog.startWizard}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Create a Forum -->
|
||||
@@ -61,7 +61,6 @@
|
||||
<label-id>create_forum</label-id>
|
||||
<image>/images/icons/create_forum.gif</image>
|
||||
<action>dialog:createForum</action>
|
||||
<action-listener>#{CreateForumDialog.startWizard}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Delete a Forums space -->
|
||||
@@ -100,7 +99,6 @@
|
||||
<label-id>create_topic</label-id>
|
||||
<image>/images/icons/create_topic.gif</image>
|
||||
<action>dialog:createTopic</action>
|
||||
<action-listener>#{CreateTopicDialog.startWizard}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Delete a Topic -->
|
||||
@@ -125,7 +123,6 @@
|
||||
<label-id>post_to_topic</label-id>
|
||||
<image>/images/icons/create_post.gif</image>
|
||||
<action>dialog:createPost</action>
|
||||
<action-listener>#{CreatePostDialog.startWizard}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Post a reply to a Topic -->
|
||||
@@ -136,7 +133,7 @@
|
||||
<label-id>post_reply</label-id>
|
||||
<image>/images/icons/post_reply.gif</image>
|
||||
<action>dialog:createReply</action>
|
||||
<action-listener>#{CreateReplyDialog.startWizard}</action-listener>
|
||||
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
</params>
|
||||
@@ -150,7 +147,7 @@
|
||||
<label-id>edit_post</label-id>
|
||||
<image>/images/icons/edit_post.gif</image>
|
||||
<action>dialog:editPost</action>
|
||||
<action-listener>#{EditPostDialog.startWizardForEdit}</action-listener>
|
||||
<action-listener>#{BrowseBean.setupContentAction}</action-listener>
|
||||
<params>
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
</params>
|
||||
|
@@ -16,8 +16,9 @@
|
||||
<config evaluator="node-type" condition="folder">
|
||||
<property-sheet>
|
||||
<show-property name="name"/>
|
||||
<show-property name="title"/>
|
||||
<show-property name="description"/>
|
||||
<show-property name="icon" show-in-view-mode="false" display-label-id="choose_space_icon"
|
||||
<show-property name="icon" show-in-view-mode="false" display-label-id="icon"
|
||||
component-generator="SpaceIconPickerGenerator" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
@@ -26,6 +27,8 @@
|
||||
<property-sheet>
|
||||
<show-property name="name"/>
|
||||
<show-property name="description"/>
|
||||
<show-property name="icon" show-in-view-mode="false" display-label-id="icon"
|
||||
component-generator="SpaceIconPickerGenerator" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
@@ -33,6 +36,8 @@
|
||||
<property-sheet>
|
||||
<show-property name="name"/>
|
||||
<show-property name="description"/>
|
||||
<show-property name="icon" show-in-view-mode="false" display-label-id="icon"
|
||||
component-generator="SpaceIconPickerGenerator" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
@@ -40,6 +45,8 @@
|
||||
<property-sheet>
|
||||
<show-property name="name"/>
|
||||
<show-property name="description"/>
|
||||
<show-property name="icon" show-in-view-mode="false" display-label-id="icon"
|
||||
component-generator="SpaceIconPickerGenerator" />
|
||||
</property-sheet>
|
||||
</config>
|
||||
|
||||
|
@@ -81,7 +81,7 @@
|
||||
<view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$DetailsViewRenderer</view-impl>
|
||||
<view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$IconViewRenderer</view-impl>
|
||||
<view-impl>org.alfresco.web.ui.common.renderer.data.RichListRenderer$ListViewRenderer</view-impl>
|
||||
<view-impl>org.alfresco.web.bean.ForumsBean$TopicBubbleViewRenderer</view-impl>
|
||||
<view-impl>org.alfresco.web.bean.forums.ForumsBean$TopicBubbleViewRenderer</view-impl>
|
||||
|
||||
<!-- default values for the views available in the client -->
|
||||
<view-defaults>
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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<tokenCount-4; i++)
|
||||
String[] args = new String[tokenCount - 3];
|
||||
for (int i=0; i<tokenCount-3; i++)
|
||||
{
|
||||
args[i] = t.nextToken();
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class CommandServlet extends BaseServlet
|
||||
txn.begin();
|
||||
|
||||
// inform the processor to execute the specified command
|
||||
processor.process(serviceRegistry, req.getSession(), command);
|
||||
processor.process(serviceRegistry, req, command);
|
||||
|
||||
// commit the transaction
|
||||
txn.commit();
|
||||
@@ -166,11 +166,18 @@ public class CommandServlet extends BaseServlet
|
||||
}
|
||||
|
||||
/**
|
||||
* @param procName
|
||||
* Created the specified CommandProcessor instance. The name of the processor is looked up
|
||||
* in the client config, it should find a valid class impl and then create it.
|
||||
*
|
||||
* @param procName Name of the CommandProcessor to lookup in the client config.
|
||||
*
|
||||
* @return CommandProcessor
|
||||
*
|
||||
* @throws InstantiationException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
private CommandProcessor createCommandProcessor(String procName) throws InstantiationException, IllegalAccessException
|
||||
private CommandProcessor createCommandProcessor(String procName)
|
||||
throws InstantiationException, IllegalAccessException
|
||||
{
|
||||
Config config = Application.getConfigService(getServletContext()).getConfig("Command Servlet");
|
||||
if (config == null)
|
||||
|
@@ -114,13 +114,13 @@ public class DownloadContentServlet extends BaseServlet
|
||||
// TODO: add compression here?
|
||||
// see http://servlets.com/jservlet2/examples/ch06/ViewResourceCompress.java for example
|
||||
// only really needed if we don't use the built in compression of the servlet container
|
||||
uri = uri.substring(req.getContextPath().length());
|
||||
StringTokenizer t = new StringTokenizer(uri, "/");
|
||||
if (t.countTokens() < 7)
|
||||
if (t.countTokens() < 6)
|
||||
{
|
||||
throw new IllegalArgumentException("Download URL did not contain all required args: " + uri);
|
||||
}
|
||||
|
||||
t.nextToken(); // skip web app name
|
||||
t.nextToken(); // skip servlet name
|
||||
|
||||
String attachToken = t.nextToken();
|
||||
|
@@ -85,20 +85,21 @@ public class ExternalAccessServlet extends BaseServlet
|
||||
return;
|
||||
}
|
||||
|
||||
uri = uri.substring(req.getContextPath().length());
|
||||
StringTokenizer t = new StringTokenizer(uri, "/");
|
||||
int count = t.countTokens();
|
||||
if (count < 3)
|
||||
int tokenCount = t.countTokens();
|
||||
if (tokenCount < 2)
|
||||
{
|
||||
throw new IllegalArgumentException("Externally addressable URL did not contain all required args: " + uri);
|
||||
}
|
||||
t.nextToken(); // skip web app name
|
||||
|
||||
t.nextToken(); // skip servlet name
|
||||
|
||||
String outcome = t.nextToken();
|
||||
|
||||
// get rest of the tokens arguments
|
||||
String[] args = new String[count - 3];
|
||||
for (int i=0; i<count - 3; i++)
|
||||
String[] args = new String[tokenCount - 2];
|
||||
for (int i=0; i<tokenCount - 2; i++)
|
||||
{
|
||||
args[i] = t.nextToken();
|
||||
}
|
||||
|
@@ -19,12 +19,15 @@ package org.alfresco.web.app.servlet;
|
||||
import java.io.IOException;
|
||||
import java.net.SocketException;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
@@ -100,14 +103,14 @@ public class TemplateContentServlet extends BaseServlet
|
||||
return;
|
||||
}
|
||||
|
||||
uri = uri.substring(req.getContextPath().length());
|
||||
StringTokenizer t = new StringTokenizer(uri, "/");
|
||||
int tokenCount = t.countTokens();
|
||||
if (tokenCount < 5)
|
||||
if (tokenCount < 4)
|
||||
{
|
||||
throw new IllegalArgumentException("Template Servlet URL did not contain all required args: " + uri);
|
||||
}
|
||||
|
||||
t.nextToken(); // skip web app name
|
||||
t.nextToken(); // skip servlet name
|
||||
|
||||
// get NodeRef to the content
|
||||
@@ -116,7 +119,7 @@ public class TemplateContentServlet extends BaseServlet
|
||||
|
||||
// get NodeRef to the template if supplied
|
||||
NodeRef templateRef = null;
|
||||
if (tokenCount >= 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<String, String> args = new HashMap<String, String>(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;
|
||||
}
|
||||
|
||||
|
@@ -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.
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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<String, Object> properties = new HashMap<String, Object>(2, 1.0f);
|
||||
Map<String, Object> properties = new HashMap<String, Object>(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<String, String> args = new ScriptableHashMap<String, String>();
|
||||
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)
|
||||
{
|
||||
|
@@ -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<String, Object> properties = new HashMap<String, Object>(1, 1.0f);
|
||||
// all workflow commands use a "target" Node property as an argument
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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<IBreadcrumbHandler> location = this.navigator.getLocation();
|
||||
ChildAssociationRef parentAssocRef = nodeService.getPrimaryParent(nodeRef);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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 NodeRef discussingNodeRef;
|
||||
private static final Log logger = LogFactory.getLog(CreateDiscussionDialog.class);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#startWizard(javax.faces.event.ActionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void startWizard(ActionEvent event)
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
UIActionLink link = (UIActionLink)event.getComponent();
|
||||
Map<String, String> 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";
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
this.spaceType = ForumModel.TYPE_FORUM.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_forum");
|
||||
}
|
||||
}
|
@@ -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<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
this.spaceType = ForumModel.TYPE_FORUMS.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_forums");
|
||||
}
|
||||
}
|
@@ -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<String, String> 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 <br/>
|
||||
this.content = Utils.replaceLineBreaks(this.content);
|
||||
|
||||
return super.finishImpl(context, outcome);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "post");
|
||||
}
|
||||
}
|
@@ -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<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
this.replyContent = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// remove link breaks and replace with <br/>
|
||||
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;
|
||||
}
|
||||
}
|
143
source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java
Normal file
143
source/java/org/alfresco/web/bean/forums/CreateTopicDialog.java
Normal file
@@ -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<String, String> 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<QName, Serializable> titledProps = new HashMap<QName, Serializable>(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<QName, Serializable> editProps = new HashMap<QName, Serializable>(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;
|
||||
}
|
||||
}
|
82
source/java/org/alfresco/web/bean/forums/EditPostDialog.java
Normal file
82
source/java/org/alfresco/web/bean/forums/EditPostDialog.java
Normal file
@@ -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<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// we need to remove the <br> 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, "<br/>", "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// remove link breaks and replace with <br/>
|
||||
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");
|
||||
}
|
||||
}
|
@@ -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;
|
@@ -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
|
||||
*
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -14,6 +14,9 @@ import org.alfresco.web.app.Application;
|
||||
*/
|
||||
public class CreateSpaceDialog extends CreateSpaceWizard
|
||||
{
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
|
@@ -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<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(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
|
||||
*
|
||||
|
@@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,64 +51,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<UIListItem> getIcons()
|
||||
{
|
||||
List<UIListItem> 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<UIListItem>(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<UIListItem>(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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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<QName, Serializable> contentProps = new HashMap<QName, Serializable>(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);
|
||||
}
|
||||
}
|
@@ -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<SelectItem> contentTypes;
|
||||
protected List<SelectItem> 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<QName, Serializable> 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<QName, Serializable> authorProps = new HashMap<QName, Serializable>(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<QName, Serializable> editProps = new HashMap<QName, Serializable>(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<QName, Serializable> authorProps = new HashMap<QName, Serializable>(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<QName, Serializable> titledProps = new HashMap<QName, Serializable>(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<QName, Serializable> editProps = new HashMap<QName, Serializable>(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<String, Object> 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<SelectItem> getContentTypes()
|
||||
{
|
||||
if (this.contentTypes == null)
|
||||
{
|
||||
this.contentTypes = new ArrayList<SelectItem>(80);
|
||||
ServiceRegistry registry = Repository.getServiceRegistry(FacesContext.getCurrentInstance());
|
||||
MimetypeService mimetypeService = registry.getMimetypeService();
|
||||
|
||||
// get the mime type display names
|
||||
Map<String, String> 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<SelectItem> getObjectTypes()
|
||||
{
|
||||
if (this.objectTypes == null)
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
// add the well known object type to start with
|
||||
this.objectTypes = new ArrayList<SelectItem>(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<String, String> 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
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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 <br> 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, "<br/>", "\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 <br/>
|
||||
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;
|
||||
}
|
||||
}
|
@@ -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 <br/>
|
||||
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;
|
||||
}
|
||||
}
|
@@ -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<SelectItem> templates;
|
||||
protected List<UIListItem> folderTypes;
|
||||
protected List<UIDescription> 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<QName, Serializable> 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<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(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<NodeRef> 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<String, Object> 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<SelectItem> getTemplateSpaces()
|
||||
{
|
||||
if (this.templates == null)
|
||||
{
|
||||
this.templates = new ArrayList<SelectItem>();
|
||||
|
||||
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<NodeRef> 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<UIListItem> getFolderTypes()
|
||||
{
|
||||
if (this.folderTypes == null)
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
this.folderTypes = new ArrayList<UIListItem>(2);
|
||||
this.folderTypeDescriptions = new ArrayList<UIDescription>(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<UIDescription> 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<UIListItem> 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<UIListItem> 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<UIListItem>(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<UIListItem>(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
|
||||
}
|
||||
}
|
@@ -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<QName, Serializable> titledProps = new HashMap<QName, Serializable>(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<QName, Serializable> editProps = new HashMap<QName, Serializable>(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;
|
||||
}
|
||||
}
|
@@ -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<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(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;
|
||||
|
@@ -1115,7 +1115,7 @@
|
||||
The bean that holds forums state.
|
||||
</description>
|
||||
<managed-bean-name>ForumsBean</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.ForumsBean</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.ForumsBean</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1152,40 +1152,7 @@
|
||||
The bean that backs up the Create Forums Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreateForumsDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewForumsWizard</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>fileFolderService</property-name>
|
||||
<value>#{FileFolderService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>searchService</property-name>
|
||||
<value>#{SearchService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>browseBean</property-name>
|
||||
<value>#{BrowseBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>namespaceService</property-name>
|
||||
<value>#{NamespaceService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Edit Forums Dialog
|
||||
</description>
|
||||
<managed-bean-name>EditForumsDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewForumsWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreateForumsDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1218,7 +1185,7 @@
|
||||
The bean that backs up the Create Forum Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreateForumDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewForumWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreateForumDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1246,45 +1213,12 @@
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Edit Forum Dialog
|
||||
</description>
|
||||
<managed-bean-name>EditForumDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewForumWizard</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>fileFolderService</property-name>
|
||||
<value>#{FileFolderService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>searchService</property-name>
|
||||
<value>#{SearchService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>browseBean</property-name>
|
||||
<value>#{BrowseBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>namespaceService</property-name>
|
||||
<value>#{NamespaceService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Create Topic Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreateTopicDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewTopicWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreateTopicDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1316,45 +1250,12 @@
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Edit Topic Dialog
|
||||
</description>
|
||||
<managed-bean-name>EditTopicDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewTopicWizard</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
<value>#{NodeService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>fileFolderService</property-name>
|
||||
<value>#{FileFolderService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>searchService</property-name>
|
||||
<value>#{SearchService}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>navigator</property-name>
|
||||
<value>#{NavigationBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>browseBean</property-name>
|
||||
<value>#{BrowseBean}</value>
|
||||
</managed-property>
|
||||
<managed-property>
|
||||
<property-name>namespaceService</property-name>
|
||||
<value>#{NamespaceService}</value>
|
||||
</managed-property>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>
|
||||
The bean that backs up the Create Post Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreatePostDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewPostWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreatePostDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1391,7 +1292,7 @@
|
||||
The bean that backs up the Edit Post Dialog
|
||||
</description>
|
||||
<managed-bean-name>EditPostDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewPostWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.EditPostDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1428,7 +1329,7 @@
|
||||
The bean that backs up the Create Reply Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreateReplyDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewReplyWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreateReplyDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
@@ -1465,7 +1366,7 @@
|
||||
The bean that backs up the Create Discussion Dialog
|
||||
</description>
|
||||
<managed-bean-name>CreateDiscussionDialog</managed-bean-name>
|
||||
<managed-bean-class>org.alfresco.web.bean.wizard.NewDiscussionWizard</managed-bean-class>
|
||||
<managed-bean-class>org.alfresco.web.bean.forums.CreateDiscussionDialog</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
<managed-property>
|
||||
<property-name>nodeService</property-name>
|
||||
|
@@ -778,70 +778,36 @@
|
||||
<from-view-id>/jsp/forums/*</from-view-id>
|
||||
<!-- NOTE: we can't have a case for browse in here otherwise you can -->
|
||||
<!-- never navigate back to the main browse screen -->
|
||||
<navigation-case>
|
||||
<from-outcome>createForums</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-forums.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>showForumsDetails</from-outcome>
|
||||
<to-view-id>/jsp/forums/forums-details.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>editForumsProperties</from-outcome>
|
||||
<to-view-id>/jsp/forums/edit-forums.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>deleteForums</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-forums.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>createForum</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-forum.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>deleteForum</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-forum.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>showForumDetails</from-outcome>
|
||||
<to-view-id>/jsp/forums/forum-details.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>editForumProperties</from-outcome>
|
||||
<to-view-id>/jsp/forums/edit-forum.jsp</to-view-id>
|
||||
<from-outcome>showTopicDetails</from-outcome>
|
||||
<to-view-id>/jsp/forums/topic-details.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
|
||||
<navigation-case>
|
||||
<from-outcome>deleteForums</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-forums.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>createTopic</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-topic.jsp</to-view-id>
|
||||
<from-outcome>deleteForum</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-forum.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>deleteTopic</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-topic.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>showTopicDetails</from-outcome>
|
||||
<to-view-id>/jsp/forums/topic-details.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>editTopicProperties</from-outcome>
|
||||
<to-view-id>/jsp/forums/edit-topic.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>createPost</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-post.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>createReply</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-reply.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>editPost</from-outcome>
|
||||
<to-view-id>/jsp/forums/edit-post.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>deletePost</from-outcome>
|
||||
<to-view-id>/jsp/forums/delete-post.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
|
||||
<navigation-case>
|
||||
<from-outcome>manageInvitedUsers</from-outcome>
|
||||
<to-view-id>/jsp/roles/manage-invited-users.jsp</to-view-id>
|
||||
@@ -854,18 +820,6 @@
|
||||
<from-outcome>export</from-outcome>
|
||||
<to-view-id>/jsp/dialog/export.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
<navigation-case>
|
||||
<from-outcome>createDiscussion</from-outcome>
|
||||
<to-view-id>/jsp/forums/create-discussion.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
</navigation-rule>
|
||||
|
||||
<navigation-rule>
|
||||
<from-view-id>/jsp/forums/create-topic.jsp</from-view-id>
|
||||
<navigation-case>
|
||||
<from-outcome>showTopic</from-outcome>
|
||||
<to-view-id>/jsp/forums/topic.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
</navigation-rule>
|
||||
|
||||
<navigation-rule>
|
||||
|
@@ -483,3 +483,8 @@ a.topToolbarLinkHighlight, a.topToolbarLinkHighlight:link, a.topToolbarLinkHighl
|
||||
{
|
||||
vertical-align: -20%;
|
||||
}
|
||||
|
||||
.alignTop
|
||||
{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 886 B After Width: | Height: | Size: 989 B |
@@ -155,7 +155,7 @@
|
||||
<td class="separator" width=1></td>
|
||||
<td width=118 valign=middle>
|
||||
<%-- View mode settings --%>
|
||||
<a:modeList itemSpacing="4" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"
|
||||
<a:modeList id="viewMode" itemSpacing="4" iconColumnWidth="20" selectedStyleClass="statusListHighlight" disabledStyleClass="statusListDisabled" selectedImage="/images/icons/Details.gif"
|
||||
value="#{BrowseBean.browseViewMode}" actionListener="#{BrowseBean.viewModeChanged}" menu="true" menuImage="/images/icons/menu.gif" styleClass="moreActionsMenu">
|
||||
<a:listItem value="details" label="#{msg.details_view}" />
|
||||
<a:listItem value="icons" label="#{msg.view_icon}" />
|
||||
|
@@ -77,22 +77,22 @@
|
||||
</div>
|
||||
<a:panel id="working-copy" rendered="#{DocumentDetailsBean.locked}">
|
||||
<div class="mainSubText">
|
||||
<h:outputText value="#{msg.working_copy_document}" />:
|
||||
<a:actionLink value="#{DocumentDetailsBean.workingCopyDocument.properties.name}" actionListener="#{BrowseBean.setupContentAction}" action="showDocDetails">
|
||||
<h:outputText id="out-workingcopy" value="#{msg.working_copy_document}" />:
|
||||
<a:actionLink id="act-details" rendered="#{DocumentDetailsBean.workingCopyDocument != null}" value="#{DocumentDetailsBean.workingCopyDocument.properties.name}" actionListener="#{BrowseBean.setupContentAction}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.workingCopyDocument.id}" />
|
||||
</a:actionLink>
|
||||
</div>
|
||||
</a:panel>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.documentdetails_description}" /></div>
|
||||
<div class="mainSubText"><h:outputText id="doc-details" value="#{msg.documentdetails_description}" /></div>
|
||||
</td>
|
||||
|
||||
<%-- Navigation --%>
|
||||
<td align=right>
|
||||
<a:actionLink value="#{msg.previous_item}" image="/images/icons/nav_prev.gif" showLink="false" actionListener="#{DocumentDetailsBean.previousItem}" action="showDocDetails">
|
||||
<a:actionLink id="act-prev" value="#{msg.previous_item}" image="/images/icons/nav_prev.gif" showLink="false" actionListener="#{DocumentDetailsBean.previousItem}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
<img src="<%=request.getContextPath()%>/images/icons/nav_file.gif" width=24 height=24 align=absmiddle>
|
||||
<a:actionLink value="#{msg.next_item}" image="/images/icons/nav_next.gif" showLink="false" actionListener="#{DocumentDetailsBean.nextItem}" action="showDocDetails">
|
||||
<a:actionLink id="act-next" value="#{msg.next_item}" image="/images/icons/nav_next.gif" showLink="false" actionListener="#{DocumentDetailsBean.nextItem}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
</td>
|
||||
@@ -116,8 +116,6 @@
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
<a:errors message="An error occurred" styleClass="errorMessage" />
|
||||
|
||||
<%-- wrapper comment used by the panel to add additional component facets --%>
|
||||
<h:panelGroup id="dashboard-panel-facets">
|
||||
<f:facet name="title">
|
||||
@@ -222,7 +220,8 @@
|
||||
action="#{DocumentDetailsBean.applyInlineEditable}"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" />
|
||||
</r:permissionEvaluator>
|
||||
<h:message for="document-props" styleClass="statusMessage" />
|
||||
<h:messages id="error1" globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
<h:message id="msg1" for="document-props" styleClass="statusMessage" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -253,7 +252,8 @@
|
||||
columns="1" mode="view" labelStyleClass="propertiesLabel" externalConfig="true" />
|
||||
<h:outputText id="no-inline-msg2" value="<br/>#{msg.not_inline_editable}<br/>"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" escape="false" />
|
||||
<h:messages id="props-locked-msgs" styleClass="errorMessage" layout="table" />
|
||||
<h:messages id="error2" globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
<h:message id="msg2" for="document-props-locked" styleClass="statusMessage" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -383,7 +383,7 @@
|
||||
<table cellpadding="1" cellspacing="1" border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
||||
<h:commandButton id="close-btn" value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_edit_doc_props">
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("edit-doc-properties:file-name").value.length == 0)
|
||||
{
|
||||
document.getElementById("edit-doc-properties:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("edit-doc-properties:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="edit-doc-properties">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/details_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.modify_props_of}" /> '<h:outputText value="#{BrowseBean.document.name}" />'</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.editdocument_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.document_properties}" /></td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.file_name}" />:</nobr></td>
|
||||
<td width="90%">
|
||||
<h:inputText id="file-name" value="#{EditDocPropsDialog.properties.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.content_type}" />:</nobr></td>
|
||||
<td>
|
||||
<r:mimeTypeSelector value="#{EditDocPropsDialog.properties.mimetype}" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.title}" />:</nobr></td>
|
||||
<td>
|
||||
<h:inputText id="title" value="#{EditDocPropsDialog.properties.title}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.description}" />:</nobr></td>
|
||||
<td>
|
||||
<h:inputText value="#{EditDocPropsDialog.properties.description}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.author}" />:</nobr></td>
|
||||
<td>
|
||||
<h:inputText value="#{EditDocPropsDialog.properties.author}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.other_properties}" /></td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<r:propertySheetGrid id="document-props" value="#{EditDocPropsDialog.editableNode}"
|
||||
var="editDocProps" columns="1"
|
||||
rendered="#{EditDocPropsDialog.otherPropertiesPresent}"
|
||||
externalConfig="true" finishButtonId="ok-button" />
|
||||
<h:outputText value="#{msg.no_other_properties}"
|
||||
rendered="#{EditDocPropsDialog.otherPropertiesPresent == false}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{EditDocPropsDialog.save}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="cancel-button" value="#{msg.cancel}" action="cancel" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Error Messages --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width=4></td>
|
||||
<td>
|
||||
<%-- messages tag to show messages not handled by other specific message tags --%>
|
||||
<h:messages globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width=4></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
126
source/web/jsp/forums/create-dialog.jsp
Normal file
126
source/web/jsp/forums/create-dialog.jsp
Normal file
@@ -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" %>
|
||||
|
||||
<f:verbatim>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var finishButtonPressed = false;
|
||||
window.onload = pageLoaded;
|
||||
|
||||
function pageLoaded()
|
||||
{
|
||||
document.getElementById("dialog:dialog-body:name").focus();
|
||||
document.getElementById("dialog").onsubmit = validate;
|
||||
document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();}
|
||||
checkButtonState();
|
||||
}
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("dialog:dialog-body:name"),
|
||||
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.properties}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="middle">
|
||||
</f:verbatim>
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.name}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td width="85%">
|
||||
</f:verbatim>
|
||||
<h:inputText id="name" value="#{DialogManager.bean.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.description}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:inputText id="description" value="#{DialogManager.bean.description}" size="35" maxlength="1024" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.icon}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
</f:verbatim>
|
||||
<a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}"
|
||||
panelBorder="blue" panelBgcolor="#D3E6FE">
|
||||
<a:listItems value="#{DialogManager.bean.icons}" />
|
||||
</a:imagePickerRadioPanel>
|
||||
<f:verbatim>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
||||
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_discussion">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-discussion" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/create_topic_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.create_topic}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_topic_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_forum_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.topic_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.subject}" />:</td>
|
||||
<td>
|
||||
<h:inputText id="subject" value="#{CreateDiscussionDialog.name}" size="50" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{CreateDiscussionDialog.icon}">
|
||||
<a:listItems value="#{CreateDiscussionDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.message}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.message}" />:</td>
|
||||
<td valign="top">
|
||||
<h:inputTextarea id="message" value="#{CreateDiscussionDialog.message}" rows="6" cols="70"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_topic_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.create_topic}" action="#{CreateDiscussionDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true"
|
||||
onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreateDiscussionDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
document.getElementById("create-discussion:subject").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-discussion:subject").value.length == 0 ||
|
||||
document.getElementById("create-discussion:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("create-discussion:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-discussion:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("create-discussion:subject"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_forum">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-forum" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/create_forum_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.create_forum}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_forum_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_forum_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.forum_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.name}" />:</td>
|
||||
<td width="95%">
|
||||
<h:inputText id="name" value="#{CreateForumDialog.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.description}" />:</td>
|
||||
<td>
|
||||
<h:inputText value="#{CreateForumDialog.description}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.other_options}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{CreateForumDialog.icon}">
|
||||
<a:listItems value="#{CreateForumDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_forum_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.create_forum}" action="#{CreateForumDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true"
|
||||
onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreateForumDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
document.getElementById("create-forum:name").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-forum:name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("create-forum:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-forum:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("create-forum:name"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_forums">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-forums" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/create_forums_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.create_forums}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_forums_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_forums_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.forums_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.name}" />:</td>
|
||||
<td width="95%">
|
||||
<h:inputText id="name" value="#{CreateForumsDialog.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.description}" />:</td>
|
||||
<td>
|
||||
<h:inputText value="#{CreateForumsDialog.description}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.other_options}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{CreateForumsDialog.icon}">
|
||||
<a:listItems value="#{CreateForumsDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_forums_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.create_forums}" action="#{CreateForumsDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true"
|
||||
onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreateForumsDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
document.getElementById("create-forums:name").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-forums:name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("create-forums:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-forums:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("create-forums:name"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
49
source/web/jsp/forums/create-post-dialog.jsp
Normal file
49
source/web/jsp/forums/create-post-dialog.jsp
Normal file
@@ -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" %>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.getElementById("dialog:dialog-body:message").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h:panelGrid cellpadding="2" cellspacing="2" border="0" width="100%"
|
||||
rowClasses="wizardSectionHeading, paddingRow">
|
||||
<h:outputText value="#{msg.message}" />
|
||||
<h:panelGrid cellpadding="2" cellspacing="6" border="0" columns="3"
|
||||
columnClasses="alignTop, alignTop, alignTop">
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<h:outputText value="#{msg.message}:" />
|
||||
<h:inputTextarea id="message" value="#{DialogManager.bean.content}" rows="6" cols="70"
|
||||
onkeyup="checkButtonState();" onchange="checkButtonState();" />
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_post">
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-post:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("create-post:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-post:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-post">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/create_post_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.create_post}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_post_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_post_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.message}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><h:outputText value="#{msg.message}" />:</td>
|
||||
<td>
|
||||
<h:inputTextarea id="message" value="#{CreatePostDialog.content}" rows="6" cols="70"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_post_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.post}" action="#{CreatePostDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreatePostDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
document.getElementById("create-post:message").focus();
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
81
source/web/jsp/forums/create-reply-dialog.jsp
Normal file
81
source/web/jsp/forums/create-reply-dialog.jsp
Normal file
@@ -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" %>
|
||||
|
||||
<f:verbatim>
|
||||
<script type="text/javascript">
|
||||
document.getElementById("dialog:dialog-body:message").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</f:verbatim>
|
||||
|
||||
<h:panelGrid cellpadding="2" cellspacing="2" border="0" width="100%"
|
||||
rowClasses="wizardSectionHeading, paddingRow">
|
||||
<h:outputText value="#{msg.message}" />
|
||||
<h:panelGrid cellpadding="2" cellspacing="2" border="0" columns="3"
|
||||
columnClasses="alignTop, alignTop, alignTop">
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<h:outputText value="#{msg.message}:" />
|
||||
<h:inputTextarea id="message" value="#{DialogManager.bean.content}" rows="6" cols="70"
|
||||
onkeyup="checkButtonState();" onchange="checkButtonState();" />
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
|
||||
<f:verbatim>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<% TopicBubbleViewRenderer.renderBubbleTop(out, request.getContextPath(), "yellow", "#FFF5A3"); %>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.posted}: " styleClass="mainSubTitle" escape="false" />
|
||||
<h:outputText value="#{BrowseBean.document.properties.created}">
|
||||
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
|
||||
</h:outputText>
|
||||
<f:verbatim>
|
||||
<% TopicBubbleViewRenderer.renderBubbleMiddle(out, request.getContextPath(), "yellow"); %>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{DialogManager.bean.replyContent}" escape="false" />
|
||||
<f:verbatim>
|
||||
<% TopicBubbleViewRenderer.renderBubbleBottom(out, request.getContextPath(), "yellow"); %>
|
||||
</td>
|
||||
<td valign="top">
|
||||
</f:verbatim>
|
||||
<h:graphicImage id="poster" url="/images/icons/user_large.gif" />
|
||||
<h:outputText value="<br/>#{BrowseBean.document.properties.creator}" escape="false" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
||||
|
||||
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_reply">
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-reply:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("create-reply:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-reply:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-reply">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/post_reply_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.post_reply}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_reply_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_reply_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.reply_message}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><h:outputText value="#{msg.message}" />:</td>
|
||||
<td>
|
||||
<h:inputTextarea id="message" value="#{CreateReplyDialog.content}" rows="6" cols="70"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_reply_finish}" /></td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%">
|
||||
<% TopicBubbleViewRenderer.renderBubbleTop(out, request.getContextPath(), "yellow", "#FFF5A3"); %>
|
||||
<h:outputText value="#{msg.posted}:" styleClass="mainSubTitle" />
|
||||
<h:outputText value="#{BrowseBean.document.properties.created}">
|
||||
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
|
||||
</h:outputText>
|
||||
<% TopicBubbleViewRenderer.renderBubbleMiddle(out, request.getContextPath(), "yellow"); %>
|
||||
<h:outputText value="#{CreateReplyDialog.replyContent}" escape="false" />
|
||||
<% TopicBubbleViewRenderer.renderBubbleBottom(out, request.getContextPath(), "yellow"); %>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<h:graphicImage id="poster" url="/images/icons/user_large.gif" /><br/>
|
||||
<h:outputText value="#{BrowseBean.document.properties.creator}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.reply}" action="#{CreateReplyDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreateReplyDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
document.getElementById("create-reply:message").focus();
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
154
source/web/jsp/forums/create-topic-dialog.jsp
Normal file
154
source/web/jsp/forums/create-topic-dialog.jsp
Normal file
@@ -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" %>
|
||||
|
||||
<f:verbatim>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var finishButtonPressed = false;
|
||||
window.onload = pageLoaded;
|
||||
|
||||
function pageLoaded()
|
||||
{
|
||||
document.getElementById("dialog:dialog-body:name").focus();
|
||||
document.getElementById("dialog").onsubmit = validate;
|
||||
document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();}
|
||||
checkButtonState();
|
||||
}
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:name").value.length == 0 ||
|
||||
document.getElementById("dialog:dialog-body:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("dialog:dialog-body:name"),
|
||||
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.properties}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="middle">
|
||||
</f:verbatim>
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.name}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td width="85%">
|
||||
</f:verbatim>
|
||||
<h:inputText id="name" value="#{DialogManager.bean.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.description}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:inputText id="description" value="#{DialogManager.bean.description}" size="35" maxlength="1024" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.icon}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
</f:verbatim>
|
||||
<a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}"
|
||||
panelBorder="blue" panelBgcolor="#d3e6fe">
|
||||
<a:listItems value="#{DialogManager.bean.icons}" />
|
||||
</a:imagePickerRadioPanel>
|
||||
<f:verbatim>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.message}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
</f:verbatim>
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td valign="top">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.message}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td valign="top">
|
||||
</f:verbatim>
|
||||
<h:inputTextarea id="message" value="#{DialogManager.bean.message}" rows="6" cols="70"
|
||||
onkeyup="checkButtonState();" onchange="checkButtonState();" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
||||
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_create_topic">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="create-topic" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/create_topic_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.create_topic}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.create_topic_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_topic_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.topic_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.subject}" />:</td>
|
||||
<td>
|
||||
<h:inputText id="subject" value="#{CreateTopicDialog.name}" size="50" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{CreateTopicDialog.icon}">
|
||||
<a:listItems value="#{CreateTopicDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.message}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.message}" />:</td>
|
||||
<td valign="top">
|
||||
<h:inputTextarea id="message" value="#{CreateTopicDialog.message}" rows="6" cols="70"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.create_topic_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.create_topic}" action="#{CreateTopicDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true"
|
||||
onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{CreateTopicDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
document.getElementById("create-topic:subject").focus();
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("create-topic:subject").value.length == 0 ||
|
||||
document.getElementById("create-topic:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("create-topic:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("create-topic:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("create-topic:subject"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_edit_forum">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="edit-forum" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/#{BrowseBean.actionSpace.properties.icon}.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.modify_props_of}" /> '<h:outputText value="#{BrowseBean.actionSpace.name}" />'</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.edit_forum_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.forum_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.name}" />:</td>
|
||||
<td width="90%">
|
||||
<h:inputText id="name" value="#{EditForumDialog.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.description}" />:</td>
|
||||
<td>
|
||||
<h:inputText value="#{EditForumDialog.description}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.other_options}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_space_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{EditForumDialog.icon}">
|
||||
<a:listItems value="#{EditForumDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{EditForumDialog.finish}"
|
||||
styleClass="wizardButton" onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{EditForumDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("edit-forum:name").value.length == 0)
|
||||
{
|
||||
document.getElementById("edit-forum:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("edit-forum:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("edit-forum:name"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_edit_forums">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="edit-forums" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/#{BrowseBean.actionSpace.properties.icon}.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.modify_props_of}" /> '<h:outputText value="#{BrowseBean.actionSpace.name}" />'</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.edit_forums_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.forums_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.name}" />:</td>
|
||||
<td width="90%">
|
||||
<h:inputText id="name" value="#{EditForumsDialog.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.description}" />:</td>
|
||||
<td>
|
||||
<h:inputText value="#{EditForumsDialog.description}" size="35" maxlength="1024" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.other_options}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_space_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{EditForumsDialog.icon}">
|
||||
<a:listItems value="#{EditForumsDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{EditForumsDialog.finish}"
|
||||
styleClass="wizardButton" onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{EditForumsDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("edit-forums:name").value.length == 0)
|
||||
{
|
||||
document.getElementById("edit-forums:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("edit-forums:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("edit-forums:name"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_edit_post">
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("edit-post:message").value.length == 0)
|
||||
{
|
||||
document.getElementById("edit-post:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("edit-post:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="edit-post">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/edit_post_large.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.edit_post}" /></div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.edit_post_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_create_post_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.message}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><h:outputText value="#{msg.message}" />:</td>
|
||||
<td>
|
||||
<h:inputTextarea id="message" value="#{EditPostDialog.content}" rows="6" cols="70"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2"><h:outputText value="#{msg.edit_post_finish}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.post}" action="#{EditPostDialog.finish}"
|
||||
styleClass="wizardButton" disabled="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{EditPostDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
document.getElementById("edit-post:message").focus();
|
||||
checkButtonState();
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -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" %>
|
||||
|
||||
<r:page titleId="title_edit_topic">
|
||||
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<f:view>
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
<h:form acceptCharset="UTF-8" id="edit-topic" onsubmit="return validate();">
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#EEEEEE">
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="32">
|
||||
<h:graphicImage id="wizard-logo" url="/images/icons/#{BrowseBean.actionSpace.properties.icon}.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<div class="mainTitle"><h:outputText value="#{msg.modify_props_of}" /> '<h:outputText value="#{BrowseBean.actionSpace.name}" />'</div>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.edit_topic_description}" /></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
|
||||
<a:errors message="#{msg.error_dialog}" styleClass="errorMessage" />
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"><h:outputText value="#{msg.topic_props}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h:outputText value="#{msg.subject}" />:</td>
|
||||
<td width="90%">
|
||||
<h:inputText id="name" value="#{EditTopicDialog.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" /> *
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> <h:outputText value="#{msg.other_options}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><nobr><h:outputText value="#{msg.choose_space_icon}" />:</nobr></td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<a:imagePickerRadio columns="6" spacing="4" value="#{EditTopicDialog.icon}">
|
||||
<a:listItems value="#{EditTopicDialog.icons}" />
|
||||
</a:imagePickerRadio>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton id="ok-button" value="#{msg.ok}" action="#{EditTopicDialog.finish}"
|
||||
styleClass="wizardButton" onclick="finishButtonPressed = true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.cancel}" action="#{EditTopicDialog.cancel}" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</h:form>
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
var finishButtonPressed = false;
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("edit-topic:name").value.length == 0)
|
||||
{
|
||||
document.getElementById("edit-topic:ok-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("edit-topic:ok-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
return validateName(document.getElementById("edit-topic:name"),
|
||||
'<a:outputText value="#{msg.validation_invalid_character}" />',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -129,7 +129,7 @@
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="Write">
|
||||
<a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/Change_details.gif"
|
||||
action="dialog:editForumProperties" actionListener="#{EditForumDialog.startWizardForEdit}" />
|
||||
action="dialog:editForum" />
|
||||
</r:permissionEvaluator>
|
||||
</f:facet>
|
||||
</h:column>
|
||||
|
@@ -129,7 +129,7 @@
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="Write">
|
||||
<a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/Change_details.gif"
|
||||
action="dialog:editForumsProperties" actionListener="#{EditForumsDialog.startWizardForEdit}" />
|
||||
action="dialog:editForums" />
|
||||
</r:permissionEvaluator>
|
||||
</f:facet>
|
||||
</h:column>
|
||||
|
@@ -130,7 +130,7 @@
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{SpaceDetailsBean.space}" allow="Write">
|
||||
<a:actionLink id="titleLink1" value="#{msg.modify}" showLink="false" image="/images/icons/Change_details.gif"
|
||||
action="dialog:editTopicProperties" actionListener="#{EditTopicDialog.startWizardForEdit}" />
|
||||
action="dialog:editTopic" />
|
||||
</r:permissionEvaluator>
|
||||
</f:facet>
|
||||
</h:column>
|
||||
|
@@ -112,7 +112,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<%-- language selection drop-down --%>
|
||||
<h:selectOneMenu value="#{LoginBean.language}" style="width:150px" onchange="document.forms['loginForm'].submit(); return true;">
|
||||
<h:selectOneMenu id="language" value="#{LoginBean.language}" style="width:150px" onchange="document.forms['loginForm'].submit(); return true;">
|
||||
<f:selectItems value="#{LoginBean.languages}" />
|
||||
</h:selectOneMenu>
|
||||
</td>
|
||||
|
@@ -45,10 +45,8 @@
|
||||
</td>
|
||||
<td width="90%">
|
||||
</f:verbatim>
|
||||
<%--
|
||||
disabled="#{WizardManager.bean.inEditMode}"
|
||||
--%>
|
||||
<h:selectOneMenu id="rule-type" value="#{WizardManager.bean.type}">
|
||||
<h:selectOneMenu id="rule-type" value="#{WizardManager.bean.type}"
|
||||
disabled="#{WizardManager.bean.ruleTypeDisabled}">
|
||||
<f:selectItems value="#{WizardManager.bean.types}" />
|
||||
</h:selectOneMenu>
|
||||
<f:verbatim>
|
||||
|
@@ -66,26 +66,45 @@
|
||||
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading">
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.space_props}" />
|
||||
<h:outputText value="#{msg.properties}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="middle">
|
||||
</f:verbatim>
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.name}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<td width="85%">
|
||||
</f:verbatim>
|
||||
<h:inputText id="name" value="#{DialogManager.bean.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();"/>
|
||||
<f:verbatim> *
|
||||
onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.title}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:inputText id="title" value="#{DialogManager.bean.title}" size="35" maxlength="1024" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.description}:" />
|
||||
@@ -97,18 +116,11 @@
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.other_options}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.choose_space_icon}:" />
|
||||
<h:outputText value="#{msg.icon}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
@@ -122,14 +134,6 @@
|
||||
</td></tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="paddingRow"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.create_space_finish}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
||||
|
||||
|
@@ -88,26 +88,45 @@
|
||||
|
||||
<table cellpadding="3" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading">
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.title_space_details}"/>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="middle">
|
||||
</f:verbatim>
|
||||
<h:graphicImage value="/images/icons/required_field.gif" alt="Required Field" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.name}:"/>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<td width="85%">
|
||||
</f:verbatim>
|
||||
<h:inputText id="name" value="#{WizardManager.bean.name}" size="35" maxlength="1024"
|
||||
onkeyup="javascript:checkButtonState();" />
|
||||
<f:verbatim> *
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.title}:" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:inputText id="title" value="#{WizardManager.bean.title}" size="35" maxlength="1024" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.description}:"/>
|
||||
@@ -120,15 +139,10 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="wizardSectionHeading"> </f:verbatim>
|
||||
<h:outputText value="#{msg.other_options}"/>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.choose_space_icon}:"/>
|
||||
<h:outputText value="#{msg.icon}:"/>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
|
Reference in New Issue
Block a user