Commit 8f063e4c050179033dd398a0ced5e1a4278754a0

Authored by Jelena Cule
1 parent 929e65e01c
Exists in master

Alfresco SDK projects

Showing 60 changed files with 3211 additions and 0 deletions   Show diff stats
skype-integration/pom.xml
... ... @@ -0,0 +1,97 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3 + <modelVersion>4.0.0</modelVersion>
  4 + <groupId>org.alfresco.skype</groupId>
  5 + <artifactId>skype-integration</artifactId>
  6 + <version>1.0-SNAPSHOT</version>
  7 + <name>Alfresco Repository and Share Quickstart with database and an embedded Tomcat runner.</name>
  8 + <description>This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr4, AMPs) in one project
  9 + </description>
  10 + <packaging>pom</packaging>
  11 +
  12 + <parent>
  13 + <groupId>org.alfresco.maven</groupId>
  14 + <artifactId>alfresco-sdk-parent</artifactId>
  15 + <version>2.1.1</version>
  16 + </parent>
  17 +
  18 + <!--
  19 + SDK properties have sensible defaults in the SDK parent,
  20 + but you can override the properties below to use another version.
  21 + For more available properties see the alfresco-sdk-parent POM.
  22 + -->
  23 + <properties>
  24 + <!-- The following are default values for data location, Alfresco Community version, and Records Management Module version.
  25 + Uncomment if you need to change (Note. current default version for Enterprise edition is 5.0.1)
  26 + <alfresco.version>5.0.d</alfresco.version>
  27 + <alfresco.rm.version>2.3</alfresco.rm.version>
  28 + <alfresco.data.location>/absolute/path/to/alf_data_dev</alfresco.data.location> -->
  29 +
  30 + <!-- This control the root logging level for all apps uncomment and change, defaults to WARN
  31 + <app.log.root.level>WARN</app.log.root.level>
  32 + -->
  33 +
  34 + <!-- Set the enviroment to use, this controls which properties will be picked in src/test/properties
  35 + for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
  36 + <env>local</env>
  37 + -->
  38 +
  39 + <!-- The Alfresco Share web application is accessible via this URL -->
  40 + <share.client.url>http://localhost:8080/share</share.client.url>
  41 + </properties>
  42 +
  43 + <!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) -->
  44 + <dependencyManagement>
  45 + <dependencies>
  46 + <!-- This will import the dependencyManagement for all artifacts in the selected Alfresco plaftorm
  47 + (see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies)
  48 + NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement.
  49 + NOTE: It defaults to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom
  50 + -->
  51 + <dependency>
  52 + <groupId>${alfresco.groupId}</groupId>
  53 + <artifactId>alfresco-platform-distribution</artifactId>
  54 + <version>${alfresco.version}</version>
  55 + <type>pom</type>
  56 + <scope>import</scope>
  57 + </dependency>
  58 + </dependencies>
  59 + </dependencyManagement>
  60 +
  61 + <build>
  62 + <plugins>
  63 + <!-- Compress JavaScript files and store as *-min.js -->
  64 + <plugin>
  65 + <groupId>net.alchim31.maven</groupId>
  66 + <artifactId>yuicompressor-maven-plugin</artifactId>
  67 + </plugin>
  68 + <plugin>
  69 + <groupId>org.alfresco.maven.plugin</groupId>
  70 + <artifactId>alfresco-maven-plugin</artifactId>
  71 + </plugin>
  72 + </plugins>
  73 + </build>
  74 +
  75 + <profiles>
  76 + <profile>
  77 + <!-- Invoke your build with -Prun to run the multimodule project and enable rapid dev mode in your IDE.
  78 + See 'run' profile in the sub modules pom.xml for further behavioral details.
  79 + -->
  80 + <id>run</id>
  81 + <properties>
  82 + <!-- While running in rapid dev mode with -Prun, we don't want amp web resources
  83 + to be added to the war, so we can load them directly from the AMP project (see
  84 + runner/tomcat/context-*.xml for more details) -->
  85 + <maven.alfresco.includeWebResources>false</maven.alfresco.includeWebResources>
  86 + </properties>
  87 + </profile>
  88 + </profiles>
  89 + <modules>
  90 + <module>repo-amp</module>
  91 + <module>share-amp</module>
  92 + <module>repo</module>
  93 + <module>solr-config</module>
  94 + <module>share</module>
  95 + <module>runner</module>
  96 + </modules>
  97 +</project>
