Skip to content

Commit

Permalink
Works now. Needs further testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jpotts committed Mar 20, 2014
1 parent fb32412 commit 4ecfbe3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@ share-site-space-templates
==========================

Adds the ability to create a default set of folders to an Alfresco Share site by leveraging Space Templates

For example, the out-of-the-box Share site "type" is shown in English as "Collaboration Site". Its preset ID is "site-dashboard".

So after installing this AMP in your Alfresco WAR, you can create a folder under Data Dictionary/Space Templates called "site-dashboard". Then anything you put in that folder will be copied into the document library of new "Collaboration Site" sites.

If you modify your site presets to add additional types of Share sites, you can create additional space templates for each type of site.

Installation
------------
Use `mvn install` to create the AMP. By default the POM is set to depend on the latest Alfresco Community Edition version which is 4.2.f.

You can then install the AMP as you normally would using the MMT.

Alternatively, you can use the Maven plug-in to install the AMP by running `mvn alfresco:install -Dmaven.alfresco.warLocation=$TOMCAT_HOME/webapps/alfresco` if you are running your Alfresco WAR expanded, or specify the WAR if you are running unexpanded.

No further config or setup is necessary.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ public void onCreateNode(ChildAssociationRef childAssocRef) {

//see if there is a folder in the Space Templates folder of the same name
String query = "+PATH:\"/app:company_home/app:dictionary/app:space_templates/*\" +@cm\\:name:\"" + sitePreset + "\"";
ResultSet rs = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, query);
ResultSet rs = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_LUCENE, query);

//if not, bail, there is nothing more to do
if (rs.length() <= 0) {
logger.debug("Found no space templates for: " + sitePreset);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,8 @@ public void testCreateWithoutSpaceTemplate() {
SiteInfo testSite = siteService.createSite("site-dashboard", siteShortName, "test site", "test site description", SiteVisibility.PUBLIC);

NodeRef documentLibrary = siteService.getContainer(testSite.getShortName(), SiteService.DOCUMENT_LIBRARY);

List<ChildAssociationRef> children = nodeService.getChildAssocs(documentLibrary);

assertEquals(0, children.size());

//debug
if (children.size() > 0) {
for (ChildAssociationRef child : children) {
logger.debug("Child:" + nodeService.getProperty(child.getChildRef(), ContentModel.PROP_NAME));
}
}

assertEquals(documentLibrary, null);

siteService.deleteSite(siteShortName);
}
Expand Down

0 comments on commit 4ecfbe3

Please sign in to comment.