RM: Fix up HEAD so RM module UI reliably works

* extended site service Java API so that the *type* of site can be optionally specified.  This must be a sub-type of st:site
  * extend site service JScript API to allow site type to be optionally specified
  * extend site service REST API to allow site type to optionally specified
  * add the site type rm:rmsite to the RM model
  * modify the RM web script to create the RM site with type rm:rmsite
  * added behaviour listening to the creation of rm:rmsite.  This creates the documentlibrary with the correct rm:fileplan type
  * tested

Note:  this is an issue that has been noted before (need to track down the JIRA), but became significantly worse with the move to HEAD.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28443 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2011-06-17 06:39:48 +00:00
parent 1c2b677a47
commit 82d89f89d4
4 changed files with 60 additions and 4 deletions

View File

@@ -117,6 +117,7 @@ public class SiteServiceImpl implements SiteServiceInternal, SiteModel
private static final String MSG_DO_NOT_CHANGE_MGR = "site_service.do_not_change_manager";
private static final String MSG_CAN_NOT_CHANGE_MSHIP="site_service.can_not_change_membership";
private static final String MSG_SITE_CONTAINER_NOT_FOLDER = "site_service.site_container_not_folder";
private static final String MSG_INVALID_SITE_TYPE = "site_service.invalid_site_type";
/* Services */
private NodeService nodeService;
@@ -356,6 +357,23 @@ public class SiteServiceImpl implements SiteServiceInternal, SiteModel
final String description,
final SiteVisibility visibility)
{
return createSite(sitePreset, passedShortName, title, description, visibility, SiteModel.TYPE_SITE);
}
public SiteInfo createSite(final String sitePreset,
String passedShortName,
final String title,
final String description,
final SiteVisibility visibility,
final QName siteType)
{
// Check that the provided site type is a subtype of TYPE_SITE
if (SiteModel.TYPE_SITE.equals(siteType) == false &&
dictionaryService.isSubClass(siteType, TYPE_SITE) == false)
{
throw new SiteServiceException(MSG_INVALID_SITE_TYPE, new Object[]{siteType});
}
// Remove spaces from shortName
final String shortName = passedShortName.replaceAll(" ", "");
@@ -388,9 +406,9 @@ public class SiteServiceImpl implements SiteServiceInternal, SiteModel
final NodeRef siteNodeRef = this.nodeService.createNode(
siteParent,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
shortName), SiteModel.TYPE_SITE, properties)
.getChildRef();
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, shortName),
siteType,
properties).getChildRef();
// Make the new site a tag scope
this.taggingService.addTagScope(siteNodeRef);