0 98 \ No newline at end of file
... ...
skype-integration/repo-amp/pom.xml
... ... @@ -0,0 +1,64 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3 + <modelVersion>4.0.0</modelVersion>
  4 + <artifactId>repo-amp</artifactId>
  5 + <name>Alfresco Repository AMP Module</name>
  6 + <packaging>amp</packaging>
  7 + <description>This is a sample Alfresco repository AMP project, depended upon by the alfresco WAR aggregator</description>
  8 +
  9 + <parent>
  10 + <groupId>org.alfresco.skype</groupId>
  11 + <artifactId>skype-integration</artifactId>
  12 + <version>1.0-SNAPSHOT</version>
  13 + </parent>
  14 +
  15 + <properties>
  16 + <!-- Property overrides are mostly done in parent pom -->
  17 + </properties>
  18 +
  19 + <!-- Following dependencies are needed for compiling Java code in src/main/java;
  20 + <scope>provided</scope> is inherited for each of the following;
  21 + for more info, please refer to alfresco-platform-distribution POM -->
  22 + <dependencies>
  23 + <dependency>
  24 + <groupId>${alfresco.groupId}</groupId>
  25 + <artifactId>alfresco-repository</artifactId>
  26 + </dependency>
  27 +
  28 + <!-- Uncomment if you are using RM (Records Management) module, brings in RM related classes -->
  29 + <!--
  30 + <dependency>
  31 + <groupId>${alfresco.groupId}</groupId>
  32 + <artifactId>alfresco-rm</artifactId>
  33 + <version>${alfresco.rm.version}</version>
  34 + <classifier>classes</classifier>
  35 + </dependency>
  36 + -->
  37 + </dependencies>
  38 +
  39 + <profiles>
  40 +
  41 + <!--
  42 + Brings in the extra Enterprise specific repository classes,
  43 + if the 'enterprise' profile has been activated, needs to be activated manually. -->
  44 + <profile>
  45 + <id>enterprise</id>
  46 + <dependencies>
  47 + <dependency>
  48 + <groupId>${alfresco.groupId}</groupId>
  49 + <artifactId>alfresco-enterprise-repository</artifactId>
  50 + <version>${alfresco.version}</version>
  51 + <scope>provided</scope>
  52 + </dependency>
  53 + </dependencies>
  54 + </profile>
  55 +
  56 + <!-- If we are running in embedded Tomcat skip unit tests -->
  57 + <profile>
  58 + <id>run</id>
  59 + <properties>
  60 + <skipTests>true</skipTests>
  61 + </properties>
  62 + </profile>
  63 + </profiles>
  64 +</project>
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/helloworld.get.desc.xml
... ... @@ -0,0 +1,7 @@
  1 +<webscript>
  2 + <shortname>Hello World Sample Webscript</shortname>
  3 + <description>Hands back a greeting</description>
  4 + <url>/sample/helloworld</url>
  5 + <authentication>user</authentication>
  6 + <format default="html"></format>
  7 +</webscript>
0 8 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/helloworld.get.html.ftl
... ... @@ -0,0 +1 @@
  1 +Message: ${fromJS} ${fromJava}
0 2 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/helloworld.get.js
... ... @@ -0,0 +1 @@
  1 +model["fromJS"] = "Hello World from JS!";
0 2 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/alfresco-global.properties
... ... @@ -0,0 +1,5 @@
  1 +## This Alfresco Repo Configuration file should be used for custom properties that are introduced by this module.
  2 +## Define default values for all properties here.
  3 +## System Administrators can override these values in environment specific configurations in
  4 +## alfresco/tomcat/shared/classes/alfresco-global.properties.
  5 +##
