Git Product home page Git Product logo

share-site-space-templates's Introduction

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".

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.

Alternatively, you can store your Share Site Space Templates in a Data Dictionary folder called Site Folder Templates, which is a folder this add-on will automatically add to your Data Dictionary. Storing your Share Site Space Templates in the Site Folder Templates folder will keep them separate from traditional Space Templates.

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

If you add rules to your Share Site Space Template, those rules will be copied to the new site's document library when the site is created.

Maven

Add the dependencies and overlays to the POM file of your WAR project.

For the repository tier, in a project created with the all-in-one archetype, edit repo/pom.xml:

<dependencies>
  ...
  <dependency>
      <groupId>com.metaversant</groupId>
      <artifactId>share-site-space-templates-repo</artifactId>
      <version>1.1.2</version>
      <type>amp</type>
  </dependency>
  ...
</dependencies>

<overlays>
  ...
  <overlay>
      <groupId>com.metaversant</groupId>
      <artifactId>share-site-space-templates-repo</artifactId>
      <type>amp</type>
  </overlay>
  ...
</overlays>

Manual Installation

Use mvn install to create the AMP.

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.

share-site-space-templates's People

Contributors

douglascrp avatar jpotts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

share-site-space-templates's Issues

Permissions on documentLibrary folder for Private and Moderated sites is incorrect

The add-on creates the documentLibrary folder for a site when the site is created but it does not check to see whether or not the site is Moderated or Private, so it does not set the permissions appropriately. Specifically, it leaves ACL inheritance turned on when it should be disabled for Moderated and Private sites.

Instead of creating the documentLibrary folder itself, the code should ask the Site Service to do it and the add-on shouldn't be concerned with such details.

Bootstrap causes exception on 5.1

The new folder bootstrap code causes an exception on 5.1 (201604GA):

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'share-site-space-templates-repo.folderBootstrap' defined in class path resource [alfresco/module/share-site-space-templates-repo/context/bootstrap-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'targetSchema' threw exception; nested exception is java.lang.IllegalArgumentException: 'targetSchema' must be greater than 'fixesToSchema'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1859)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

Question about query used for template

Hi @jpotts:

First of all, thanks for the addon, it's a very nice and useful component.
I'm testing it with Alfresco 5.0.2.5 version. I have a question regarding the query used in the module.

I use several site dashboards defined in presets.xml. In particular, I defined two site / presets / space templates:

  • Collaboration Site --> "site-dashboard"
  • ZK Site --> "zk-site-dashboard"

creating the corresponding folder structure in Space Templates.

I found some strange behaviour regarding the query for copying the template.
Sometimes I found that "zk-site-dashboard" is ** always ** found as the space template (for both site types) - so I found problems when creating "Collaboration Sites".

Maybe this is related with the query:

String query = "+PATH:"/app:company_home/app:dictionary/app:space_templates/*" +@cm:name:"" + sitePreset + """;

Some notes:

  • If I search "site-dashboard" (or @cm:name:"site-dashboard") in Alfresco search, I found two hits in the resultset (maybe is it appropiate to use = operator for getting an exact term?).
  • There is no problem with ZK Site (zk-site-dashboard) creation in any case.
  • In the case of Collaboration Site creation it seems to get the first hit of the resultset, and I think that the query is using some relevance criteria (so the result can change).
  • Finally, I found that if I delete site-dashboard space template and I create a "Collaboration Site" it uses zk-site-dashboard template directly.

I understand too, that a walkaround is just to rename the custom presets like "template-site-zk", avoiding collisions, between site name presets.

Could you confirm this behaviour ?

Best regards and thanks in advance.

--C.

Suggestion

Hey @jpotts

I'm trying your addon, and it works really well.
Thank you for sharing it.

But I'd like to suggest something, which is to use, by default, another folder instead of the ootb Space Templates.
Why? Because for users that actually use the Space Templates folders for other use cases, like project's templates, it is weird to see a template named site-dashboard. It makes no sense.

I thought about creating a new folder, maybe Site Templates or something like that, and use that one.

Let me know what you think.

Snipplet to configure Create Site Form

Hi Jeff,

How are you going?

First of all thank you (once more) for this great extension for Alfresco. I used it previously since in Alfresco 4.x and early 5.x in some projects.

Just a question about the addon, I recovered it now for a project in Alfresco 6.2.2 and I wonder how can be customized Edit Site form, for adding new custom sites types.
I remember that some time ago, it needed some extra presets.xml and create-site.js webscript configuration, but I think it is not the case since Aikau forms maybe (not sure).

Surely, this AMP is not including it as a repo addon.

Do you have an extension or an example for customizing this form ?

Kind regards and thanks in advance.
--C.

Rules don't get copied to new documentLibrary folder

In previous versions the site folder template was copied to create the document library, which meant that all of the rules were intact. The change in 1.1.1 that uses the site service to create the document library meant that if there were rules created on the site folder template the new document library would no longer get those rules when the site was created.

The code should check to see if there are rules on the source site folder template, and if there are, copy the rules folder to the new document library folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.