First share. Alpha version
commit
c56caeef7d
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.liferay.ide.eclipse.server.tomcat.runtimeClasspathProvider/Liferay v6.2 (Tomcat 7)">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="jst.web"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
@ -0,0 +1 @@
|
||||
target
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>event-publisher-portal</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/webapp"/>
|
||||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
@ -0,0 +1,6 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,11 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
@ -0,0 +1,4 @@
|
||||
activeProfiles=gcube-developer
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="event-publisher-portal-hook">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<dependent-module archiveName="event-publisher-library-0.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/event-publisher-library/event-publisher-library">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="/event-publisher-portal/target/classes"/>
|
||||
<property name="context-root" value="event-publisher-portal"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<runtime name="Liferay v6.2 (Tomcat 7)"/>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="jst.web" version="2.4"/>
|
||||
<installed facet="liferay.hook" version="6.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
@ -0,0 +1 @@
|
||||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
@ -0,0 +1 @@
|
||||
Window
|
@ -0,0 +1,2 @@
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
@ -0,0 +1,47 @@
|
||||
# Event Publisher Portal
|
||||
|
||||
**Event Publisher Portal** is a [Liferay](https://liferay.com) 6.2 hook that provides the portal related implementation classes for event publishing and some interesting listeners that push events to a broker endpoint.
|
||||
|
||||
## Structure of the project
|
||||
|
||||
The source code is present in `src` folder.
|
||||
|
||||
## Built With
|
||||
|
||||
* [OpenJDK](https://openjdk.java.net/) - The JDK used
|
||||
* [Maven](https://maven.apache.org/) - Dependency Management
|
||||
|
||||
## Documentation
|
||||
|
||||
To build the hook WAR file it is sufficient to type
|
||||
|
||||
mvn clean package
|
||||
|
||||
## Change log
|
||||
|
||||
See [Releases](https://code-repo.d4science.org/gCubeSystem/authorization-client/releases).
|
||||
|
||||
## Authors
|
||||
|
||||
* **Mauro Mugnaini** ([Nubisware S.r.l.](http://www.nubisware.com)
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||
|
||||
|
||||
## About the gCube Framework
|
||||
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
|
||||
open-source software toolkit used for building and operating Hybrid Data
|
||||
Infrastructures enabling the dynamic deployment of Virtual Research Environments
|
||||
by favouring the realisation of reuse oriented policies.
|
||||
|
||||
The projects leading to this software have received funding from a series of European Union programmes including:
|
||||
|
||||
- the Sixth Framework Programme for Research and Technological Development
|
||||
- DILIGENT (grant no. 004260);
|
||||
- the Seventh Framework Programme for research, technological development and demonstration
|
||||
- D4Science (grant no. 212488), D4Science-II (grant no.239019), ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine(grant no. 283644);
|
||||
- the H2020 research and innovation programme
|
||||
- BlueBRIDGE (grant no. 675680), EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant no. 654119), SoBigData (grant no. 654024),DESIRA (grant no. 818194), ARIADNEplus (grant no. 823914), RISIS2 (grant no. 824091), PerformFish (grant no. 727610), AGINFRAplus (grant no. 731001);
|
||||
|
@ -0,0 +1,129 @@
|
||||
<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>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<version>1.1.0</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>event-publisher-portal</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>0.1.0</version>
|
||||
<properties>
|
||||
<liferay.version>6.2.5</liferay.version>
|
||||
<liferay.maven.plugin.version>6.2.10.12</liferay.maven.plugin.version>
|
||||
<liferay.auto.deploy.dir>/Users/themaxx/Development/Server/liferay-portal-6.2-ce-ga6/deploy
|
||||
</liferay.auto.deploy.dir>
|
||||
<liferay.app.server.deploy.dir>/Users/themaxx/Development/Server/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps
|
||||
</liferay.app.server.deploy.dir>
|
||||
<liferay.app.server.lib.global.dir>/Users/themaxx/Development/Server/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext
|
||||
</liferay.app.server.lib.global.dir>
|
||||
<liferay.app.server.portal.dir>/Users/themaxx/Development/Server/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT
|
||||
</liferay.app.server.portal.dir>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.liferay.maven.plugins</groupId>
|
||||
<artifactId>liferay-maven-plugin</artifactId>
|
||||
<version>${liferay.maven.plugin.version}</version>
|
||||
<configuration>
|
||||
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
|
||||
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
|
||||
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
|
||||
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
|
||||
<liferayVersion>${liferay.version}</liferayVersion>
|
||||
<pluginType>hook</pluginType>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>oidc-library</artifactId>
|
||||
<version>[0.2.0,)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>oidc-library-portal</artifactId>
|
||||
<version>[0.1.0,)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>event-publisher-library</artifactId>
|
||||
<version>[0.0.1,)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.dvos</groupId>
|
||||
<artifactId>usermanagement-core</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>util-java</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<!-- <scope>provided</scope> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,32 @@
|
||||
package org.gcube.portal.event.publisher.lr62;
|
||||
|
||||
import org.gcube.event.publisher.AbstractEventPublisher;
|
||||
import org.gcube.event.publisher.EventSender;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public abstract class AbstractLR62EventPublisher extends AbstractEventPublisher {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(AbstractLR62EventPublisher.class);
|
||||
|
||||
public AbstractLR62EventPublisher() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected EventSender createEventSender() {
|
||||
// OpenIdConnectConfiguration openIdConnectConfiguration = LiferayOpenIdConnectConfiguration.getConfiguration();
|
||||
// EventPublisherConfiguration eventPublisherConfiguration = EventPublisherConfiguration.getConfiguration();
|
||||
// return new HTTPEventSender(eventPublisherConfiguration.getEventPublisherURL(),
|
||||
// openIdConnectConfiguration.getPortalClientId(), openIdConnectConfiguration.getPortalClientSecret(),
|
||||
// openIdConnectConfiguration.getTokenURL());
|
||||
return new EventSender() {
|
||||
@Override
|
||||
public void send(JSONObject event) {
|
||||
System.out.println(event);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package org.gcube.portal.event.publisher.lr62;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
import com.liferay.portal.kernel.util.PrefsPropsUtil;
|
||||
import com.liferay.portal.security.auth.CompanyThreadLocal;
|
||||
import com.liferay.portal.util.PortalUtil;
|
||||
|
||||
public class EventPublisherConfiguration {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(EventPublisherConfiguration.class);
|
||||
|
||||
public static Map<Long, EventPublisherConfiguration> companyId2Configuration = Collections
|
||||
.synchronizedMap(new HashMap<Long, EventPublisherConfiguration>());
|
||||
|
||||
private Long companyId;
|
||||
private URL eventPublisherURL;
|
||||
|
||||
public static synchronized EventPublisherConfiguration getConfiguration(Long companyId) {
|
||||
log.trace("Getting config from companyId");
|
||||
if (!companyId2Configuration.containsKey(companyId)) {
|
||||
companyId2Configuration.put(companyId, new EventPublisherConfiguration(companyId));
|
||||
}
|
||||
return companyId2Configuration.get(companyId);
|
||||
}
|
||||
|
||||
public static synchronized EventPublisherConfiguration getConfiguration(HttpServletRequest request) {
|
||||
log.trace("Getting config from request");
|
||||
return EventPublisherConfiguration.getConfiguration(PortalUtil.getCompanyId(request));
|
||||
}
|
||||
|
||||
public static synchronized EventPublisherConfiguration getConfiguration() {
|
||||
log.trace("Getting config from thread local");
|
||||
return EventPublisherConfiguration.getConfiguration(CompanyThreadLocal.getCompanyId());
|
||||
}
|
||||
|
||||
private EventPublisherConfiguration(Long companyId) {
|
||||
log.info("Creating config from companyId: " + companyId);
|
||||
this.companyId = companyId;
|
||||
try {
|
||||
this.eventPublisherURL = new URL(PrefsPropsUtil.getString(companyId, "d4science.event-broker-endpoint"));
|
||||
} catch (SystemException | MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
log.info("eventPublisherURL=" + getEventPublisherURL());
|
||||
}
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public URL getEventPublisherURL() {
|
||||
return eventPublisherURL;
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package org.gcube.portal.event.publisher.lr62;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.event.publisher.Event;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
import com.liferay.portal.model.User;
|
||||
import com.liferay.portal.util.PortalUtil;
|
||||
|
||||
public class PortalEvent extends Event {
|
||||
|
||||
private static final long serialVersionUID = -6940345709578482873L;
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(PortalEvent.class);
|
||||
|
||||
private static String sender;
|
||||
|
||||
public static final String TYPE = "portal";
|
||||
public static final String GROUP_ENTRY = "group";
|
||||
public static final String ROLE_ENTRY = "role";
|
||||
|
||||
static {
|
||||
try {
|
||||
sender = new LiferayGroupManager().getRootVOName();
|
||||
} catch (Exception e) {
|
||||
log.warn("Cannot get root VO name, using hostname");
|
||||
try {
|
||||
sender = InetAddress.getLocalHost().getHostName();
|
||||
} catch (UnknownHostException e1) {
|
||||
log.error("Cannot get localhost name", e);
|
||||
sender = PortalUtil.getComputerName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public PortalEvent(String name) {
|
||||
super(name, TYPE, getSender());
|
||||
}
|
||||
|
||||
public PortalEvent(String name, User user) {
|
||||
this(name, getUserIdentifier(user));
|
||||
}
|
||||
|
||||
public PortalEvent(String name, String user) {
|
||||
super(name, TYPE, getSender(), user);
|
||||
}
|
||||
|
||||
public PortalEvent(String name, User user, Map<String, String> data) {
|
||||
this(name, getUserIdentifier(user), data);
|
||||
}
|
||||
|
||||
public PortalEvent(String name, String user, Map<String, String> data) {
|
||||
super(name, TYPE, getSender(), user, data);
|
||||
}
|
||||
|
||||
protected static String getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
setUser(getUserIdentifier(user));
|
||||
}
|
||||
|
||||
protected static String getUserIdentifier(User user) {
|
||||
return user.getScreenName();
|
||||
}
|
||||
|
||||
public void setGroup(String group) {
|
||||
set(GROUP_ENTRY, group);
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return (String) (GROUP_ENTRY);
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
set(ROLE_ENTRY, role);
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return (String) (ROLE_ENTRY);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.PortalEvent;
|
||||
|
||||
import com.liferay.portal.model.User;
|
||||
|
||||
public class ActionEvent extends PortalEvent {
|
||||
|
||||
private static final long serialVersionUID = -256209939036712171L;
|
||||
|
||||
public static final String LOGIN_NAME = "login";
|
||||
public static final String LOGOUT_NAME = "logout";
|
||||
|
||||
private ActionEvent(String name, User user) {
|
||||
super(name, user);
|
||||
}
|
||||
|
||||
public static ActionEvent newLoginEvent(HttpServletRequest request, HttpServletResponse response) {
|
||||
User user = (User) request.getSession(false).getAttribute("USER");
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Sending login event for user: " + user.getScreenName());
|
||||
}
|
||||
return new ActionEvent(LOGIN_NAME, user);
|
||||
}
|
||||
|
||||
public static ActionEvent newLogoutEvent(HttpServletRequest request, HttpServletResponse response) {
|
||||
User user = (User) request.getSession(false).getAttribute("USER");
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Sending logut event for user: " + user.getScreenName());
|
||||
}
|
||||
return new ActionEvent(LOGOUT_NAME, user);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.AbstractLR62EventPublisher;
|
||||
|
||||
public class ActionEventPublisher extends AbstractLR62EventPublisher {
|
||||
|
||||
public ActionEventPublisher() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.event.publisher.EventPublisher;
|
||||
|
||||
import com.liferay.portal.kernel.events.Action;
|
||||
import com.liferay.portal.kernel.events.ActionException;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public class PostLoginAction extends Action {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(PostLoginAction.class);
|
||||
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
public PostLoginAction() {
|
||||
eventPublisher = new ActionEventPublisher();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
|
||||
eventPublisher.publish(ActionEvent.newLoginEvent(request, response));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.event.publisher.EventPublisher;
|
||||
|
||||
import com.liferay.portal.kernel.events.Action;
|
||||
import com.liferay.portal.kernel.events.ActionException;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public class PreLogoutAction extends Action {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(PreLogoutAction.class);
|
||||
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
public PreLogoutAction() {
|
||||
eventPublisher = new ActionEventPublisher();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
|
||||
eventPublisher.publish(ActionEvent.newLogoutEvent(request, response));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import org.gcube.event.publisher.EventPublisher;
|
||||
|
||||
import com.liferay.portal.kernel.events.ActionException;
|
||||
import com.liferay.portal.kernel.events.SimpleAction;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public class ShutdownAction extends SimpleAction {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(ShutdownAction.class);
|
||||
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
public ShutdownAction() {
|
||||
eventPublisher = new ActionEventPublisher();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String[] ids) throws ActionException {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Sending shutdown event");
|
||||
}
|
||||
eventPublisher.publish(SimpleActionEvent.newShutdownEvent(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.PortalEvent;
|
||||
|
||||
public class SimpleActionEvent extends PortalEvent {
|
||||
|
||||
private static final long serialVersionUID = -256209939036712171L;
|
||||
|
||||
public static final String STARTUP_NAME = "startup";
|
||||
public static final String SHUTDOWN_NAME = "shutdown";
|
||||
|
||||
public static final String LOGIN_NAME = "login";
|
||||
public static final String LOGOUT_NAME = "logout";
|
||||
|
||||
public static final String IDS_ENTRY = "ids";
|
||||
|
||||
private SimpleActionEvent(String name, String[] ids) {
|
||||
super(name);
|
||||
setData(ids);
|
||||
}
|
||||
|
||||
public static SimpleActionEvent newStartupEvent(String[] ids) {
|
||||
return new SimpleActionEvent(STARTUP_NAME, ids);
|
||||
}
|
||||
|
||||
public static SimpleActionEvent newShutdownEvent(String[] ids) {
|
||||
return new SimpleActionEvent(SHUTDOWN_NAME, ids);
|
||||
}
|
||||
|
||||
public void setData(String[] ids) {
|
||||
set(IDS_ENTRY, String.join(", ", ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.gcube.portal.event.publisher.lr62.action;
|
||||
|
||||
import org.gcube.event.publisher.EventPublisher;
|
||||
|
||||
import com.liferay.portal.kernel.events.ActionException;
|
||||
import com.liferay.portal.kernel.events.SimpleAction;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public class StartupAction extends SimpleAction {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(StartupAction.class);
|
||||
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
public StartupAction() {
|
||||
eventPublisher = new ActionEventPublisher();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String[] ids) throws ActionException {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Sending startup event");
|
||||
}
|
||||
eventPublisher.publish(SimpleActionEvent.newStartupEvent(ids));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.AbstractLR62EventPublisher;
|
||||
|
||||
import com.liferay.portal.model.BaseModel;
|
||||
import com.liferay.portal.model.ModelListener;
|
||||
|
||||
public abstract class AbstractEventPublisherBaseModelListener<T extends BaseModel<T>>
|
||||
extends AbstractLR62EventPublisher
|
||||
implements ModelListener<T> {
|
||||
|
||||
public AbstractEventPublisherBaseModelListener() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.model.Group;
|
||||
|
||||
public class GroupEvent extends PortalModelListenerEvent<Group> {
|
||||
|
||||
private static final long serialVersionUID = 3939268094440017646L;
|
||||
|
||||
public static final String CREATED_NAME = "group_created";
|
||||
public static final String DELETED_NAME = "group_deleted";
|
||||
|
||||
private GroupEvent(String name, Group group) throws PortalException, SystemException {
|
||||
super(name, group);
|
||||
setGroup(group);
|
||||
}
|
||||
|
||||
public static GroupEvent newCreatedEvent(Group group) {
|
||||
try {
|
||||
return new GroupEvent(CREATED_NAME, group);
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot create event from Group model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static GroupEvent newDeletedEvent(Group group) {
|
||||
try {
|
||||
return new GroupEvent(DELETED_NAME, group);
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot create event from Group model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.ModelListenerException;
|
||||
import com.liferay.portal.model.Group;
|
||||
|
||||
public class GroupEventPublisher extends AbstractEventPublisherBaseModelListener<Group> {
|
||||
|
||||
@Override
|
||||
public void onAfterCreate(Group group) throws ModelListenerException {
|
||||
if (group.isSite()) {
|
||||
publish(GroupEvent.newCreatedEvent(group));
|
||||
} else {
|
||||
log.info("Created a non-site Group");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemove(Group group) throws ModelListenerException {
|
||||
if (group.isSite()) {
|
||||
publish(GroupEvent.newDeletedEvent(group));
|
||||
} else {
|
||||
log.info("Deleted a non-site Group");
|
||||
}
|
||||
}
|
||||
|
||||
/* Uninteresting model events */
|
||||
|
||||
@Override
|
||||
public void onAfterRemove(Group group) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterUpdate(Group group) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeCreate(Group group) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeUpdate(Group group) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.portal.event.publisher.lr62.PortalEvent;
|
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.model.BaseModel;
|
||||
import com.liferay.portal.model.Group;
|
||||
import com.liferay.portal.model.Role;
|
||||
import com.liferay.portal.model.User;
|
||||
|
||||
public class PortalModelListenerEvent<T extends BaseModel<T>> extends PortalEvent {
|
||||
|
||||
private static final long serialVersionUID = -9062395669075373612L;
|
||||
|
||||
public static final String MODELCLASSNAME_ENTRY = "model-class-name";
|
||||
|
||||
public PortalModelListenerEvent(String name, T baseModel) {
|
||||
super(name);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, User user, T baseModel) {
|
||||
super(name, user);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, String user, T baseModel) {
|
||||
super(name, user);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, String user, Map<String, String> data, T baseModel) {
|
||||
super(name, user, data);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public PortalModelListenerEvent(String name, User user, Map<String, String> data, T baseModel) {
|
||||
super(name, user, data);
|
||||
setModelClassName(baseModel.getModelClassName());
|
||||
}
|
||||
|
||||
public void setGroup(Group group) throws PortalException, SystemException {
|
||||
setGroup(getGroupIdentifier(group));
|
||||
}
|
||||
|
||||
protected static String getGroupIdentifier(Group group) throws PortalException, SystemException {
|
||||
return group.getDescriptiveName();
|
||||
}
|
||||
|
||||
public void setRole(Role role) throws PortalException, SystemException {
|
||||
setRole(getRoleIdentifier(role));
|
||||
}
|
||||
|
||||
protected static String getRoleIdentifier(Role role) throws PortalException, SystemException {
|
||||
return role.getDescriptiveName();
|
||||
}
|
||||
|
||||
public void setModelClassName(String group) {
|
||||
set(MODELCLASSNAME_ENTRY, group);
|
||||
}
|
||||
|
||||
public String getModelClassName() {
|
||||
return (String) (MODELCLASSNAME_ENTRY);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.model.User;
|
||||
|
||||
public class UserEvent extends PortalModelListenerEvent<User> {
|
||||
|
||||
private static final long serialVersionUID = 3939268094440017646L;
|
||||
|
||||
public static final String CREATED_NAME = "user_created";
|
||||
public static final String DELETED_NAME = "user_deleted";
|
||||
|
||||
private UserEvent(String name, User user) {
|
||||
super(name, user, user);
|
||||
}
|
||||
|
||||
public static UserEvent newCreatedEvent(User user) {
|
||||
return new UserEvent(CREATED_NAME, user);
|
||||
}
|
||||
|
||||
public static UserEvent newDeletedEvent(User user) {
|
||||
return new UserEvent(DELETED_NAME, user);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.ModelListenerException;
|
||||
import com.liferay.portal.model.User;
|
||||
|
||||
public class UserEventPublisher extends AbstractEventPublisherBaseModelListener<User> {
|
||||
|
||||
@Override
|
||||
public void onAfterCreate(User user) throws ModelListenerException {
|
||||
publish(UserEvent.newCreatedEvent(user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemove(User user) throws ModelListenerException {
|
||||
publish(UserEvent.newDeletedEvent(user));
|
||||
}
|
||||
|
||||
/* Uninteresting model events */
|
||||
|
||||
@Override
|
||||
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterRemove(User user) throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterUpdate(User user) throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeCreate(User user) throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeUpdate(User user) throws ModelListenerException {
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.model.Group;
|
||||
import com.liferay.portal.model.Role;
|
||||
import com.liferay.portal.model.User;
|
||||
import com.liferay.portal.model.UserGroupRole;
|
||||
|
||||
public class UserGroupRoleEvent extends PortalModelListenerEvent<UserGroupRole> {
|
||||
|
||||
private static final long serialVersionUID = 3939268094440017646L;
|
||||
|
||||
public static final String CREATED_NAME = "user-group-role_created";
|
||||
public static final String DELETED_NAME = "user-group-role_deleted";
|
||||
|
||||
private UserGroupRoleEvent(String name, UserGroupRole userGroupRole, User user, Group group, Role role)
|
||||
throws PortalException, SystemException {
|
||||
|
||||
super(name, user.getScreenName(), userGroupRole);
|
||||
setGroup(group);
|
||||
setRole(role);
|
||||
}
|
||||
|
||||
public static UserGroupRoleEvent newCreatedEvent(UserGroupRole userGroupRole, User user, Group group, Role role) {
|
||||
try {
|
||||
return new UserGroupRoleEvent(CREATED_NAME, userGroupRole, user, group, role);
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot create event from model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static UserGroupRoleEvent newDeletedEvent(UserGroupRole userGroupRole, User user, Group group, Role role) {
|
||||
try {
|
||||
return new UserGroupRoleEvent(DELETED_NAME, userGroupRole, user, group, role);
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot create event from model object", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package org.gcube.portal.event.publisher.lr62.model;
|
||||
|
||||
import com.liferay.portal.ModelListenerException;
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.model.Group;
|
||||
import com.liferay.portal.model.UserGroupRole;
|
||||
|
||||
public class UserGroupRoleEventPublisher extends AbstractEventPublisherBaseModelListener<UserGroupRole> {
|
||||
|
||||
@Override
|
||||
public void onAfterCreate(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
try {
|
||||
Group group = userGroupRole.getGroup();
|
||||
if (group.isSite()) {
|
||||
publish(UserGroupRoleEvent.newCreatedEvent(userGroupRole, userGroupRole.getUser(), group,
|
||||
userGroupRole.getRole()));
|
||||
} else {
|
||||
log.info("Created a non-site group's role");
|
||||
}
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot get related model objects", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemove(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
try {
|
||||
Group group = userGroupRole.getGroup();
|
||||
if (group.isSite()) {
|
||||
publish(UserGroupRoleEvent.newDeletedEvent(userGroupRole, userGroupRole.getUser(), group,
|
||||
userGroupRole.getRole()));
|
||||
} else {
|
||||
log.info("Deleted a non-site group's role");
|
||||
}
|
||||
} catch (PortalException | SystemException e) {
|
||||
log.error("Cannot get related model objects", e);
|
||||
}
|
||||
}
|
||||
|
||||
/* Uninteresting model events */
|
||||
|
||||
@Override
|
||||
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterRemove(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAfterUpdate(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeCreate(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
|
||||
throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBeforeUpdate(UserGroupRole userGroupRole) throws ModelListenerException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
value.object.listener.com.liferay.portal.model.User=org.gcube.portal.event.publisher.lr62.model.UserEventPublisher
|
||||
value.object.listener.com.liferay.portal.model.Group=org.gcube.portal.event.publisher.lr62.model.GroupEventPublisher
|
||||
value.object.listener.com.liferay.portal.model.UserGroupRole=org.gcube.portal.event.publisher.lr62.model.UserGroupRoleEventPublisher
|
||||
login.events.post=org.gcube.portal.event.publisher.lr62.action.PostLoginAction
|
||||
logout.events.pre=org.gcube.portal.event.publisher.lr62.action.PreLogoutAction
|
||||
#servlet.session.destroy.events=
|
||||
#global.startup.events is not hook-able but they should be configured in main portal*.properties
|
||||
#global.shutdown.events is not hook-able but they should be configured in main portal*.properties
|
||||
application.startup.events=org.gcube.portal.event.publisher.lr62.action.StartupAction
|
||||
application.shutdown.events=org.gcube.portal.event.publisher.lr62.action.ShutdownAction
|
||||
# shutdown event is never called. See issue at https://issues.liferay.com/browse/LPS-11613
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
|
||||
|
||||
<hook>
|
||||
<portal-properties>portal.properties</portal-properties>
|
||||
</hook>
|
@ -0,0 +1,9 @@
|
||||
name=event-publisher-hook
|
||||
module-group-id=liferay
|
||||
module-incremental-version=1
|
||||
tags=
|
||||
short-description=
|
||||
change-log=
|
||||
page-url=http://www.liferay.com
|
||||
author=Liferay, Inc.
|
||||
licenses=LGPL
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
</web-app>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"data": "20155",
|
||||
"sender": "unifi",
|
||||
"name": "startup",
|
||||
"type": "portal",
|
||||
"timestamp" : "2020-06-17T16:01:04.489Z",
|
||||
"uuid": "41ff313f-6365-499b-958f-c4b500c87877"
|
||||
}
|
@ -0,0 +1 @@
|
||||
d4science.event-broker-endpoint=http://localhost:8984/event
|
Loading…
Reference in New Issue