0 6 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/bootstrap-context.xml
... ... @@ -0,0 +1,24 @@
  1 +<?xml version='1.0' encoding='UTF-8'?>
  2 +<beans xmlns="http://www.springframework.org/schema/beans"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://www.springframework.org/schema/beans
  5 + http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
  6 +
  7 + <!-- The bootstrap-context.xml file is used for patch definitions, importers,
  8 + workflow, and loading custom content models. -->
  9 +
  10 +
  11 + <!-- Registration of new models -->
  12 + <bean id="org.alfresco.skype.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
  13 + <property name="models">
  14 + <list>
  15 + <value>alfresco/module/${project.artifactId}/model/content-model.xml</value>
  16 + <value>alfresco/module/${project.artifactId}/model/workflow-model.xml</value>
  17 +
  18 + </list>
  19 + </property>
  20 + </bean>
  21 +
  22 +
  23 +
  24 +</beans>
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/service-context.xml
... ... @@ -0,0 +1,39 @@
  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 + Licensed to the Apache Software Foundation (ASF) under one or more
  5 + contributor license agreements. See the NOTICE file distributed with
  6 + this work for additional information regarding copyright ownership.
  7 + The ASF licenses this file to You under the Apache License, Version 2.0
  8 + (the "License"); you may not use this file except in compliance with
  9 + the License. You may obtain a copy of the License at
  10 +
  11 + http://www.apache.org/licenses/LICENSE-2.0
  12 +
  13 + Unless required by applicable law or agreed to in writing, software
  14 + distributed under the License is distributed on an "AS IS" BASIS,
  15 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 + See the License for the specific language governing permissions and
  17 + limitations under the License.
  18 +-->
  19 +<beans>
  20 +
  21 + <!-- A simple class that is initialized by Spring -->
  22 + <bean id="org.alfresco.skype.exampleBean" class="org.alfresco.skype.demoamp.Demo" init-method="init" />
  23 +
  24 + <!-- A simple module component that will be executed once.
  25 + Note. this module component will only be executed once, and then there will be an entry for it in the Repo.
  26 + So doing for example $ mvn clean install -Prun twice will only execute this component the first time.
  27 + You need to remove /alf_data_dev for it to be executed again. -->
  28 + <bean id="org.alfresco.skype.exampleComponent" class="org.alfresco.skype.demoamp.DemoComponent" parent="module.baseComponent" >
  29 + <property name="moduleId" value="repo-amp" /> <!-- See module.properties -->
  30 + <property name="name" value="exampleComponent" />
  31 + <property name="description" value="A demonstration component" />
  32 + <property name="sinceVersion" value="1.0" />
  33 + <property name="appliesFromVersion" value="1.0" />
  34 + <property name="nodeService" ref="NodeService" />
  35 + <property name="nodeLocatorService" ref="nodeLocatorService" />
  36 + </bean>
  37 +
  38 +
  39 +</beans>
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/context/webscript-context.xml
... ... @@ -0,0 +1,24 @@
  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 + Licensed to the Apache Software Foundation (ASF) under one or more
  5 + contributor license agreements. See the NOTICE file distributed with
  6 + this work for additional information regarding copyright ownership.
  7 + The ASF licenses this file to You under the Apache License, Version 2.0
  8 + (the "License"); you may not use this file except in compliance with
  9 + the License. You may obtain a copy of the License at
  10 +
  11 + http://www.apache.org/licenses/LICENSE-2.0
  12 +
  13 + Unless required by applicable law or agreed to in writing, software
  14 + distributed under the License is distributed on an "AS IS" BASIS,
  15 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 + See the License for the specific language governing permissions and
  17 + limitations under the License.
  18 +-->
  19 +<beans>
  20 + <bean id="webscript.helloworld.get"
  21 + class="org.alfresco.skype.demoamp.HelloWorldWebScript"
  22 + parent="webscript">
  23 + </bean>
  24 +</beans>
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/content-model.xml
... ... @@ -0,0 +1,27 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<model name="myc:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
  3 +
  4 + <!-- Optional meta-data about the model -->
  5 + <description>Document Model for Repo Extension X</description>
  6 + <author>My Name</author>
  7 + <version>1.0</version>
  8 +
  9 + <imports>
  10 + <!-- Import Alfresco Dictionary Definitions -->
  11 + <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
  12 + <!-- Import Alfresco Content Domain Model Definitions -->
  13 + <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
  14 + <!-- Import Alfresco System Model Definitions -->
  15 + <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
  16 + </imports>
  17 +
  18 + <!-- Custom namespace for your domain -->
  19 + <namespaces>
  20 + <namespace uri="http://www.mycompany.com/model/content/1.0" prefix="myc"/>
  21 + </namespaces>
  22 +
  23 + <!-- ===============================================================================================================
  24 + Constraints, Types, and Aspects go here...
  25 + -->
  26 +
  27 +</model>
0 28 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/model/workflow-model.xml
... ... @@ -0,0 +1,26 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<model name="myw:workflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
  3 + <!-- Optional meta-data about the model -->
  4 + <description>Workflow Model for Repo Extension X</description>
  5 + <author>My Name</author>
  6 + <version>1.0</version>
  7 +
  8 + <imports>
  9 + <!-- Import Alfresco Dictionary Definitions -->
  10 + <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
  11 + <!-- Import Alfresco Content Domain Model Definitions -->
  12 + <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
  13 + <!-- Import Alfresco Workflow Model Definitions -->
  14 + <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
  15 + </imports>
  16 +
  17 + <!-- Custom namespace for your domain -->
  18 + <namespaces>
  19 + <namespace uri="http://www.mycompany.com/model/workflow/1.0" prefix="myw"/>
  20 + </namespaces>
  21 +
  22 + <!-- ===============================================================================================================
  23 + Constraints, Types, and Aspects go here...
  24 + -->
  25 +</model>
  26 +
... ...
skype-integration/repo-amp/src/main/amp/config/alfresco/module/repo-amp/module-context.xml
... ... @@ -0,0 +1,28 @@
  1 +<?xml version='1.0' encoding='UTF-8'?>
  2 +<!--
  3 + Licensed to the Apache Software Foundation (ASF) under one or more
  4 + contributor license agreements. See the NOTICE file distributed with
  5 + this work for additional information regarding copyright ownership.
  6 + The ASF licenses this file to You under the Apache License, Version 2.0
  7 + (the "License"); you may not use this file except in compliance with
  8 + the License. You may obtain a copy of the License at
  9 +
  10 + http://www.apache.org/licenses/LICENSE-2.0
  11 +
  12 + Unless required by applicable law or agreed to in writing, software
  13 + distributed under the License is distributed on an "AS IS" BASIS,
  14 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 + See the License for the specific language governing permissions and
  16 + limitations under the License.
  17 +
  18 +-->
  19 +<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
  20 +
  21 +<beans>
  22 +
  23 + <!-- This is filtered by Maven at build time, so that module name is single sourced. -->
  24 + <import resource="classpath:alfresco/module/${project.artifactId}/context/service-context.xml" />
  25 + <import resource="classpath:alfresco/module/${project.artifactId}/context/bootstrap-context.xml" />
  26 + <import resource="classpath:alfresco/module/${project.artifactId}/context/webscript-context.xml" />
  27 +
  28 +</beans>
