Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions packaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>@@@groupId@@@</groupId>
<artifactId>@@@artifactId@@@</artifactId>
<groupId>org.exoplatform.addons.training</groupId>
<artifactId>training-exercices-parent</artifactId>
<version>1.0.x-SNAPSHOT</version>
</parent>
<artifactId>@@@artifactId@@@-packaging</artifactId>
<artifactId>training-exercices-packaging</artifactId>
<packaging>pom</packaging>
<name>@@@name@@@ - Packaging</name>
<name>Training Exercises - Packaging</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>@@@artifactId@@@-war</artifactId>
<version>1.0.x-SNAPSHOT</version>
<artifactId>training-exercises-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>training-exercises-services</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>@@@artifactId@@@</finalName>
<finalName>training-exercises-packaging</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -32,7 +38,7 @@
<goal>single</goal>
</goals>
<configuration>
<finalName>@@@artifactId@@@</finalName>
<finalName>training-exercises-packaging</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assemblies/packaging.xml</descriptor>
Expand Down
8 changes: 4 additions & 4 deletions packaging/src/main/assemblies/packaging.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>@@@artifactId@@@-addon</id>
<id>training-exercises-addon</id>
<formats>
<format>zip</format>
</formats>
Expand All @@ -12,17 +12,17 @@
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory></outputDirectory>
<includes>
<include>${project.groupId}:@@@artifactId@@@-war:war</include>
<include>${project.groupId}:training-exercises-webapp:war</include>
</includes>
<scope>provided</scope>
<outputFileNameMapping>@@@artifactId@@@.war</outputFileNameMapping>
<outputFileNameMapping>training-exercises-webapp.war</outputFileNameMapping>
</dependencySet>
<!-- Libraries -->
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory></outputDirectory>
<includes>
<include>${project.groupId}:@@@artifactId@@@-*:jar</include>
<include>${project.groupId}:training-exercises-services:jar</include>
</includes>
<scope>provided</scope>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}
Expand Down
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,19 @@
<groupId>org.exoplatform.addons</groupId>
<version>6</version>
</parent>
<groupId>@@@groupId@@@</groupId>
<artifactId>@@@artifactId@@@</artifactId>
<groupId>org.exoplatform.addons.training</groupId>
<artifactId>training-exercices-parent</artifactId>
<version>1.0.x-SNAPSHOT</version>
<packaging>pom</packaging>
<name>@@@name@@@</name>
<description>@@@description@@@</description>
<name>Training addon - Parent</name>
<description>Parent for training addon</description>
<modules>
<module>services</module>
<module>war</module>
<module>packaging</module>
</modules>
<scm>
<connection>scm:git:git://github.com/exo-addons/@@@git_project@@@.git</connection>
<developerConnection>scm:git:git@github.com:exo-addons/@@@git_project@@@.git</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/exo-addons/@@@git_project@@@</url>
</scm>
<properties>
<platform.version>@@@platform_version@@@</platform.version>
<platform.version>5.0.1</platform.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -55,6 +50,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${platform.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
49 changes: 49 additions & 0 deletions services/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.exoplatform.addons.training</groupId>
<artifactId>training-exercices-parent</artifactId>
<version>1.0.x-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>training-exercises-services</artifactId>
<version>1.0.x-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>picocontainer</groupId>
<artifactId>picocontainer</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.container</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.commons</groupId>
<artifactId>commons-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.social</groupId>
<artifactId>social-component-core-jpa</artifactId>
<version>5.0.0-RC13</version>
</dependency>
<dependency>
<groupId>org.exoplatform.social</groupId>
<artifactId>social-component-core-jpa</artifactId>
<version>5.0.0-RC13</version>
</dependency>
</dependencies>
<name>Training Exercise - Services</name>
<build>
<finalName>training-exercises-services</finalName>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.exoplatform.addons.entity;

import javax.persistence.*;

import org.exoplatform.commons.api.persistence.ExoEntity;
import org.exoplatform.social.core.jpa.storage.entity.ActivityEntity;
import org.exoplatform.social.core.jpa.storage.entity.IdentityEntity;

import java.util.Calendar;

@Entity
@ExoEntity
@Table(name = "ADDON_FAVOURITE_ACTIVITY")
public class FavouriteActivity {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private Long id;
@ManyToOne
private IdentityEntity favouriteBy;
@ManyToOne
private ActivityEntity activity;

@Temporal(value = TemporalType.TIMESTAMP)
@Column(name = "FAVOURITE_DATE")
private Calendar favouriteDate;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public IdentityEntity getFavouriteBy() {
return favouriteBy;
}

public void setFavouriteBy(IdentityEntity favouriteBy) {
this.favouriteBy = favouriteBy;
}

public ActivityEntity getActivity() {
return activity;
}

public void setActivity(ActivityEntity activity) {
this.activity = activity;
}

public Calendar getFavouriteDate() {
return favouriteDate;
}

public void setFavouriteDate(Calendar favouriteDate) {
this.favouriteDate = favouriteDate;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.exoplatform.addons.services;

import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;

/**
* Created by eXo Platform SAS.
*
* @author Ali Hamdi <ahamdi@exoplatform.com>
* @since 13/09/18 15:12
*/

public class MyService {
/**
* The logger.
*/
private static final Log LOG = ExoLogger.getExoLogger(MyService.class);
private String message="alioua";
public MyService() {
}

public String getMessage() {


return message;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.exoplatform.addons.services;

import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.PortalContainer;
import org.picocontainer.Startable;
import org.exoplatform.services.log.*;

/**
* Created by eXo Platform SAS.
*
*/

public class MyStartableService implements Startable {
/**
* The logger.
*/
private static final Log LOG = ExoLogger.getExoLogger(MyStartableService.class);

public MyStartableService() {

}

@Override
public void start() {
LOG.info("&&&&&&&&&&&& My Startable service started !");

}

@Override
public void stop() {
LOG.info("&&&&&&&&&&&& My Startable service stopped !");
}
}
41 changes: 41 additions & 0 deletions services/src/main/resources/conf/configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2003-2014 eXo Platform SAS.

This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">

<external-component-plugins>
<target-component>org.exoplatform.commons.api.persistence.DataInitializer</target-component>
<component-plugin>
<name>SocialRDBMSChangeLogsPlugin</name>
<set-method>addChangeLogsPlugin</set-method>
<type>org.exoplatform.commons.persistence.impl.ChangeLogsPlugin</type>
<init-params>
<values-param>
<name>changelogs</name>
<description>Change logs of Social RDBMS</description>
<value>db/changelog/addon-training-rdbms.db.changelog-1.0.0.xml</value>
</values-param>
</init-params>
</component-plugin>
</external-component-plugins>
</configuration>
37 changes: 37 additions & 0 deletions services/src/main/resources/conf/portal/configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--

Copyright (C) 2009 eXo Platform SAS.

This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->

<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
<component>
<type>org.exoplatform.commons.persistence.impl.EntityManagerService</type>
</component>
<component>
<type>org.exoplatform.addons.services.MyService</type>
</component>
<component>
<type>org.exoplatform.addons.services.MyStartableService</type>
</component>
<component>
<type>org.exoplatform.addons.test.MyStartableServiceTest</type>
</component>
</configuration>
Loading