diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index f1d41d9697..f3b4b1c29f 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -313,6 +313,11 @@ bubble_view=Bubble View replies=Replies on=On reply_message=Reply Message +edit_forums_description=Modify the forums 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. +edit_post_finish=To save the message click Post. # Common Wizard messages steps=Steps @@ -826,6 +831,10 @@ title_create_topic=Create Topic title_topic_details=Topic Details title_create_post=Post Message title_create_reply=Create Reply +title_edit_forums=Edit Forum Space Details +title_edit_forum=Edit Forum Details +title_edit_topic=Edit Topic Details +title_edit_post=Edit Post # UI Error messages error_generic=A system error happened during the operation: {0} @@ -864,6 +873,7 @@ error_create_post_dialog=Please correct the errors below then click Post. error_create_reply_dialog=Please correct the errors below then click Reply. error_create_category_dialog=Please correct the errors below then click New Category. error_create_group_dialog=Please correct the errors below then click Create Group. +error_dialog=Please correct the errors below then click OK. error_wizard=Please correct the errors below then click Finish. error_update_category=Failed to update category due to system error: {0} error_update_simpleworkflow=Failed to update simple workflow due to system error: {0} diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index 5ff4136fa0..345470d4b9 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -166,7 +166,7 @@ - + @@ -319,7 +319,7 @@ - + diff --git a/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java b/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java index f16a8782c8..40b0e9e5df 100644 --- a/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/NewPostWizard.java @@ -18,11 +18,17 @@ 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.util.GUID; +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. @@ -39,28 +45,91 @@ public class NewPostWizard extends CreateContentWizard { super.init(); - // set up for creating a post instead of HTML - this.createType = CONTENT_TEXT; + // 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 in here + + // we need to setup the content in the browse bean first + this.browseBean.setupContentAction(event); + + super.startWizardForEdit(event); + } + + /** + * @see org.alfresco.web.bean.wizard.AbstractWizardBean#populate() + */ + @Override + public void populate() + { + super.populate(); + + // we need to remove the
tags and replace with carriage returns + // and then setup the content member variable + Node currentDocument = this.browseBean.getDocument(); + ContentReader reader = this.contentService.getReader(currentDocument.getNodeRef(), + ContentModel.PROP_CONTENT); + + if (reader != null) + { + String htmlContent = reader.getContentString(); + if (htmlContent != null) + { + this.content = StringUtils.replace(htmlContent, "
", "\r\n"); + } + } + } + /** * @see org.alfresco.web.bean.wizard.AbstractWizardBean#finish() */ @Override public String finish() { - // create appropriate values for filename, title and content type - this.fileName = GUID.generate() + ".txt"; - this.contentType = Repository.getMimeTypeForFileName( - FacesContext.getCurrentInstance(), this.fileName); - this.title = this.fileName; - - // remove link breaks and replace with
- this.content = Utils.replaceLineBreaks(this.content); + if (this.editMode) + { + // remove the line breaks before the save + this.content = Utils.replaceLineBreaks(this.content); + } + else + { + // create appropriate values for filename, title and content type + this.fileName = GUID.generate() + ".html"; + this.contentType = Repository.getMimeTypeForFileName( + FacesContext.getCurrentInstance(), this.fileName); + this.title = this.fileName; + + // remove link breaks and replace with
+ this.content = Utils.replaceLineBreaks(this.content); + } return super.finish(); } + + /** + * @see org.alfresco.web.bean.wizard.BaseContentWizard#performCustomProcessing() + */ + @Override + protected void performCustomProcessing() + { + // update the content + Node currentDocument = this.browseBean.getDocument(); + + ContentWriter writer = this.contentService.getWriter(currentDocument.getNodeRef(), + ContentModel.PROP_CONTENT, true); + if (writer != null) + { + writer.putContent(this.content); + } + } } diff --git a/source/web/WEB-INF/faces-config-navigation.xml b/source/web/WEB-INF/faces-config-navigation.xml index 2e1c26cba3..2dae01cde6 100644 --- a/source/web/WEB-INF/faces-config-navigation.xml +++ b/source/web/WEB-INF/faces-config-navigation.xml @@ -916,6 +916,10 @@ showForumsDetails /jsp/forums/forums-details.jsp + + editForumsProperties + /jsp/forums/edit-forums.jsp + deleteForums /jsp/forums/delete-forums.jsp @@ -932,6 +936,10 @@ showForumDetails /jsp/forums/forum-details.jsp + + editForumProperties + /jsp/forums/edit-forum.jsp + createTopic /jsp/forums/create-topic.jsp @@ -944,6 +952,10 @@ showTopicDetails /jsp/forums/topic-details.jsp + + editTopicProperties + /jsp/forums/edit-topic.jsp + createPost /jsp/forums/create-post.jsp @@ -952,6 +964,10 @@ createReply /jsp/forums/create-reply.jsp + + editPost + /jsp/forums/edit-post.jsp + deletePost /jsp/forums/delete-post.jsp @@ -968,6 +984,14 @@ browse /jsp/forums/forums.jsp + + nextItem + /jsp/forums/forums-details.jsp + + + previousItem + /jsp/forums/forums-details.jsp + @@ -976,6 +1000,14 @@ browse /jsp/forums/forum.jsp + + nextItem + /jsp/forums/forum-details.jsp + + + previousItem + /jsp/forums/forum-details.jsp + @@ -1028,6 +1060,14 @@ finish /jsp/forums/topic.jsp + + nextItem + /jsp/forums/topic-details.jsp + + + previousItem + /jsp/forums/topic-details.jsp + @@ -1069,5 +1109,53 @@ /jsp/forums/topic.jsp + + + /jsp/forums/edit-forums.jsp + + cancel + /jsp/forums/forums-details.jsp + + + finish + /jsp/forums/forums-details.jsp + + + + + /jsp/forums/edit-forum.jsp + + cancel + /jsp/forums/forum-details.jsp + + + finish + /jsp/forums/forum-details.jsp + + + + + /jsp/forums/edit-topic.jsp + + cancel + /jsp/forums/topic-details.jsp + + + finish + /jsp/forums/topic-details.jsp + + + + + /jsp/forums/edit-post.jsp + + cancel + /jsp/forums/topic.jsp + + + finish + /jsp/forums/topic.jsp + + diff --git a/source/web/WEB-INF/faces-config.xml b/source/web/WEB-INF/faces-config.xml index c64c87db83..59a72d3c1b 100644 --- a/source/web/WEB-INF/faces-config.xml +++ b/source/web/WEB-INF/faces-config.xml @@ -1206,6 +1206,43 @@ + + + The bean that backs up the Edit Post Dialog + + EditPostDialog + org.alfresco.web.bean.wizard.NewPostWizard + session + + nodeService + #{NodeService} + + + fileFolderService + #{FileFolderService} + + + searchService + #{SearchService} + + + navigator + #{NavigationBean} + + + browseBean + #{BrowseBean} + + + contentService + #{ContentService} + + + dictionaryService + #{DictionaryService} + + + The bean that backs up the Create Reply Dialog diff --git a/source/web/jsp/forums/create-topic.jsp b/source/web/jsp/forums/create-topic.jsp index ce86bceab0..447ab1aca0 100644 --- a/source/web/jsp/forums/create-topic.jsp +++ b/source/web/jsp/forums/create-topic.jsp @@ -118,16 +118,6 @@ - <%-- - - : - - - -  * - - - --%> : diff --git a/source/web/jsp/forums/edit-forum.jsp b/source/web/jsp/forums/edit-forum.jsp new file mode 100644 index 0000000000..cce3368c5f --- /dev/null +++ b/source/web/jsp/forums/edit-forum.jsp @@ -0,0 +1,190 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific + language governing permissions and limitations under the + License. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + + + <%-- load a bundle of properties with I18N strings --%> + + + + + <%-- Main outer table --%> + + + <%-- Title bar --%> + + + + + <%-- Main area --%> + + <%-- Shelf --%> + + + <%-- Work Area --%> + + +
+ <%@ include file="../parts/titlebar.jsp" %> +
+ <%@ include file="../parts/shelf.jsp" %> + + + <%-- Breadcrumb --%> + <%@ include file="../parts/breadcrumb.jsp" %> + + <%-- Status and Actions --%> + + + + + + + <%-- separator row with gradient shadow --%> + + + + + + + <%-- Details --%> + + + + + + + <%-- separator row with bottom panel graphics --%> + + + + + + +
+ + <%-- Status and Actions inner contents table --%> + <%-- Generally this consists of an icon, textual summary and actions for the current object --%> + + + + + +
+ +
+
''
+
+
+ +
+ + + + + + +
+ + + + <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> + + + + + + + + + + + + + + + + + + + + +
: +  * +
: + +
 
: +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + + + + +
+ +
+ +
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+
+ +
+ +
+ +
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-forums.jsp b/source/web/jsp/forums/edit-forums.jsp new file mode 100644 index 0000000000..c6e1455aaa --- /dev/null +++ b/source/web/jsp/forums/edit-forums.jsp @@ -0,0 +1,190 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific + language governing permissions and limitations under the + License. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + + + <%-- load a bundle of properties with I18N strings --%> + + + + + <%-- Main outer table --%> + + + <%-- Title bar --%> + + + + + <%-- Main area --%> + + <%-- Shelf --%> + + + <%-- Work Area --%> + + +
+ <%@ include file="../parts/titlebar.jsp" %> +
+ <%@ include file="../parts/shelf.jsp" %> + + + <%-- Breadcrumb --%> + <%@ include file="../parts/breadcrumb.jsp" %> + + <%-- Status and Actions --%> + + + + + + + <%-- separator row with gradient shadow --%> + + + + + + + <%-- Details --%> + + + + + + + <%-- separator row with bottom panel graphics --%> + + + + + + +
+ + <%-- Status and Actions inner contents table --%> + <%-- Generally this consists of an icon, textual summary and actions for the current object --%> + + + + + +
+ +
+
''
+
+
+ +
+ + + + + + +
+ + + + <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> + + + + + + + + + + + + + + + + + + + + +
: +  * +
: + +
 
: +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + + + + +
+ +
+ +
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+
+ +
+ +
+ +
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-post.jsp b/source/web/jsp/forums/edit-post.jsp new file mode 100644 index 0000000000..dfa73117b6 --- /dev/null +++ b/source/web/jsp/forums/edit-post.jsp @@ -0,0 +1,179 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific + language governing permissions and limitations under the + License. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + + + <%-- load a bundle of properties with I18N strings --%> + + + + + <%-- Main outer table --%> + + + <%-- Title bar --%> + + + + + <%-- Main area --%> + + <%-- Shelf --%> + + + <%-- Work Area --%> + + +
+ <%@ include file="../parts/titlebar.jsp" %> +
+ <%@ include file="../parts/shelf.jsp" %> + + + <%-- Breadcrumb --%> + <%@ include file="../parts/breadcrumb.jsp" %> + + <%-- Status and Actions --%> + + + + + + + <%-- separator row with gradient shadow --%> + + + + + + + <%-- Details --%> + + + + + + + <%-- separator row with bottom panel graphics --%> + + + + + + +
+ + <%-- Status and Actions inner contents table --%> + <%-- Generally this consists of an icon, textual summary and actions for the current object --%> + + + + + +
+ +
+
+
+
+ +
+ + + + + + +
+ + + + <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> + + + + + + + + + + + + +
: + +
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + + + + +
+ +
+ +
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+
+ +
+ + + +
+ +
\ No newline at end of file diff --git a/source/web/jsp/forums/edit-topic.jsp b/source/web/jsp/forums/edit-topic.jsp new file mode 100644 index 0000000000..45a5a956d4 --- /dev/null +++ b/source/web/jsp/forums/edit-topic.jsp @@ -0,0 +1,184 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific + language governing permissions and limitations under the + License. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> +<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> + + + + + + + + <%-- load a bundle of properties with I18N strings --%> + + + + + <%-- Main outer table --%> + + + <%-- Title bar --%> + + + + + <%-- Main area --%> + + <%-- Shelf --%> + + + <%-- Work Area --%> + + +
+ <%@ include file="../parts/titlebar.jsp" %> +
+ <%@ include file="../parts/shelf.jsp" %> + + + <%-- Breadcrumb --%> + <%@ include file="../parts/breadcrumb.jsp" %> + + <%-- Status and Actions --%> + + + + + + + <%-- separator row with gradient shadow --%> + + + + + + + <%-- Details --%> + + + + + + + <%-- separator row with bottom panel graphics --%> + + + + + + +
+ + <%-- Status and Actions inner contents table --%> + <%-- Generally this consists of an icon, textual summary and actions for the current object --%> + + + + + +
+ +
+
''
+
+
+ +
+ + + + + + +
+ + + + <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %> + + + + + + + + + + + + + + + + +
: +  * +
 
: +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %> +
+ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> + + + + + + + +
+ +
+ +
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> +
+
+
+ +
+ +
+ +
\ No newline at end of file diff --git a/source/web/jsp/forums/forum-details.jsp b/source/web/jsp/forums/forum-details.jsp index d369f9215d..fef4b7b9d1 100644 --- a/source/web/jsp/forums/forum-details.jsp +++ b/source/web/jsp/forums/forum-details.jsp @@ -146,18 +146,16 @@ <%-- wrapper comment used by the panel to add additional component facets --%> - <%-- + action="editForumProperties" actionListener="#{EditForumDialog.startWizardForEdit}" /> - facetsId="props-panel-facets" - --%> - diff --git a/source/web/jsp/forums/forums-details.jsp b/source/web/jsp/forums/forums-details.jsp index aaaba7258a..b22c3dc554 100644 --- a/source/web/jsp/forums/forums-details.jsp +++ b/source/web/jsp/forums/forums-details.jsp @@ -146,18 +146,16 @@
<%-- wrapper comment used by the panel to add additional component facets --%> - <%-- + action="editForumsProperties" actionListener="#{EditForumsDialog.startWizardForEdit}" /> - facetsId="props-panel-facets" - --%> - diff --git a/source/web/jsp/forums/topic-details.jsp b/source/web/jsp/forums/topic-details.jsp index ca939dd8d9..425153b164 100644 --- a/source/web/jsp/forums/topic-details.jsp +++ b/source/web/jsp/forums/topic-details.jsp @@ -146,18 +146,16 @@
<%-- wrapper comment used by the panel to add additional component facets --%> - <%-- + action="editTopicProperties" actionListener="#{EditTopicDialog.startWizardForEdit}" /> - facetsId="props-panel-facets" - --%> - diff --git a/source/web/jsp/forums/topic.jsp b/source/web/jsp/forums/topic.jsp index f005290fda..445015cf3f 100644 --- a/source/web/jsp/forums/topic.jsp +++ b/source/web/jsp/forums/topic.jsp @@ -222,7 +222,7 @@ - +