... ...
skype-integration/repo-amp/src/main/amp/module.properties
... ... @@ -0,0 +1,47 @@
  1 +# Licensed to the Apache Software Foundation (ASF) under one or more
  2 +# contributor license agreements. See the NOTICE file distributed with
  3 +# this work for additional information regarding copyright ownership.
  4 +# The ASF licenses this file to You under the Apache License, Version 2.0
  5 +# (the "License"); you may not use this file except in compliance with
  6 +# the License. You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +
  16 +
  17 +
  18 +# SDK Sample module
  19 +
  20 +# ==== Beginning of Alfresco required/optional properties ====== #
  21 +
  22 +module.id=${project.artifactId}
  23 +#module.aliases=myModule-123, my-module
  24 +module.title=${project.name}
  25 +module.description=${project.description}
  26 +module.version=${noSnapshotVersion}
  27 +
  28 +# The following optional properties can be used to prevent the module from being added
  29 +# to inappropriate versions of the WAR file.
  30 +# module.repo.version.min=2.0
  31 +# module.repo.version.max=2.1
  32 +
  33 +# FIXME: This dependencies should come out of mvn dependencies on amp
  34 +
  35 +# The following describe dependencies on other modules
  36 +# Depends on net.sf.myproject.module.SupportModuleA version ${version} or later
  37 +# module.depends.net.sf.myproject.module.SupportModuleA=${version}-*
  38 +# Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0
  39 +# module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0
  40 +# Depends on net.sf.myproject.module.SupportModuleC - any version
  41 +# module.depends.net.sf.myproject.module.SupportModuleB=*
  42 +
  43 +
  44 +# ==== End of Alfresco required/optional properties ======= #
  45 +
  46 +
  47 +# ==== Beginning of module required properties/optional ====== #
0 48 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/web/css/demoamp.css
... ... @@ -0,0 +1,16 @@
  1 +/*
  2 + Licensed to the Apache Software Foundation (ASF) under one or more
  3 + contributor license agreements. See the NOTICE file distributed with
  4 + this work for additional information regarding copyright ownership.
  5 + The ASF licenses this file to You under the Apache License, Version 2.0
  6 + (the "License"); you may not use this file except in compliance with
  7 + the License. You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 + */
0 17 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/web/jsp/demoamp.jsp
... ... @@ -0,0 +1,17 @@
  1 +<!--
  2 + Licensed to the Apache Software Foundation (ASF) under one or more
  3 + contributor license agreements. See the NOTICE file distributed with
  4 + this work for additional information regarding copyright ownership.
  5 + The ASF licenses this file to You under the Apache License, Version 2.0
  6 + (the "License"); you may not use this file except in compliance with
  7 + the License. You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 + -->
  17 + Test jsp. Change me!
0 18 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/web/licenses/README-licenses.txt
... ... @@ -0,0 +1,2 @@
  1 +This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses
  2 +in the war build
0 3 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/amp/web/scripts/demoamp.js
... ... @@ -0,0 +1,16 @@
  1 +/*
  2 + Licensed to the Apache Software Foundation (ASF) under one or more
  3 + contributor license agreements. See the NOTICE file distributed with
  4 + this work for additional information regarding copyright ownership.
  5 + The ASF licenses this file to You under the Apache License, Version 2.0
  6 + (the "License"); you may not use this file except in compliance with
  7 + the License. You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 + */
0 17 \ No newline at end of file
... ...
skype-integration/repo-amp/src/main/java/org/alfresco/skype/demoamp/Demo.java
... ... @@ -0,0 +1,15 @@
  1 +package org.alfresco.skype.demoamp;
  2 +
  3 +/**
  4 + * This class does nothing except dump some output to <i>system.out</i>.
  5 + * This is a sample taken from Maven Alfresco SDK
  6 + *
  7 + * @author Derek Hulley
  8 + */
  9 +public class Demo
  10 +{
  11 + public void init()
  12 + {
  13 + System.out.println("SDK Demo AMP class has been loaded");
  14 + }
  15 +}
