Skip to content

Commit 83ca66c

Browse files
committed
Initial import of javascript-console-dist project.
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Javascript Console@1121 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent 130e845 commit 83ca66c

File tree

4 files changed

+172
-0
lines changed

4 files changed

+172
-0
lines changed

javascript-console-dist/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>javascript-console-dist</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

javascript-console-dist/build.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<project basedir="." default="dist" name="Javascript Console Distribution">
2+
3+
<property name="jsconsole-version" value="0.5"/>
4+
5+
<!-- Clean out the build and distribution directories -->
6+
<target name="clean" description="Clean out all build directories">
7+
<delete dir="dist" />
8+
<delete dir="tmp" />
9+
</target>
10+
11+
<!-- Create required prerequisite directory structure -->
12+
<target name="prepare" description="Create initial build structures">
13+
<mkdir dir="dist" />
14+
<mkdir dir="dist/3.4.x" />
15+
<mkdir dir="dist/4.0.x" />
16+
</target>
17+
18+
<target name="dist" depends="clean, prepare">
19+
<ant antfile="../javascript-console-repo/project.xml" target="dist-jar" useNativeBasedir="true"/>
20+
<ant antfile="../javascript-console-share/project.xml" target="dist-jar" useNativeBasedir="true"/>
21+
22+
<copy todir="dist/4.0.x">
23+
<fileset dir="../javascript-console-repo/build/dist">
24+
<include name="*.jar"/>
25+
</fileset>
26+
<fileset dir="../javascript-console-share/build/dist">
27+
<include name="*.jar"/>
28+
</fileset>
29+
</copy>
30+
31+
<ant antfile="../javascript-console-repo/project.xml" target="dist-amp" useNativeBasedir="true"/>
32+
<ant antfile="../javascript-console-share/project.xml" target="dist-amp" useNativeBasedir="true"/>
33+
34+
<copy todir="dist/4.0.x">
35+
<fileset dir="../javascript-console-repo/build/dist">
36+
<include name="*.amp"/>
37+
</fileset>
38+
<fileset dir="../javascript-console-share/build/dist">
39+
<include name="*.amp"/>
40+
</fileset>
41+
</copy>
42+
43+
44+
<copy todir="dist/3.4.x">
45+
<fileset dir="dist/4.0.x">
46+
<include name="javascript-console-repo*.jar"/>
47+
</fileset>
48+
</copy>
49+
50+
<!-- create patched javascript-console-share-0.5.jar to work with 3.4 -->
51+
<delete dir="tmp" />
52+
<mkdir dir="tmp"/>
53+
<unzip dest="tmp" src="dist/4.0.x/javascript-console-share-${jsconsole-version}.jar"/>
54+
55+
<!-- delete the share config which adds 4.0 action configuration -->
56+
<delete file="tmp/META-INF/share-config-custom.xml"></delete>
57+
58+
<!-- Delete custom evaluator which uses 4.0 surf code -->
59+
<delete file="tmp/de/fme/jsconsole/IsAdminEvaluator.class"></delete>
60+
61+
<!-- overwrite the share config custom which does not load the evaluator -->
62+
<copy todir="tmp" overwrite="true">
63+
<fileset dir="patch-3.4"/>
64+
</copy>
65+
66+
<zip destfile="dist/3.4.x/javascript-console-share-${jsconsole-version}.jar">
67+
<fileset dir="tmp"/>
68+
</zip>
69+
70+
<copy todir="dist">
71+
<fileset dir="docs"/>
72+
</copy>
73+
74+
<zip destfile="dist/javascript-console-${jsconsole-version}.zip">
75+
<fileset dir="dist"/>
76+
</zip>
77+
78+
</target>
79+
80+
</project>
81+
82+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
Javascript Console Admin Console component for Alfresco 3.4/4.0
3+
===============================================================
4+
5+
Author: Florian Maul
6+
7+
This project defines a Javascript Console component for Share's Administration Console,
8+
that enables the execution of arbitrary javascript code in the repository.
9+
10+
11+
Installation
12+
------------
13+
14+
The component has been developed to install on top of an existing Alfresco
15+
3.4 or 4.0 installation. There are two different version in this archive with
16+
a specific folder for each of the Alfresco version.
17+
18+
When you have chosen the correct folder (3.4.x or 4.0.x) for your Alfresco version
19+
you'll find two jar files within that folder. The javascript-console-repo.jar needs
20+
to be copied into the Alfresco repository:
21+
22+
tomcat/webapps/alfresco/WEB-INF/lib/
23+
24+
The other file javascript-console-share.jar needs to be copied to the
25+
corresponding folder in the Share webapp:
26+
27+
tomcat/webapps/share/WEB-INF/lib/
28+
29+
The deployment location has changed recently (with Javascript Console 0.5)
30+
because the Javascript Console now uses Java classes that have to be deployed
31+
to these locations and can NOT reside in tomcat/shared/lib anymore.
32+
33+
34+
Building
35+
--------
36+
37+
To build the individual JAR files, run the following command from the base
38+
project directory.
39+
40+
ant -Dalfresco.sdk.dir=c:\dev\sdks\alfresco-enterprise-sdk-4.0.0 clean dist-jar
41+
42+
The command should build a JAR file named javascript-console-repo.jar or
43+
javascript-console-share.jar in the 'dist' directory within your project.
44+
45+
There also is the javascript-console-dist which builds both jar files and
46+
creates a patched version for Alfresco 3.4.x which does not support all the
47+
features of the version for 4.0.x
48+
49+
To deploy the extension files into a local Tomcat instance for testing, you can
50+
use the hotcopy-tomcat-jar task. You will need to set the tomcat.home
51+
property in Ant.
52+
53+
ant -Dtomcat.home=C:/Alfresco/tomcat clean hotcopy-tomcat-jar
54+
55+
Once you have run this you will need to restart Tomcat so that the classpath
56+
resources in the JAR file are picked up.
57+
58+
59+
Using the component
60+
-------------------
61+
62+
Log in to Alfresco Share as an admin user and navigate to the Administration
63+
page. Click 'Javascript Console' in the left hand side navigation.
64+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
3+
4+
<beans>
5+
6+
<!-- Add Admin Console messages -->
7+
<bean id="share-extras.javascript-console.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
8+
<property name="resourceBundles">
9+
<list>
10+
<value>alfresco.messages.javascript-console</value>
11+
</list>
12+
</property>
13+
</bean>
14+
15+
</beans>

0 commit comments

Comments
 (0)