|
| 1 | + |
| 2 | +Javascript Console Admin Console component for Alfresco 3.4/4.0 |
| 3 | +=============================================================== |
| 4 | + |
| 5 | +Author: Florian Maul (fme AG) |
| 6 | + |
| 7 | +This project contains a Javascript Console component for the Alfresco Share's |
| 8 | +Administration Console, that enables the execution of arbitrary javascript code |
| 9 | +in the repository. |
| 10 | + |
| 11 | + |
| 12 | +Installation |
| 13 | +------------ |
| 14 | + |
| 15 | +The component has been developed to install on top of an existing Alfresco |
| 16 | +3.4 or 4.0 installation. There are two different version in this archive within |
| 17 | +a specific folder for each of the Alfresco versions 3.4.x or 4.0.x. |
| 18 | + |
| 19 | +When you have chosen the correct folder (3.4.x or 4.0.x) for your Alfresco version |
| 20 | +you'll find two jar files within that folder. The javascript-console-repo.jar needs |
| 21 | +to be copied into the Alfresco repository: |
| 22 | + |
| 23 | + tomcat/webapps/alfresco/WEB-INF/lib/ |
| 24 | + |
| 25 | +The other file javascript-console-share.jar needs to be copied to the |
| 26 | +corresponding folder in the Share webapp: |
| 27 | + |
| 28 | + tomcat/webapps/share/WEB-INF/lib/ |
| 29 | + |
| 30 | +If you prefer the AMP deployment method you also find amp files in the respective |
| 31 | +folder that you can install with the apply_amps.sh or apply_amps.bat utilities. Be |
| 32 | +aware that you need to install both amps files: the repo-amp and the share-amp. |
| 33 | + |
| 34 | +The deployment location has changed recently (with Javascript Console 0.5) |
| 35 | +because the Javascript Console now uses Java classes that have to be deployed |
| 36 | +to these locations and can NOT reside in tomcat/shared/lib anymore. |
| 37 | + |
| 38 | + |
| 39 | +Building |
| 40 | +-------- |
| 41 | + |
| 42 | +To build the individual JAR files, run the following command from the base |
| 43 | +project directory. |
| 44 | + |
| 45 | + ant -Dalfresco.sdk.dir=c:\dev\sdks\alfresco-enterprise-sdk-4.0.0 clean dist-jar |
| 46 | + |
| 47 | +The command should build a JAR file named javascript-console-repo.jar or |
| 48 | +javascript-console-share.jar in the 'dist' directory within your project. |
| 49 | + |
| 50 | +There also is the javascript-console-dist project which builds both jar files |
| 51 | +and creates a patched version for Alfresco 3.4.x which does not support all the |
| 52 | +features of the version for 4.0.x. This project creates the AMP files as well. |
| 53 | + |
| 54 | +To deploy the extension files into a local Tomcat instance for testing, you can |
| 55 | +use the hotcopy-tomcat-jar task. You will need to set the tomcat.home |
| 56 | +property in Ant. |
| 57 | + |
| 58 | + ant -Dtomcat.home=C:/Alfresco/tomcat clean hotcopy-tomcat-jar |
| 59 | + |
| 60 | +Once you have run this you will need to restart Tomcat so that the classpath |
| 61 | +resources in the JAR file are picked up. |
| 62 | + |
| 63 | + |
| 64 | +Using the component |
| 65 | +------------------- |
| 66 | + |
| 67 | +- Log in to Alfresco Share and navigate to an Administration page such as Users |
| 68 | + or Groups |
| 69 | +- In the left-hand-side navigation, click *Javascript Console* |
| 70 | +- Enter Alfresco repository javascript code in the textarea at the top. Press |
| 71 | + the execute button to run the script. |
| 72 | +- You can use the special print(..) javascript command to output messages to |
| 73 | + the output window. |
| 74 | +- use Ctrl+Space for code completion. Note that only global objects and specific |
| 75 | + variables (document, space, variables ending in ...node) are completed. |
| 76 | + |
| 77 | +For more information on using the tool visit the wiki page: |
| 78 | + |
| 79 | +http://code.google.com/p/share-extras/wiki/JavascriptConsole |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
0 commit comments