... ...
skype-integration/repo-amp/src/main/java/org/alfresco/skype/demoamp/DemoComponent.java
... ... @@ -0,0 +1,80 @@
  1 +/*
  2 +Licensed to the Apache Software Foundation (ASF) under one or more
  3 +contributor license agreements. See the NOTICE file distributed with
  4 +this work for additional information regarding copyright ownership.
  5 +The ASF licenses this file to You under the Apache License, Version 2.0
  6 +(the "License"); you may not use this file except in compliance with
  7 +the License. You may obtain a copy of the License at
  8 +
  9 +http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 +Unless required by applicable law or agreed to in writing, software
  12 +distributed under the License is distributed on an "AS IS" BASIS,
  13 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 +See the License for the specific language governing permissions and
  15 +limitations under the License.
  16 +*/
  17 +package org.alfresco.skype.demoamp;
  18 +
  19 +import org.alfresco.repo.module.AbstractModuleComponent;
  20 +import org.alfresco.repo.nodelocator.NodeLocatorService;
  21 +import org.alfresco.service.cmr.repository.NodeRef;
  22 +import org.alfresco.service.cmr.repository.NodeService;
  23 +import org.apache.commons.logging.Log;
  24 +import org.apache.commons.logging.LogFactory;
  25 +
  26 +/**
  27 + * A basic component that will be started for this module.
  28 + * Uses the NodeLocatorService to easily find nodes and the
  29 + * NodeService to display them
  30 + *
  31 + * @author Gabriele Columbro
  32 + * @author Maurizio Pillitu
  33 + */
  34 +public class DemoComponent extends AbstractModuleComponent {
  35 + Log log = LogFactory.getLog(DemoComponent.class);
  36 +
  37 + private NodeService nodeService;
  38 +
  39 + private NodeLocatorService nodeLocatorService;
  40 +
  41 + public void setNodeService(NodeService nodeService) {
  42 + this.nodeService = nodeService;
  43 + }
  44 +
  45 + public void setNodeLocatorService(NodeLocatorService nodeLocatorService) {
  46 + this.nodeLocatorService = nodeLocatorService;
  47 + }
  48 +
  49 + /**
  50 + * Bogus component execution
  51 + */
  52 + @Override
  53 + protected void executeInternal() throws Throwable {
  54 + System.out.println("DemoComponent has been executed");
  55 + log.debug("Test debug logging. Congratulation your AMP is working");
  56 + log.info("This is only for information purposed. Better remove me from the log in Production");
  57 + }
  58 +
  59 + /**
  60 + * This is a demo service interaction with Alfresco Foundation API.
  61 + * This sample method returns the number of child nodes of a certain type
  62 + * under a certain node.
  63 + *
  64 + * @return
  65 + */
  66 + public int childNodesCount(NodeRef nodeRef) {
  67 + return nodeService.countChildAssocs(nodeRef, true);
  68 + }
  69 +
  70 + /**
  71 + * Returns the NodeRef of "Company Home"
  72 + *
  73 + * @return
  74 + */
  75 + public NodeRef getCompanyHome()
  76 +
  77 + {
  78 + return nodeLocatorService.getNode("companyhome", null, null);
  79 + }
  80 +}
... ...
skype-integration/repo-amp/src/main/java/org/alfresco/skype/demoamp/HelloWorldWebScript.java
... ... @@ -0,0 +1,40 @@
  1 +/*
  2 +Licensed to the Apache Software Foundation (ASF) under one or more
  3 +contributor license agreements. See the NOTICE file distributed with
  4 +this work for additional information regarding copyright ownership.
  5 +The ASF licenses this file to You under the Apache License, Version 2.0
  6 +(the "License"); you may not use this file except in compliance with
  7 +the License. You may obtain a copy of the License at
  8 +
  9 +http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 +Unless required by applicable law or agreed to in writing, software
  12 +distributed under the License is distributed on an "AS IS" BASIS,
  13 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 +See the License for the specific language governing permissions and
  15 +limitations under the License.
  16 +*/
  17 +package org.alfresco.skype.demoamp;
  18 +
  19 +import org.springframework.extensions.webscripts.Cache;
  20 +import org.springframework.extensions.webscripts.DeclarativeWebScript;
  21 +import org.springframework.extensions.webscripts.Status;
  22 +import org.springframework.extensions.webscripts.WebScriptRequest;
  23 +
  24 +import java.util.HashMap;
  25 +import java.util.Map;
  26 +
  27 +/**
  28 + * A demonstration Java controller for the Hello World Web Script.
  29 + *
  30 + * @author martin.bergljung@alfresco.com
  31 + * @since 2.1.0
  32 + */
  33 +public class HelloWorldWebScript extends DeclarativeWebScript {
  34 + protected Map<String, Object> executeImpl(
  35 + WebScriptRequest req, Status status, Cache cache) {
  36 + Map<String, Object> model = new HashMap<String, Object>();
  37 + model.put("fromJava", "HelloFromJava");
  38 + return model;
  39 + }
  40 +}
