Alfresco repository module with helpful javascript root object extensions which are helpful in much scenarios
Java FreeMarker Other
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
LICENSE
MAINTAINERS.txt
README.md
debug.sh
deploy.sh
pom.xml
run-test.sh
run.bat
run.sh

README.md

alfresco-jscript-extensions

Alfresco 5.1 (Master) Build Status

Alfresco 5.0.d (Build-4.2) Build Status

Alfresco repository module with helpful javascript root object extensions which are helpful in much scenarios.

Usage for Alfresco 4.2 - Alfresco 5.0.d

Add the dependencies to the Alfresco repository and share POM files of your WAR projects.

Alfresco SDK 2.x

<dependencies>
  ...
  <dependency>
    <groupId>de.jgoldhammer</groupId>
    <artifactId>alfresco-jscript-extension</artifactId>
    <version>1.3.1</version>
    <type>amp</type>
  </dependency>
  ...
</dependencies>

<overlays>
  ...
  <overlay>
    <groupId>de.jgoldhammer</groupId>
    <artifactId>alfresco-jscript-extension</artifactId>
    <version>1.3.1</version>
    <type>amp</type>
  </overlay>
  ...
</overlays>

Alfresco SDK 3.x

<platformModules>
	<moduleDependency>
		<groupId>de.jgoldhammer</groupId>
        	<artifactId>alfresco-jscript-extension</artifactId>
        	<version>1.3.1</version>
        	<type>amp</type>
    	</moduleDependency>
</platformModules>

Usage since Alfresco 5.1.a

Add the dependencies to the Alfresco repository and share POM files of your WAR projects.

Alfresco SDK 2.x

<dependencies>
  ...
  <dependency>
    <groupId>de.jgoldhammer</groupId>
    <artifactId>alfresco-jscript-extension</artifactId>
    <version>1.3</version>
    <type>amp</type>
  </dependency>
  ...
</dependencies>

<overlays>
  ...
  <overlay>
    <groupId>de.jgoldhammer</groupId>
    <artifactId>alfresco-jscript-extension</artifactId>
    <version>1.3</version>
    <type>amp</type>
  </overlay>
  ...
</overlays>

Alfresco SDK 3.x

<platformModules>
	<moduleDependency>
		<groupId>de.jgoldhammer</groupId>
        	<artifactId>alfresco-jscript-extension</artifactId>
        	<version>1.3</version>
        	<type>amp</type>
    	</moduleDependency>
</platformModules>

Following root objects are provided:

  • auth

    • to change the authentication to another user during the javascript execution
    • to get the current executing authenticated user
    • example: tbd
  • batch

  • database

  • downloads

  • favorites

  • fileWriter

  • policies

    • to temporarly disable or enable policy behavours during javascript extecution
    • policy behaviours can be enabled or disabled on a specific node or a certain aspect/type
    • example: https://gist.github.com/jgoldhammer/6941414
  • jobs

  • permissions

  • repoAdmin

    • uses the repo admin interpreter from the repo admin console
    • write your commands and get back the result in the js-console
    • example 1: print(repoAdmin.exec('help')) - show the help
    • example 2: print(reopAdmin.exec('show models')); - show all additional datamodels
  • tenantAdmin

    • uses the repo admin interpreter from the repo admin console
    • write your commands and get back the result in the js-console
    • example 1: print(tenantAdmin.exec('help')) - show the help
    • example 2: print(tenantAdmin.exec('show tenants')); - show all tenants (if you create one before!)
  • trans

    • create a new transaction
    • start, commit and rollback (database) transactions during the javascript execution
    • example: tbd
  • workflowAdmin

    • uses the workflowinterpreter from the workflow console
    • write your commands and get back the result in the js-console
    • example 1: print(workflowAdmin.exec('help')) - show the help
    • example 2: print(workflowAdmin.exec('show definitions')); - show all workflow definitions

Building

To build the module and its AMP / JAR files, run the following command from the base project directory:

mvn install