mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged V3.2E to HEAD
17571: ETHREEOH-1863 - alfresco-webscript-framework.jar is not available in the alfresco-enterprise-sdk-3.1 - although the framework jar was already part of the SDK when I looked I have done some re-organising of - names and paths and added missing source files. By no means finished but its another step forward. 17581: Fix for ETHREEOH-3380 - upload servlet in Explorer does not handle well upload errors as no error message is displayed on the client browser. 17582: ETHREEOH-2760 - Sealing of standard library root scope objects to prevent script potentially interfering with another scripts processing. - Example provided to fix ACT ticket issue against fixed codeline. 17583: Fixed ETHREEOH-3458 "If the rss feed to display returns bad formatted data or is unavailable an ugly free marker error is displayed" - Rss urls pointing to a "missing resource"/"bad formated rss data" is now displayed as "Rss feed is unavailable"/"Can't read rss feed" (before they displayed freemarker error making it impossible to re-configure) - Title is now updated after config (therefore the change to return json instead of html) (before a page refresh was needed) - The new url is now updated in the "2nd" config dialog after it has been changed in the first (before page refresh was needed) - Removed un-internationalised string from config respons template 17584: ALFCOM-3675 - WebDAV script does not allow inline editing for documents with name in upper case. - Now allows any case, as per supplied patch. - Also added support for Office 2007 file types so they can now be opened in write mode via webdav in IE6/7 from the Explorer client. - Tested in IE6/7. 17585: Yet another fix for ETHREEOH-1733 - agenda view all days events fixed 17586: ETHREEOH-1843: /api/sites/*/memberships search is slow on specific query 17587: Add cluster lock for JPBM job/timer executor (for WCM submits in a clustered env - ETHREEOH-2230 / ETHREEOH-3319) 17590: New icons for View Original & View Working Copy actions 17591: ETHREEOH-2879 - Alfresco + OpenLDAP: Unable to retrieve user from repository. - Fixed SURF to handle users without (utterly bizarely) First or Last names or even, usefully, neither. 17592: Merged V3.2 to V3.1 17415: Fix for ETHREEOH-3293 - Editing user details on large user repository causes Hibernate exception. Fix for ETHREEOH-3294 - Extreemly slow repository performance adding a new user to large user repository via the Explorer Client admin console. 17593: Icon for doclib View In Browser action 17594: ETHREEOH-2864 - Share - Documents cannot be deleted (in "All Documents" view) 17595: ETHREEOH-3203: Impossibility to add comment to any object by SiteContributor user 17596: ETHREEOH-1469 - SMTP errors not reported when sending an invitation - now errors are reported. - may upset unit tests, i've fixed those I know about 17598: Fixed ETHREEOH-3445 "Admin Console - Group Search sometimes never displays results list" 17601: ETHREEOH-3382 - Share Sites menu is broken in "debug" mode. Reworked menu css. Removed unused footer component. 17602: Share global debug flags removed from web-framework-config-application.xml. Use share-config-custom.xml instead. 17603: Changed wording on Create/Edit Site dialogs from "Access" to "Visibility". "Access" was no longer accurate now that Moderated Sites' content is private to non-members. 17604: ETHREEOH-1469 - SMTP error when sending an invitation does not return a failure. - SiteServiceTest also needed "fixing" 17606: ETHREEOH-3475 - IE: Second search on add groups to site gets yui error but works. Related to YUI bug 2286608. YUI patched instead of all DataTable client code. (Patch removed from DocLib) 17607: ETHREEOH-3470 - "Add" button is unavailable if the group with the name of more than 60 characters is found 17608: Fixed invalid use of Forms validator. Validators updated to handle specific case anyway. 17610: Fixed ETHREEOH-3445 "Admin Console - Group Search sometimes never displays results list" - missed commit of non-default theme files 17612: Fixed ETHREEOH-3480 "Browse" button no longer works after Groups Admin console page is refreshed 17613: ETHREEOH-3450 Fixed illegal nested comment in web-client-config-custom.xml.sample 17616: Fix for ETHREEOH-2863 - Code cache memory leak observed in JVM 1.6 when script action calls another script which in turn calls other functions. - Fixed use of Rhino optimization level when executing string based scripts. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18160 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts.comment;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
import org.alfresco.repo.jscript.Scopeable;
|
||||
import org.alfresco.repo.jscript.ScriptNode;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
|
||||
/**
|
||||
* Temporary comment service API to start encapsulation of comment logic.
|
||||
*
|
||||
* NOTE: this has been added to resolve a specific issue and needs re-consideration
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class ScriptCommentService extends BaseScopableProcessorExtension
|
||||
{
|
||||
private static final String COMMENTS_TOPIC_NAME = "Comments";
|
||||
|
||||
private ServiceRegistry serviceRegistry;
|
||||
private NodeService nodeService;
|
||||
|
||||
public void setServiceRegistry(ServiceRegistry serviceRegistry)
|
||||
{
|
||||
this.serviceRegistry = serviceRegistry;
|
||||
this.nodeService = serviceRegistry.getNodeService();
|
||||
}
|
||||
|
||||
public ScriptNode createCommentsFolder(ScriptNode node)
|
||||
{
|
||||
final NodeRef nodeRef = node.getNodeRef();
|
||||
|
||||
NodeRef commentsFolder = AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<NodeRef>()
|
||||
{
|
||||
public NodeRef doWork() throws Exception
|
||||
{
|
||||
NodeRef commentsFolder = null;
|
||||
nodeService.addAspect(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussable"), null);
|
||||
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussion"), RegexQNamePattern.MATCH_ALL);
|
||||
if (assocs.size() != 0)
|
||||
{
|
||||
NodeRef forumFolder = assocs.get(0).getChildRef();
|
||||
|
||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
|
||||
props.put(ContentModel.PROP_NAME, COMMENTS_TOPIC_NAME);
|
||||
commentsFolder = nodeService.createNode(
|
||||
forumFolder,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, COMMENTS_TOPIC_NAME),
|
||||
QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "topic"),
|
||||
props).getChildRef();
|
||||
}
|
||||
return commentsFolder;
|
||||
}
|
||||
|
||||
}, AuthenticationUtil.getAdminUserName());
|
||||
|
||||
return new ScriptNode(commentsFolder, serviceRegistry, getScope());
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user