0 41 \ No newline at end of file
... ...
skype-integration/repo-amp/src/test/java/org/alfresco/skype/demoamp/test/DemoComponentTest.java
... ... @@ -0,0 +1,83 @@
  1 +package org.alfresco.skype.demoamp.test;
  2 +
  3 +import static org.junit.Assert.assertEquals;
  4 +import static org.junit.Assert.assertNotNull;
  5 +
  6 +import org.alfresco.skype.demoamp.DemoComponent;
  7 +import org.alfresco.model.ContentModel;
  8 +import org.alfresco.repo.security.authentication.AuthenticationUtil;
  9 +import org.alfresco.service.cmr.repository.NodeRef;
  10 +import org.alfresco.service.cmr.repository.NodeService;
  11 +import org.apache.log4j.Logger;
  12 +import org.junit.Test;
  13 +import org.junit.runner.RunWith;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.beans.factory.annotation.Qualifier;
  16 +import org.springframework.test.context.ContextConfiguration;
  17 +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
  18 +
  19 +import com.tradeshift.test.remote.Remote;
  20 +import com.tradeshift.test.remote.RemoteTestRunner;
  21 +
  22 +/**
  23 + * A simple class demonstrating how to run out-of-container tests
  24 + * loading Alfresco application context.
  25 + *
  26 + * This class uses the RemoteTestRunner to try and connect to
  27 + * localhost:4578 and send the test name and method to be executed on
  28 + * a running Alfresco. One or more hostnames can be configured in the @Remote
  29 + * annotation.
  30 + *
  31 + * If there is no available remote server to run the test, it falls
  32 + * back on local running of JUnits.
  33 + *
  34 + * For proper functioning the test class file must match exactly
  35 + * the one deployed in the webapp (either via JRebel or static deployment)
  36 + * otherwise "incompatible magic value XXXXX" class error loading issues will arise.
  37 + *
  38 + * @author Gabriele Columbro
  39 + * @author Maurizio Pillitu
  40 + *
  41 + */
  42 +@RunWith(RemoteTestRunner.class)
  43 +@Remote(runnerClass=SpringJUnit4ClassRunner.class)
  44 +@ContextConfiguration("classpath:alfresco/application-context.xml")
  45 +public class DemoComponentTest {
  46 +
  47 + private static final String ADMIN_USER_NAME = "admin";
  48 +
  49 + static Logger log = Logger.getLogger(DemoComponentTest.class);
  50 +
  51 + @Autowired
  52 + protected DemoComponent demoComponent;
  53 +
  54 + @Autowired
  55 + @Qualifier("NodeService")
  56 + protected NodeService nodeService;
  57 +
  58 + @Test
  59 + public void testWiring() {
  60 + assertNotNull(demoComponent);
  61 + }
  62 +
  63 + @Test
  64 + public void testGetCompanyHome() {
  65 + AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER_NAME);
  66 + NodeRef companyHome = demoComponent.getCompanyHome();
  67 + assertNotNull(companyHome);
  68 + String companyHomeName = (String) nodeService.getProperty(companyHome, ContentModel.PROP_NAME);
  69 + assertNotNull(companyHomeName);
  70 + assertEquals("Company Home", companyHomeName);
  71 + }
  72 +
  73 + @Test
  74 + public void testChildNodesCount() {
  75 + AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER_NAME);
  76 + NodeRef companyHome = demoComponent.getCompanyHome();
  77 + int childNodeCount = demoComponent.childNodesCount(companyHome);
  78 + assertNotNull(childNodeCount);
  79 + // There are 7 folders by default under Company Home
  80 + assertEquals(7, childNodeCount);
  81 + }
  82 +
  83 +}
... ...
skype-integration/repo-amp/src/test/properties/local/alfresco-global.properties
... ... @@ -0,0 +1,46 @@
  1 +# Licensed to the Apache Software Foundation (ASF) under one or more
  2 +# contributor license agreements. See the NOTICE file distributed with
  3 +# this work for additional information regarding copyright ownership.
  4 +# The ASF licenses this file to You under the Apache License, Version 2.0
  5 +# (the "License"); you may not use this file except in compliance with
  6 +# the License. You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +
  16 +########################################################################################################################
  17 +# Alfresco configuration for running locally
  18 +#
  19 +# Configuration when running Tomcat embedded from Maven.
  20 +# This will create the alf_data_dev directory relative to Tomcat run folder.
  21 +# Property values from the POM but it can also be edited here.
  22 +########################################################################################################################
  23 +dir.root=${alfresco.data.location}
  24 +
  25 +# Use Solr4 as that is used by default with Alfresco 5
  26 +index.subsystem.name=solr4
  27 +solr.host=localhost
  28 +solr.port=8080
  29 +solr.secureComms=none
  30 +
  31 +# Fail or not when there are node integrity checker errors
  32 +integrity.failOnError=true
  33 +
  34 +# Database connection properties
  35 +db.driver=${alfresco.db.datasource.class}
  36 +db.url=${alfresco.db.url}
  37 +db.username=${alfresco.db.username}
  38 +db.password=${alfresco.db.password}
  39 +db.pool.initial=10
  40 +db.pool.max=100
  41 +hibernate.dialect=org.hibernate.dialect.H2Dialect
  42 +
  43 +# File servers related properties
  44 +# For local runs we disable CIFS and FTP
  45 +cifs.enabled=false
  46 +ftp.enabled=false
