Skip to content
Merged
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
4 changes: 2 additions & 2 deletions modeshape-clustering/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<artifactId>modeshape-clustering</artifactId>
<version>3.4-SNAPSHOT</version>
<packaging>war</packaging>
<name>Example of a JSF web application that uses ModeShape via CDI</name>
<name>Example of a JSF web application that uses several clustered ModeShape servers</name>
<description>
A simple self-contained JSF web application that injects a ModeShape repository via CDI and performs various operations.
A simple self-contained JSF web application that show how ModeShape can be configured in a cluster.
</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.modeshape.quickstart.cdi;
package org.modeshape.quickstart.clustering;

import java.util.Collections;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.modeshape.quickstart.cdi;
package org.modeshape.quickstart.clustering;

import java.io.File;
import javax.inject.Inject;
Expand All @@ -14,7 +14,7 @@
import static org.junit.Assert.assertTrue;

/**
* Arquillian test for {@link ClusteringController}
* Arquillian test for {@link org.modeshape.quickstart.clustering.ClusteringController}
*
* @author Horia Chiorean (hchiorea@redhat.com)
*/
Expand Down
113 changes: 113 additions & 0 deletions modeshape-federation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Example Using a Federated ModeShape Repository
==============================================

What is it?
-----------

This is a self-contained and deployable Maven 3 project that shows how to configure a Federated ModeShape repository.
This example contains a `standalone-modeshape-federation.xml` configuration file which shows the configuration necessary for enabling a
Federated repository.

System requirements
-------------------

All you need to build this project is Java 6.0 (Java SDK 1.6) or better, Maven 3.0 or better.
The application this project produces is designed to be run on JBoss Enterprise Application Platform 6.

Install ModeShape's EAP kit into an existing JBoss EAP 6 server
---------------------------------------------------------------

Before running this demo make sure that you have installed the ModeShape EAP kit into an existing JBoss EAP server.
The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7)

Start a JBoss EAP instance with the provided configuration file (see above)
---------------------------------------------------------------------------

1. Copy the `standalone-modeshape-federation.xml` file from the root of the quickstart into the `JBOSS_HOME/standalone/configuration`
folder
2. Open a command line and navigate to the root of the JBoss server directory.
3. Start the `master` server:

For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape-federation.xml
For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape-federation.xml

Build and Deploy the Quickstart
-------------------------------

_NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml`
file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven)
for help on how to install and configure Maven 3._

1. Make sure you have started the JBoss Server instance as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. Type this command to build and deploy the archive into the `master` server:

mvn clean package jboss-as:deploy

4. This will deploy `target/modeshape-federation.war` to the running server.

Accessing the application
------------------------

The application will be running at the following URL: <http://localhost:8080/modeshape-federation/>

Open the above URLs into your browser

The user is presented with a form where he can choose an external source for which to list its content:

1. JBoss Server Data Dir - represents the JBOSS_HOME/standalone/data folder
2. Example DB - represents a simple, in memory H2 database which has been configured as part of `standalone-modeshape-federation.xml`

Undeploy the Archive
--------------------

1. Make sure you have started the JBoss Server instance as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. When you are finished testing, type this command to undeploy the archive from the server:

mvn jboss-as:undeploy

Run the Arquillian Tests
-------------------------

This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container.

1. Make sure you have started the JBoss Server as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. Type the following command to run the test goal with the following profile activated:

mvn clean package -Parq-jbossas-remote

The ModeShape project
---------------------
ModeShape is an open source implementation of the JCR 2.0
([JSR-283](http://www.jcp.org/en/jsr/detail?id=283])) specification and
standard API. To your applications, ModeShape looks and behaves like a
regular JCR repository. Applications can search, query, navigate, change,
version, listen for changes, etc. But ModeShape can store that content
in a variety of back-end stores (including relational databases, Infinispan
data grids, JBoss Cache, etc.), or it can access and update existing content
from *other* kinds of systems (including file systems, SVN repositories,
JDBC database metadata, and other JCR repositories). ModeShape's connector
architecture means that you can write custom connectors to access any
kind of system. And ModeShape can even federate multiple back-end systems
into a single, unified virtual repository.

For more information on ModeShape, including getting started guides,
reference guides, and downloadable binaries, visit the project's website
at [http://www.modeshape.org]() or follow us on our [blog](http://modeshape.wordpress.org)
or on [Twitter](http://twitter.com/modeshape). Or hop into our
[IRC chat room](http://www.jboss.org/modeshape/chat) and talk our community
of contributors and users.

The official Git repository for the project is also on GitHub at
[http://github.com/ModeShape/modeshape]().

Need help ?
-----------

ModeShape is open source software with a dedicated community. If you have
any questions or problems, post a question in our
[user forum](http://community.jboss.org/en/modeshape) or hop into our
[IRC chat room](http://www.jboss.org/modeshape/chat) and talk our
community of contributors and users.
240 changes: 240 additions & 0 deletions modeshape-federation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.modeshape.quickstarts</groupId>
<artifactId>modeshape-federation</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Example of a JSF web application that uses ModeShape in Federated mode</name>
<description>
A simple self-contained JSF web application that injects a Federated ModeShape repository
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>

<!-- Maven plugin versions -->
<version.assembly.plugin>2.4</version.assembly.plugin>
<version.clean.plugin>2.5</version.clean.plugin>
<version.compiler.plugin>3.0</version.compiler.plugin>
<version.dependency.plugin>2.6</version.dependency.plugin>
<version.install.plugin>2.4</version.install.plugin>
<version.jar.plugin>2.4</version.jar.plugin>
<version.resources.plugin>2.6</version.resources.plugin>
<version.surefire.plugin>2.12.3</version.surefire.plugin>
<version.war.plugin>2.3</version.war.plugin>
<version.org.jboss.as.plugins.maven.plugin>7.4.Final</version.org.jboss.as.plugins.maven.plugin>

<!-- Global dependency version information-->
<version.org.jboss.bom>1.0.4.Final</version.org.jboss.bom>
<version.modeshape>3.4-SNAPSHOT</version.modeshape>
</properties>

<dependencyManagement>
<dependencies>
<!-- JBoss distributes a complete set of Java EE 6 APIs including
a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or
a collection) of artifacts. We use this here so that we always get the correct
versions of artifacts. Here we use the jboss-javaee-6.0 stack (you can
read this as the JBoss stack of the Java EE 6 APIs). You can actually
use this stack with any version of JBoss AS that implements Java EE 6, not
just JBoss AS 7! -->
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>${version.org.jboss.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement" section
defaults for all of the modules we might need, but we still have to include in the
"dependencies" section the modules we DO need. The benefit is that we don't have to
specify the versions of any of those modules.-->
<dependency>
<groupId>org.modeshape.bom</groupId>
<artifactId>modeshape-bom-jbosseap</artifactId>
<version>${version.modeshape}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>

<dependency>
<groupId>org.modeshape</groupId>
<artifactId>modeshape-jcr-api</artifactId>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>

<!-- Import the CDI API, we use provided scope as the API is included in JBoss AS 7 -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Import the Common Annotations API (JSR-250), we use provided scope
as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<!-- Import the JSF API, we use provided scope as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.1_spec</artifactId>
<scope>provided</scope>
</dependency>

<!--The following is a list of test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${version.assembly.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${version.clean.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<showDeprecation>false</showDeprecation>
<showWarnings>false</showWarnings>
<compilerArguments>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${version.dependency.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.install.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.jar.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.resources.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

<!-- JBoss AS plugin to deploy war -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${version.org.jboss.as.plugins.maven.plugin}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<!-- The default profile skips all tests, though you can tune
it to run just unit tests based on a custom pattern -->

<!-- Separate profiles are provided for running all tests, including
Arquillian tests that execute in the specified container -->
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<!--
An optional Arquillian testing profile that executes tests in a remote JBoss AS instance
Run with: mvn clean test -Parq-jbossas-remote
-->
<id>arq-jbossas-remote</id>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Loading