0 47 \ No newline at end of file
... ...
skype-integration/repo-amp/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml
... ... @@ -0,0 +1,53 @@
  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 + Licensed to the Apache Software Foundation (ASF) under one or more
  5 + contributor license agreements. See the NOTICE file distributed with
  6 + this work for additional information regarding copyright ownership.
  7 + The ASF licenses this file to You under the Apache License, Version 2.0
  8 + (the "License"); you may not use this file except in compliance with
  9 + the License. You may obtain a copy of the License at
  10 +
  11 + http://www.apache.org/licenses/LICENSE-2.0
  12 +
  13 + Unless required by applicable law or agreed to in writing, software
  14 + distributed under the License is distributed on an "AS IS" BASIS,
  15 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 + See the License for the specific language governing permissions and
  17 + limitations under the License.
  18 +-->
  19 +<beans>
  20 + <!-- This disables javascript compilation so that webscripts can be hot reloaded -->
  21 + <bean id="javaScriptProcessor" class="org.alfresco.repo.jscript.RhinoScriptProcessor" init-method="register">
  22 + <property name="name">
  23 + <value>javascript</value>
  24 + </property>
  25 + <property name="extension">
  26 + <value>js</value>
  27 + </property>
  28 + <!-- compile javascript and cache compiled scripts -->
  29 + <property name="compile">
  30 + <value>false</value>
  31 + </property>
  32 + <!-- allow sharing of sealed scopes for performance -->
  33 + <!-- disable to give each script it's own new scope which can be extended -->
  34 + <property name="shareSealedScopes">
  35 + <value>true</value>
  36 + </property>
  37 + <property name="scriptService">
  38 + <ref bean="scriptService"/>
  39 + </property>
  40 + <!-- Creates ScriptNodes which require the ServiceRegistry -->
  41 + <property name="serviceRegistry">
  42 + <ref bean="ServiceRegistry"/>
  43 + </property>
  44 + <property name="storeUrl">
  45 + <value>${spaces.store}</value>
  46 + </property>
  47 + <property name="storePath">
  48 + <value>${spaces.company_home.childname}</value>
  49 + </property>
  50 + </bean>
  51 +
  52 +
  53 +</beans>
... ...
skype-integration/repo-amp/src/test/resources/test-log4j.properties
... ... @@ -0,0 +1,23 @@
  1 +# Overrides only log4j locations and add the test logging properties
  2 +# This gets merged with the main file
  3 +
  4 +# Set root logger level to error
  5 +log4j.rootLogger=${app.log.root.level}, Console, File
  6 +
  7 +###### Console appender definition #######
  8 +
  9 +# All outputs currently set to be a ConsoleAppender.
  10 +log4j.appender.Console=org.apache.log4j.ConsoleAppender
  11 +log4j.appender.Console.layout=org.apache.log4j.PatternLayout
  12 +
  13 +# use log4j NDC to replace %x with tenant domain / username
  14 +log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n
  15 +#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
  16 +
  17 +###### File appender definition #######
  18 +log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
  19 +log4j.appender.File.File=${app.log.dir}alfresco.log
  20 +log4j.appender.File.Append=true
  21 +log4j.appender.File.DatePattern='.'yyyy-MM-dd
  22 +log4j.appender.File.layout=org.apache.log4j.PatternLayout
  23 +log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
0 24 \ No newline at end of file
... ...
skype-integration/repo/pom.xml
... ... @@ -0,0 +1,184 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
  3 + license agreements. See the NOTICE file distributed with this work for additional
  4 + information regarding copyright ownership. The ASF licenses this file to
  5 + You under the Apache License, Version 2.0 (the "License"); you may not use
  6 + this file except in compliance with the License. You may obtain a copy of
  7 + the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
  8 + by applicable law or agreed to in writing, software distributed under the
  9 + License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
  10 + OF ANY KIND, either express or implied. See the License for the specific
  11 + language governing permissions and limitations under the License. -->
  12 +
  13 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  14 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  15 + <modelVersion>4.0.0</modelVersion>
  16 + <artifactId>repo</artifactId>
  17 + <name>Alfresco Repository WAR Aggregator</name>
  18 + <packaging>war</packaging>
  19 + <description>Alfresco Repository aggregator, installs your repository AMPs in the Alfresco WAR for aggregation and easy deployment purposes</description>
  20 +
  21 + <parent>
  22 + <groupId>org.alfresco.skype</groupId>
  23 + <artifactId>skype-integration</artifactId>
  24 + <version>1.0-SNAPSHOT</version>
  25 + </parent>
  26 +
  27 + <properties>
  28 + <!-- During development we set log root level to Debug,
  29 + this will be applicable to the log configuration in
  30 + repo/src/main/resources/alfresco/extension/dev-log4j.properties,
  31 + such as DemoComponent logging. -->
  32 + <app.log.root.level>DEBUG</app.log.root.level>
  33 + </properties>
  34 +
  35 + <dependencies>
  36 + <dependency>
  37 + <groupId>${alfresco.groupId}</groupId>
  38 + <artifactId>${alfresco.repo.artifactId}</artifactId>
  39 + <version>${alfresco.version}</version>
  40 + <type>war</type>
  41 + </dependency>
  42 + <!-- Demonstrating the dependency / installation of the repo AMP developed in the 'repo-amp' module -->
  43 + <dependency>
  44 + <groupId>${project.groupId}</groupId>
  45 + <artifactId>repo-amp</artifactId>
  46 + <version>${project.version}</version>
  47 + <type>amp</type>
  48 + </dependency>
  49 + <!-- Uncomment if you are using SPP (SharePoint Protocol Support) for Online Edit etc -->
  50 + <!--
  51 + <dependency>
  52 + <groupId>${alfresco.groupId}</groupId>
  53 + <artifactId>alfresco-spp</artifactId>
  54 + <version>${alfresco.version}</version>
  55 + <type>amp</type>
  56 + </dependency>
  57 + -->
  58 + <!-- Uncomment if you are using the RM (Records Management) module. -->
  59 + <!--
  60 + <dependency>
  61 + <groupId>${alfresco.groupId}</groupId>
  62 + <artifactId>alfresco-rm</artifactId>
  63 + <version>${alfresco.rm.version}</version>
  64 + <type>amp</type>
  65 + </dependency>
  66 + -->
  67 + </dependencies>
  68 +
  69 + <build>
  70 + <plugins>
  71 + <plugin>
  72 + <artifactId>maven-war-plugin</artifactId>
  73 + <configuration>
  74 + <!-- Here is can control the order of overlay of your (WAR, AMP, etc.) dependencies
  75 + | NOTE: At least one WAR dependency must be uncompressed first
  76 + | NOTE: In order to have a dependency effectively added to the WAR you need to
  77 + | explicitly mention it in the overlay section.
  78 + | NOTE: First-win resource strategy is used by the WAR plugin
  79 + -->
  80 + <overlays>
  81 + <!-- Current project customizations. This is normally empty, since customizations come from the AMPs -->
  82 + <overlay/>
  83 + <!-- The Alfresco WAR -->
  84 + <overlay>
  85 + <groupId>${alfresco.groupId}</groupId>
  86 + <artifactId>${alfresco.repo.artifactId}</artifactId>
  87 + <type>war</type>
  88 + <!-- To allow inclusion of META-INF -->
  89 + <excludes/>
  90 + </overlay>
  91 + <!-- Add / sort your AMPs here -->
  92 + <overlay>
  93 + <groupId>${project.groupId}</groupId>
  94 + <artifactId>repo-amp</artifactId>
  95 + <type>amp</type>
  96 + </overlay>
  97 + <!-- Uncomment if you are using SPP -->
  98 + <!--
  99 + <overlay>
  100 + <groupId>${alfresco.groupId}</groupId>
  101 + <artifactId>alfresco-spp</artifactId>
  102 + <type>amp</type>
  103 + </overlay>
  104 + -->
  105 + <!-- Uncomment if you are using RM -->
  106 + <!--
  107 + <overlay>
  108 + <groupId>${alfresco.groupId}</groupId>
  109 + <artifactId>alfresco-rm</artifactId>
  110 + <type>amp</type>
  111 + </overlay>
  112 + -->
  113 + </overlays>
  114 + </configuration>
  115 + </plugin>
  116 + </plugins>
  117 + </build>
  118 +
  119 + <profiles>
  120 + <!-- Overrides the run profile to disable securecomms and add rapid development configuration -->
  121 + <profile>
  122 + <id>run</id>
  123 + <build>
  124 + <plugins>
  125 + <plugin>
  126 + <artifactId>maven-war-plugin</artifactId>
  127 + <executions>
  128 + <execution>
  129 + <id>prepare-exploded-war</id>
  130 + <goals>
  131 + <goal>exploded</goal>
  132 + </goals>
  133 + <phase>prepare-package</phase>
  134 + </execution>
  135 + <execution>
  136 + <id>default-war</id>
  137 + <configuration>
  138 + <webXml>${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/web.xml</webXml>
  139 + </configuration>
  140 + </execution>
  141 + </executions>
  142 + </plugin>
  143 + <!-- Replaces web.xml where applicable, commenting out the security-constraints -->
  144 + <plugin>
  145 + <groupId>com.google.code.maven-replacer-plugin</groupId>
  146 + <artifactId>replacer</artifactId>
  147 + <executions>
  148 + <execution>
  149 + <id>disable-securecomms</id>
  150 + <phase>prepare-package</phase>
  151 + <goals>
  152 + <goal>replace</goal>
  153 + </goals>
  154 + </execution>
  155 + </executions>
  156 + <configuration>
  157 + <ignoreErrors>true</ignoreErrors>
  158 + <file>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</file>
  159 + <outputDir>${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/</outputDir>
  160 + <preserveDir>false</preserveDir>
  161 + <replacements>
  162 + <replacement>
  163 + <token><![CDATA[<!-- Toggle securecomms placeholder start -->]]></token>
  164 + <value><![CDATA[<!--]]></value>
  165 + </replacement>
  166 + <replacement>
  167 + <token><![CDATA[<!-- Toggle securecomms placeholder end -->]]></token>
  168 + <value><![CDATA[-->]]></value>
  169 + </replacement>
  170 + </replacements>
  171 + </configuration>
  172 + </plugin>
  173 + </plugins>
  174 + </build>
  175 + <dependencies>
  176 + <dependency>
  177 + <groupId>org.alfresco.maven</groupId>
  178 + <artifactId>alfresco-rad</artifactId>
  179 + <version>${maven.alfresco.version}</version>
  180 + </dependency>
  181 + </dependencies>
  182 + </profile>
  183 + </profiles>
  184 +</project>
... ...
skype-integration/repo/src/main/properties/local/alfresco-global.properties
... ... @@ -0,0 +1,78 @@
  1 +# Licensed to the Apache Software Foundation (ASF) under one or more
  2 +# contributor license agreements. See the NOTICE file distributed with
  3 +# this work for additional information regarding copyright ownership.
  4 +# The ASF licenses this file to You under the Apache License, Version 2.0
  5 +# (the "License"); you may not use this file except in compliance with
  6 +# the License. You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13