You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2017/02/18 00:43:27 UTC
[01/15] polygene-java git commit: Adding missing Javadocs.
Repository: polygene-java
Updated Branches:
refs/heads/develop 9d16d5553 -> 8e8ac22cb
Adding missing Javadocs.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/a5479274
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/a5479274
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/a5479274
Branch: refs/heads/develop
Commit: a5479274a2c94da03defd2957473df0b2889cd18
Parents: 6f23e55
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Jan 7 14:56:52 2017 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Jan 7 14:56:52 2017 +0800
----------------------------------------------------------------------
.../polygene/bootstrap/LayerAssembly.java | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/a5479274/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
index 6afbf26..0385040 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
@@ -39,14 +39,46 @@ public interface LayerAssembly
*/
ModuleAssembly module( String name );
+ /**
+ *
+ * @return the {@link ApplicationAssembly} that this {@code LayerAssembly} belongs to.
+ */
ApplicationAssembly application();
+ /**
+ *
+ * @return the name of the {@code Layer} that is being assembled.
+ */
String name();
+ /**
+ * Sets the name of the {@code Layer} being assembled.
+ * By convention, a {@code Layer} should include the word "Layer" as the suffix, e.g "DomainLayer", so tooling
+ * can use camel-case detection and present the name and not require it to explicitly say that it is a layer.
+ *
+ * @param name The name that the Layer should have.
+ * @return this {@code LayerAssembly} instance to support fluent APIs
+ */
LayerAssembly setName( String name );
+ /** Set metadata for the {@code Layer}.
+ * Any arbitrary object can be attached as metainfo on a {@code Layer} that is available in runtime, by calling
+ * {@link org.apache.polygene.api.structure.Layer#metaInfo(Class)}. Multiple registrations of the same type is
+ * not possible, and the lookup will search registered meta-info objects against the lookup type, prioritizing
+ * interfaces over classes and the most sub-typed nterface first.
+ *
+ * @param info The meta-info type to be looked up. Typically a type that is explicitly used for meta-info.
+ * @return this {@code LayerAssembly} instance to support fluent APIs
+ */
LayerAssembly setMetaInfo( Object info );
+ /** Declaration of which other {@code Layers} that this {@code Layer} is able to use.
+ * This is how architecture reinforcement works. Any composites that are declared
+ * {@link org.apache.polygene.api.common.Visibility#application} in a "used" layer can be reached from this Layer.
+ *
+ * @param layerAssembly The {@code Layer(s)} that this {@code Layer} can reach/see.
+ * @return this {@code LayerAssembly} instance to support fluent APIs
+ */
LayerAssembly uses( LayerAssembly... layerAssembly );
/**
[05/15] polygene-java git commit: Merge remote-tracking branch
'origin/develop' into develop
Posted by ni...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/5cf33920
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/5cf33920
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/5cf33920
Branch: refs/heads/develop
Commit: 5cf339205006dcaf8314db8e92548777b30ee43e
Parents: 0655a44 9d16d55
Author: niclas <ni...@spicter.com>
Authored: Sat Feb 4 13:47:28 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Sat Feb 4 13:47:28 2017 +0800
----------------------------------------------------------------------
.../ConstraintViolationException.java | 2 +-
.../property/InvalidPropertyTypeException.java | 7 +++--
.../polygene/api/query/grammar/OrderBy.java | 6 +----
.../activation/PassivationExceptionTest.java | 2 +-
.../api/composite/PropertyMapperTest.java | 4 +--
.../apache/polygene/api/util/ClassesTest.java | 6 ++---
.../api/value/DocumentationSupport.java | 10 --------
.../runtime/association/AssociationsModel.java | 2 +-
.../bootstrap/CompositeAssemblyImpl.java | 2 +-
.../runtime/composite/ConcernsModel.java | 2 +-
.../runtime/composite/ConstraintsModel.java | 2 +-
.../runtime/composite/SideEffectsModel.java | 2 +-
.../composite/TransientBuilderInstance.java | 4 +--
.../ImportedServiceReferenceInstance.java | 2 +-
.../unitofwork/EntityBuilderInstance.java | 2 +-
.../runtime/value/ValueBuilderInstance.java | 2 +-
.../value/ValueBuilderWithPrototype.java | 4 +--
.../runtime/value/ValueBuilderWithState.java | 4 +--
.../apache/polygene/api/common/PluginTest.java | 2 +-
.../runtime/injection/StateInjectionTest.java | 6 ++---
.../injection/UnitOfWorkInjectionTest.java | 2 +-
.../sideeffects/SpecificSideEffectTest.java | 3 +--
.../spi/property/DefaultValuesTest.java | 6 ++---
.../test/entity/AbstractEntityStoreTest.java | 2 +-
.../test/indexing/AbstractEntityFinderTest.java | 6 ++---
.../ehcache/assembly/EhCacheAssembler.java | 2 +-
.../cache/memcache/MemcacheAssembler.java | 2 +-
.../assembly/ESClusterIndexQueryAssembler.java | 2 +-
.../ESFilesystemIndexQueryAssembler.java | 2 +-
.../AbstractSQLIndexQueryAssembler.java | 2 +-
.../postgresql/PostgreSQLEntityFinderTest.java | 4 +--
.../JacksonValueSerializationAssembler.java | 27 +++-----------------
.../OrgJsonValueSerializationAssembler.java | 27 +++-----------------
.../stax/StaxValueSerializationAssembler.java | 27 +++-----------------
.../library/alarm/AlarmSystemAssembler.java | 2 +-
.../library/alarm/AlarmServiceTest.java | 6 ++---
.../library/alarm/SimpleAlarmModelTest.java | 12 ++++-----
.../library/alarm/StandardAlarmModelTest.java | 16 ++++++------
.../BreaksCircuitOnThrowableTest.java | 2 +-
.../jmx/CircuitBreakerManagementSample.java | 2 +-
.../fileconfig/FileConfigurationAssembler.java | 2 +-
.../library/http/AbstractJettyMixin.java | 4 +--
.../library/http/JettyServiceAssembler.java | 2 +-
.../polygene/library/http/ServletInfo.java | 2 +-
.../logging/trace/TraceOnConsoleSideEffect.java | 7 ++---
.../rdf/model/ApplicationSerializer.java | 2 +-
.../responsewriter/LinksResponseWriter.java | 2 +-
.../restlet/assembly/domain/DomainLayer.java | 8 ------
.../infrastructue/InfrastructureLayer.java | 13 +++-------
.../infrastructue/SerializationModule.java | 10 --------
.../shiro/assembly/PasswordDomainAssembler.java | 2 +-
.../assembly/StandaloneShiroAssembler.java | 2 +-
.../sql/liquibase/LiquibaseAssembler.java | 2 +-
...bstractPooledDataSourceServiceAssembler.java | 2 +-
.../sample/forum/assembler/ForumAssembler.java | 1 -
.../rental/web/assembly/StorageModule.java | 1 -
.../polygene/envisage/detail/MethodPane.java | 5 +---
.../envisage/graph/StackedGraphDisplay.java | 2 +-
.../app/templates/DomainLayer/bootstrap.tmpl | 8 ------
.../app/templates/Heroes/bootstrap.tmpl | 7 +----
.../InfrastructureLayer/bootstrap.tmpl | 9 ++-----
.../JacksonSerializationModule/bootstrap.tmpl | 10 --------
.../common/ApplicationAssemblerWriter.java | 6 +----
.../project/common/DomainLayerWriter.java | 8 ------
.../common/InfrastructureLayerWriter.java | 9 ++-----
.../common/SecurityRepositoryWriter.java | 2 --
.../common/SerializationModuleWriter.java | 10 --------
67 files changed, 95 insertions(+), 270 deletions(-)
----------------------------------------------------------------------
[13/15] polygene-java git commit: Yeoman generator improvements
Posted by ni...@apache.org.
Yeoman generator improvements
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/75b3668c
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/75b3668c
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/75b3668c
Branch: refs/heads/develop
Commit: 75b3668c43a3ae28221f6b06b7e16b6907d24f51
Parents: ea639e8
Author: niclas <ni...@spicter.com>
Authored: Tue Feb 14 12:47:34 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Tue Feb 14 12:47:34 2017 +0800
----------------------------------------------------------------------
.../helpers/MapEntityStoreMixin.java | 2 +-
.../spi/value/ValueDeserializerAdapter.java | 13 +--
tools/generator-polygene/app/index.js | 9 +-
.../app/templates/buildtool/gradle-app.tmpl | 2 +-
.../templates/buildtool/gradle-bootstrap.tmpl | 4 +-
.../app/templates/buildtool/gradle-rest.tmpl | 2 +-
.../buildtool/gradle-wrapper.properties_ | 2 +-
tools/shell/src/docs/shell.txt | 101 -------------------
tools/src/docs/yeoman_polygene.txt | 99 ++++++++++++++++++
9 files changed, 117 insertions(+), 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
index 40cfa76..dc4db58 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
@@ -405,7 +405,7 @@ public class MapEntityStoreMixin
catch( JSONException e )
{
// Value not found, default it
- Object initialValue = propertyDescriptor.initialValue( module );
+ Object initialValue = propertyDescriptor.resolveInitialValue(module);
properties.put( propertyDescriptor.qualifiedName(), initialValue );
status[ 0 ] = EntityStatus.UPDATED;
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/core/spi/src/main/java/org/apache/polygene/spi/value/ValueDeserializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/value/ValueDeserializerAdapter.java b/core/spi/src/main/java/org/apache/polygene/spi/value/ValueDeserializerAdapter.java
index cac2270..c586498 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/value/ValueDeserializerAdapter.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/value/ValueDeserializerAdapter.java
@@ -48,6 +48,7 @@ import java.util.stream.StreamSupport;
import org.apache.polygene.api.entity.EntityReference;
import org.apache.polygene.api.identity.Identity;
import org.apache.polygene.api.identity.StringIdentity;
+import org.apache.polygene.api.property.Property;
import org.apache.polygene.api.structure.ModuleDescriptor;
import org.apache.polygene.api.type.CollectionType;
import org.apache.polygene.api.type.EnumType;
@@ -462,20 +463,20 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
final Map<String, Object> stateMap = new HashMap<>();
// Properties
- valueCompositeType.properties().forEach( property -> {
+ valueCompositeType.properties().forEach( propertyDescriptor -> {
String propertyName = null;
Object value;
try
{
- propertyName = property.qualifiedName().name();
+ propertyName = propertyDescriptor.qualifiedName().name();
if( objectHasField( module, inputNode, propertyName ) )
{
value = getObjectFieldValue(
module,
inputNode,
propertyName,
- buildDeserializeInputNodeFunction( module, property.valueType() ) );
- if( property.isImmutable() )
+ buildDeserializeInputNodeFunction( module, propertyDescriptor.valueType() ) );
+ if( propertyDescriptor.isImmutable() )
{
if( value instanceof Set )
{
@@ -494,12 +495,12 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
else
{
// Serialized object does not contain the field, try to default it
- value = property.initialValue( module );
+ value = propertyDescriptor.resolveInitialValue(module);
}
}
catch( Exception e )
{
- throw new ValueSerializationException( "Unable to deserialize property " + property, e );
+ throw new ValueSerializationException( "Unable to deserialize property " + propertyDescriptor, e );
}
stateMap.put( propertyName, value );
} );
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/generator-polygene/app/index.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js
index 4d57562..cddb34a 100644
--- a/tools/generator-polygene/app/index.js
+++ b/tools/generator-polygene/app/index.js
@@ -61,22 +61,23 @@ module.exports = generators.Base.extend(
type: 'list',
name: 'entitystore',
choices: [
+ 'Cassandra',
'File',
+ 'DerbySQL',
'Geode',
+ 'H2SQL',
'Hazelcast',
'JClouds',
'Jdbm',
'LevelDB',
'Memory',
'MongoDB',
+ 'MySQL',
'Preferences',
'Redis',
'Riak',
- 'MySQL',
'PostgresSQL',
- 'SQLite',
- 'H2SQL',
- 'DerbySQL'
+ 'SQLite'
],
message: 'Which entity store do you want to use?'
},
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
index f307e8b..880a5e5 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
@@ -30,7 +30,7 @@ dependencies {
compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.servlet:$polygeneVersion"
+ compile "org.apache.polygene.libraries:org.apache.polygene.library.servlet:$polygeneVersion"
compile "javax.servlet:servlet-api:2.5"
compile "org.restlet.jee:org.restlet:2.3.4"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
index 3261944..d13cb96 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
@@ -25,9 +25,9 @@ dependencies {
compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.fileconfig:$polygeneVersion"
+ compile "org.apache.polygene.libraries:org.apache.polygene.library.fileconfig:$polygeneVersion"
<% if( hasFeature( 'rest api' ) ) { %>
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
+ compile "org.apache.polygene.libraries:org.apache.polygene.library.restlet:$polygeneVersion"
<% } %>
compile "org.apache.polygene.extension:org.apache.polygene.extension.entitystore-<%= polygene.entitystore.toLowerCase() %>:$polygeneVersion"
compile "org.apache.polygene.extension:org.apache.polygene.extension.indexing-<%= polygene.indexing.toLowerCase() %>:$polygeneVersion"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/generator-polygene/app/templates/buildtool/gradle-rest.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-rest.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-rest.tmpl
index 5c389c2..82afa09 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-rest.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-rest.tmpl
@@ -22,6 +22,6 @@ dependencies {
compile project( ":model" )
compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
+ compile "org.apache.polygene.libraries:org.apache.polygene.library.restlet:$polygeneVersion"
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/generator-polygene/app/templates/buildtool/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-wrapper.properties_ b/tools/generator-polygene/app/templates/buildtool/gradle-wrapper.properties_
index 731cb78..c90307d 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-wrapper.properties_
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-wrapper.properties_
@@ -21,4 +21,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/shell/src/docs/shell.txt
----------------------------------------------------------------------
diff --git a/tools/shell/src/docs/shell.txt b/tools/shell/src/docs/shell.txt
deleted file mode 100644
index 9ebc47c..0000000
--- a/tools/shell/src/docs/shell.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-///////////////////////////////////////////////////////////////
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-///////////////////////////////////////////////////////////////
-
-[[tools-shell,Command Line Shell]]
-= Polygene Shell =
-If you have installed the Polygene SDK, there is a +bin/polygene+ command line script,
-which has sub-functions in it. This list of commands will slowly grow
-for various purposes of doing software development with Apache Polygene.
-
-The current list of commands are;
-
- * <<tools-shell-create-project>>
-
-[[tools-shell-create-project,Create Project Script]]
-== Create Project ==
-
-This command creates a brand new project, in current directory, with a name
-provided. There are more than one template of the type of project that one
-might want to create. Full list of types to follow below. The command
-takes at least 3 additional arguments;
-
----------------------------
-polygene create-project type name package
----------------------------
-
-A directory called _name_ will be created in the current directory, and all
-the necessary structure for a Polygene project using Gradle will be created.
-
-The exact layout of the project depends on the _type_ argument and currently the
-following types exists;
-
- * <<tools-shell-create-project-null>> - Creates the build system and directory structure.
- * <<tools-shell-create-project-singleton>> - Creates a small application around the +SingletonAssembler+
- * <<tools-shell-create-project-default>> - Creates a 4 layer, Configuration, Infrastructure, Domain and Connectivity, command line application.
- * <<tools-shell-create-project-restapp>> - Creates the same 4 layer application as _default_, but also sets it up as a Restful application, ready to deploy on a web application container.
-
-The _package_ defines the root package name to be used, e.g. +org.apache.polygene.coolapp+. The +create-project+ program
-will create additional packages under this, according to its template.
-
-[[tools-shell-create-project-null,Create Null Project]]
-=== Create Null Project Template ===
-This templates only creates the build system for a single module application. Neither Java files nor other resources
-are created, and the developer has to set everything up from scratch.
-
-[[tools-shell-create-project-singleton,Create Singleton Project]]
-=== Create Singleton Project Template ===
-This template creates a so called Singleton application. That is an application with a single Layer and a single
-Module in that layer. In Polygene, all applications must have at least one Layer and one Module.
-
-This is useful for really small applications or demos, not expected to become large in the future. It is
-also currently required that the infrastructure is configuration free, otherwise it is not possible to set up.
-
-The template will configure the File EntityStore and RDF Indexing subsystems, hardcoded to the +polygene/store+ and
-+polygene/index+ respectively in the current directory where the application is started. This may not be suitable, in
-which case you should look at the <<tools-shell-create-project-default>> template.
-
-[[tools-shell-create-project-default,Create Default Project]]
-=== Create Default Project Template ===
-This template sets up a 4 layer, Configuration, Infrastructure, Domain, Connectivity, command line application.
-
-The template includes a small sample domain model, +Order+, +OrderItem+, +Customer+, but there is no functionality
-added to it.
-
-A +SecurityRepository+ is also created, with a simple hardcoded implementation (+HardCodedSecurityRepositoryMixin+).
-
-[[tools-shell-create-project-restapp,Create Rest Application Project]]
-=== Create Rest Application Project Template ===
-This template sets up a 4 layer, Configuration, Infrastructure, Domain, Connectivity, restful application. This
-application will use the <<library-restlet>> to create a full web application, ready to deploy on a servlet
-container, such as Tomcat or Jetty.
-
-The template includes a small sample domain model, +Order+, +OrderItem+, +Customer+, and have the CRUD operations
-for these already wired up to the restful +EndPoint+. Full HATEOAS is provided, so clients don't need to construct
-URLs, but simply follow links and use forms.
-
-The template also creates a simple SecurityRepository and attaches the mechanisms in the underlying Restlet
-implementation to do Authentication and Authorization (see SimpleEnroler and SimpleVerifier). There are two
-hardcoded users with two hardcoded roles.
-
------------
-# name password roles
- user 123 user
- admin secret admin
------------
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/75b3668c/tools/src/docs/yeoman_polygene.txt
----------------------------------------------------------------------
diff --git a/tools/src/docs/yeoman_polygene.txt b/tools/src/docs/yeoman_polygene.txt
new file mode 100644
index 0000000..38a7e0f
--- /dev/null
+++ b/tools/src/docs/yeoman_polygene.txt
@@ -0,0 +1,99 @@
+///////////////////////////////////////////////////////////////
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+///////////////////////////////////////////////////////////////
+
+[[tools-shell,Command Line Shell]]
+= Polygene Generator =
+Apache Polygene comes with a Yeoman code generator, to quickly set up a development
+environment for Polygene applications.
+
+The current list of commands are;
+
+ * <<tools-yeoman-create-project>>
+
+[[tools-yeoman-create-project,Create Project Script]]
+== Create Project ==
+
+This command creates a brand new project, in current directory. The generator
+will ask a lot of questions. If you are new to Polygene and only want to try
+it out, it is safe to hit ENTER on all questions.
+
+---------------------------
+yo polygene create-project
+---------------------------
+
+A directory called _name_ will be created in the current directory, and all
+the necessary structure for a Polygene project using Gradle will be created.
+
+The exact layout of the project depends on the _type_ argument and currently the
+following types exists;
+
+ * <<tools-shell-create-project-null>> - Creates the build system and directory structure.
+ * <<tools-shell-create-project-singleton>> - Creates a small application around the +SingletonAssembler+
+ * <<tools-shell-create-project-default>> - Creates a 4 layer, Configuration, Infrastructure, Domain and Connectivity, command line application.
+ * <<tools-shell-create-project-restapp>> - Creates the same 4 layer application as _default_, but also sets it up as a Restful application, ready to deploy on a web application container.
+
+The _package_ defines the root package name to be used, e.g. +org.apache.polygene.coolapp+. The +create-project+ program
+will create additional packages under this, according to its template.
+
+[[tools-shell-create-project-null,Create Null Project]]
+=== Create Null Project Template ===
+This templates only creates the build system for a single module application. Neither Java files nor other resources
+are created, and the developer has to set everything up from scratch.
+
+[[tools-shell-create-project-singleton,Create Singleton Project]]
+=== Create Singleton Project Template ===
+This template creates a so called Singleton application. That is an application with a single Layer and a single
+Module in that layer. In Polygene, all applications must have at least one Layer and one Module.
+
+This is useful for really small applications or demos, not expected to become large in the future. It is
+also currently required that the infrastructure is configuration free, otherwise it is not possible to set up.
+
+The template will configure the File EntityStore and RDF Indexing subsystems, hardcoded to the +polygene/store+ and
++polygene/index+ respectively in the current directory where the application is started. This may not be suitable, in
+which case you should look at the <<tools-shell-create-project-default>> template.
+
+[[tools-shell-create-project-default,Create Default Project]]
+=== Create Default Project Template ===
+This template sets up a 4 layer, Configuration, Infrastructure, Domain, Connectivity, command line application.
+
+The template includes a small sample domain model, +Order+, +OrderItem+, +Customer+, but there is no functionality
+added to it.
+
+A +SecurityRepository+ is also created, with a simple hardcoded implementation (+HardCodedSecurityRepositoryMixin+).
+
+[[tools-shell-create-project-restapp,Create Rest Application Project]]
+=== Create Rest Application Project Template ===
+This template sets up a 4 layer, Configuration, Infrastructure, Domain, Connectivity, restful application. This
+application will use the <<library-restlet>> to create a full web application, ready to deploy on a servlet
+container, such as Tomcat or Jetty.
+
+The template includes a small sample domain model, +Order+, +OrderItem+, +Customer+, and have the CRUD operations
+for these already wired up to the restful +EndPoint+. Full HATEOAS is provided, so clients don't need to construct
+URLs, but simply follow links and use forms.
+
+The template also creates a simple SecurityRepository and attaches the mechanisms in the underlying Restlet
+implementation to do Authentication and Authorization (see SimpleEnroler and SimpleVerifier). There are two
+hardcoded users with two hardcoded roles.
+
+-----------
+# name password roles
+ user 123 user
+ admin secret admin
+-----------
+
[15/15] polygene-java git commit: POLYGENE-226 - Start on the Initial
Value Provider stuff. Not trivial,
and need to make a partial commit which is not complete and not working yet.
Posted by ni...@apache.org.
POLYGENE-226 - Start on the Initial Value Provider stuff. Not trivial, and need to make a partial commit which is not complete and not working yet.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/8e8ac22c
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/8e8ac22c
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/8e8ac22c
Branch: refs/heads/develop
Commit: 8e8ac22cbf46498874f0093814f8023e2a276ea1
Parents: 7410895
Author: niclas <ni...@spicter.com>
Authored: Tue Feb 14 12:53:11 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Tue Feb 14 12:53:11 2017 +0800
----------------------------------------------------------------------
.../polygene/api/entity/EntityReference.java | 2 +-
.../api/property/InitialValueProvider.java | 8 +
.../api/property/PropertyDescriptor.java | 5 +-
.../polygene/bootstrap/MetaInfoDeclaration.java | 8 +
.../polygene/bootstrap/MixinDeclaration.java | 4 +
.../bootstrap/CompositeAssemblyImpl.java | 10 +-
.../runtime/composite/TransientInstance.java | 1 -
.../polygene/runtime/entity/EntityInstance.java | 1 -
.../polygene/runtime/entity/EntityModel.java | 2 +-
.../runtime/property/PropertyModel.java | 151 ++++++++++++-------
.../ImportedServiceReferenceInstance.java | 9 +-
.../runtime/service/ServiceInstance.java | 6 +-
.../polygene/runtime/service/ServiceModel.java | 2 +-
.../service/ServiceReferenceInstance.java | 15 +-
.../runtime/structure/ModuleInstance.java | 123 ++++++++-------
.../polygene/runtime/value/ValueInstance.java | 5 +-
.../polygene/api/common/PropertyTypeTest.java | 1 +
.../polygene/test/entity/CanRemoveAll.java | 7 +
.../prefs/PreferencesEntityStoreMixin.java | 20 +--
.../entitystore/sql/SQLEntityStoreMixin.java | 2 +-
.../skeletons/SQLCompatEntityStateWrapper.java | 2 +
.../polygene/migration/MigrationService.java | 2 +
.../migration/assembly/MigrationBuilder.java | 10 +-
.../migration/assembly/MigrationRules.java | 10 +-
.../constraints/NotEmptyStringConstraint.java | 4 -
.../rest/server/api/ContextResource.java | 2 +-
.../ValueDescriptorResponseWriter.java | 2 +-
27 files changed, 235 insertions(+), 179 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java b/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
index 731d3c3..fcfcb0e 100644
--- a/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
+++ b/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
@@ -35,7 +35,7 @@ public final class EntityReference
implements Serializable
{
/**
- * Parse an Entity reference to an EntityReference.
+ * Parse an Entity reference string to an EntityReference.
*
* @param identityString the EntityReference reference
* @return the EntityReference represented by the given reference
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java b/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
new file mode 100644
index 0000000..7fd6cc3
--- /dev/null
+++ b/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
@@ -0,0 +1,8 @@
+package org.apache.polygene.api.property;
+
+import java.util.function.BiFunction;
+import org.apache.polygene.api.structure.Module;
+
+public interface InitialValueProvider extends BiFunction<Module, PropertyDescriptor, Object>
+{
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java b/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
index 52b217c..2f5e641 100644
--- a/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
+++ b/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
@@ -24,6 +24,7 @@ import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Type;
import org.apache.polygene.api.common.QualifiedName;
import org.apache.polygene.api.structure.MetaInfoHolder;
+import org.apache.polygene.api.structure.Module;
import org.apache.polygene.api.structure.ModuleDescriptor;
import org.apache.polygene.api.type.ValueType;
@@ -54,7 +55,9 @@ public interface PropertyDescriptor extends MetaInfoHolder
AccessibleObject accessor();
- Object initialValue( ModuleDescriptor module );
+ InitialValueProvider initialValueProvider();
+
+ Object resolveInitialValue(ModuleDescriptor moduleDescriptor);
ValueType valueType();
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
index 2967fe5..348ac10 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
@@ -29,6 +29,7 @@ import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import org.apache.polygene.api.common.MetaInfo;
+import org.apache.polygene.api.property.InitialValueProvider;
import org.apache.polygene.api.property.Property;
/**
@@ -217,5 +218,12 @@ public final class MetaInfoDeclaration
metaInfo.set( info );
return this;
}
+
+ @Override
+ public MixinDeclaration<T> declareInitialValueProvider(InitialValueProvider provider)
+ {
+ metaInfo.add( InitialValueProvider.class, provider);
+ return this;
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
index 90e22f4..a50f305 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
@@ -20,6 +20,8 @@
package org.apache.polygene.bootstrap;
+import org.apache.polygene.api.property.InitialValueProvider;
+
/**
* Fluent API for declaring information about properties
*
@@ -30,4 +32,6 @@ public interface MixinDeclaration<T>
T declareDefaults();
MixinDeclaration<T> setMetaInfo( Object info );
+
+ MixinDeclaration<T> declareInitialValueProvider(InitialValueProvider provider);
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
index 3158cff..709f614 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
@@ -61,6 +61,7 @@ import org.apache.polygene.api.mixin.Initializable;
import org.apache.polygene.api.mixin.Mixins;
import org.apache.polygene.api.property.GenericPropertyInfo;
import org.apache.polygene.api.property.Immutable;
+import org.apache.polygene.api.property.InitialValueProvider;
import org.apache.polygene.api.property.Property;
import org.apache.polygene.api.sideeffect.SideEffects;
import org.apache.polygene.api.type.HasTypes;
@@ -465,13 +466,15 @@ public abstract class CompositeAssemblyImpl
}
boolean useDefaults = useDefaultsDeclaration != null || stateDeclarations.useDefaults( accessor );
boolean immutable = this.immutable || metaInfo.get( Immutable.class ) != null;
+ InitialValueProvider initialValueProvider = metaInfo.get(InitialValueProvider.class);
return new PropertyModel(
accessor,
immutable,
useDefaults,
valueConstraintsInstance,
metaInfo,
- initialValue
+ initialValue,
+ initialValueProvider
);
}
@@ -492,8 +495,9 @@ public abstract class CompositeAssemblyImpl
.findFirst().orElse( null );
String name = nameAnnotation == null ? "param" + ( i + 1 ) : nameAnnotation.value();
- boolean optional = Stream.of( parameterAnnotation ).filter( isType( Optional.class ) )
- .findFirst().isPresent();
+ boolean optional = Stream.of( parameterAnnotation )
+ .filter( isType( Optional.class ) )
+ .findFirst().isPresent();
ValueConstraintsModel parameterConstraintsModel = constraintsFor(
Arrays.stream( parameterAnnotation ),
parameterTypes[ i ],
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientInstance.java
index a251349..edc1a8b 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientInstance.java
@@ -57,7 +57,6 @@ public class TransientInstance
this.compositeModel = compositeModel;
this.mixins = mixins;
this.state = state;
-
proxy = compositeModel.newProxy( this );
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
index a58cee9..22432ec 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
@@ -157,7 +157,6 @@ public final class EntityInstance
{
initState();
}
-
return state;
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityModel.java
index 4fd073d..b468be6 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityModel.java
@@ -132,7 +132,7 @@ public final class EntityModel extends CompositeModel
{
// Set new properties to default value
state().properties().forEach( propertyDescriptor -> {
- entityState.setPropertyValue( propertyDescriptor.qualifiedName(), propertyDescriptor.initialValue( module ) );
+ entityState.setPropertyValue( propertyDescriptor.qualifiedName(), propertyDescriptor.resolveInitialValue(module) );
} );
// Set new associations to null
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
index 6aa5041..565b218 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
@@ -35,10 +35,12 @@ import org.apache.polygene.api.constraint.ConstraintViolationException;
import org.apache.polygene.api.entity.Queryable;
import org.apache.polygene.api.property.DefaultValues;
import org.apache.polygene.api.property.GenericPropertyInfo;
+import org.apache.polygene.api.property.InitialValueProvider;
import org.apache.polygene.api.property.InvalidPropertyTypeException;
import org.apache.polygene.api.property.Property;
import org.apache.polygene.api.property.PropertyDescriptor;
import org.apache.polygene.api.service.NoSuchServiceException;
+import org.apache.polygene.api.structure.Module;
import org.apache.polygene.api.structure.ModuleDescriptor;
import org.apache.polygene.api.type.Serialization;
import org.apache.polygene.api.type.ValueCompositeType;
@@ -63,7 +65,6 @@ public class PropertyModel
implements PropertyDescriptor, PropertyInfo, Binder, Visitable<PropertyModel>
{
private Type type;
-
private transient AccessibleObject accessor; // Interface accessor
private final QualifiedName qualifiedName;
@@ -72,9 +73,7 @@ public class PropertyModel
protected final MetaInfo metaInfo;
- private final Object initialValue;
-
- private final boolean useDefaults;
+ private final InitialValueProvider initialValueProvider;
private final boolean immutable;
@@ -89,7 +88,8 @@ public class PropertyModel
boolean useDefaults,
ValueConstraintsInstance constraints,
MetaInfo metaInfo,
- Object initialValue
+ Object initialValue,
+ InitialValueProvider initialValueProvider
)
{
if( accessor instanceof Method )
@@ -105,13 +105,15 @@ public class PropertyModel
type = GenericPropertyInfo.propertyTypeOf( accessor );
this.accessor = accessor;
qualifiedName = QualifiedName.fromAccessor( accessor );
-
- this.useDefaults = useDefaults;
-
- this.initialValue = initialValue;
-
+ if( initialValueProvider != null )
+ {
+ this.initialValueProvider = initialValueProvider;
+ }
+ else
+ {
+ this.initialValueProvider = new DefaultInitialValueProvider(useDefaults, initialValue);
+ }
this.constraints = constraints;
-
final Queryable queryable = accessor.getAnnotation( Queryable.class );
this.queryable = queryable == null || queryable.value();
}
@@ -169,53 +171,18 @@ public class PropertyModel
}
@Override
- public Object initialValue( ModuleDescriptor module )
+ public InitialValueProvider initialValueProvider()
{
- // Use supplied value from assembly
- Object value = initialValue;
+ return initialValueProvider;
+ }
- // Check for @UseDefaults annotation
- if( useDefaults )
- {
- if( value == null || ( ( value instanceof String ) && ( (String) value ).length() == 0 ) )
- {
- if( valueType instanceof ValueCompositeType )
- {
- Class<?> propertyType = valueType().types().findFirst().orElse( null );
- value = module.instance().newValue( propertyType );
- }
- else
- {
- value = DefaultValues.getDefaultValueOf( type );
- }
- }
- else
- {
- Class<?> propertyType = valueType().types().findFirst().orElse( null );
- if( value instanceof String && !propertyType.equals( String.class ) )
- {
- try
- {
- // here we could possibly deserialize json to other types...
- ValueDeserializer deserializer = module.instance()
- .serviceFinder()
- .findService( ValueDeserializer.class )
- .get();
- if( deserializer != null )
- {
- value = deserializer.deserialize( module, propertyType ).apply( (String) value );
- }
- }
- catch( NoSuchServiceException e )
- {
- throw new MissingValueSerializationException( "@UseDefaults with initialization value requires that there is a visible ValueDeserializer service available.", e);
- }
- }
- }
- }
- return value;
+ @Override
+ public Object resolveInitialValue(ModuleDescriptor moduleDescriptor)
+ {
+ return initialValueProvider.apply(moduleDescriptor.instance(), this);
}
+
@Override
public void bind( Resolution resolution )
throws BindingException
@@ -335,4 +302,80 @@ public class PropertyModel
}
}
}
+
+ private static class NullInitialValueProvider
+ implements InitialValueProvider
+ {
+ @Override
+ public Object apply(Module module, PropertyDescriptor property)
+ {
+ return null;
+ }
+ }
+
+ private class DefaultInitialValueProvider
+ implements InitialValueProvider
+ {
+ private final boolean useDefaults;
+ private final Object initialValue;
+
+ private DefaultInitialValueProvider(boolean useDefaults, Object initialValue)
+ {
+ this.useDefaults = useDefaults;
+ this.initialValue = initialValue;
+ }
+
+ @Override
+ public Object apply(Module module, PropertyDescriptor property)
+ {
+ return initialValue(module.descriptor(), initialValue, useDefaults);
+ }
+
+ private Object initialValue( ModuleDescriptor module, Object initialValue, boolean useDefaults )
+ {
+ // Use supplied value from assembly
+ Object value = initialValue;
+
+ // Check for @UseDefaults annotation
+ if( useDefaults )
+ {
+ if( value == null || ( ( value instanceof String ) && ( (String) value ).length() == 0 ) )
+ {
+ if( valueType instanceof ValueCompositeType )
+ {
+ Class<?> propertyType = valueType().types().findFirst().orElse( null );
+ value = module.instance().newValue( propertyType );
+ }
+ else
+ {
+ value = DefaultValues.getDefaultValueOf( type );
+ }
+ }
+ else
+ {
+ Class<?> propertyType = valueType().types().findFirst().orElse( null );
+ if( value instanceof String && !propertyType.equals( String.class ) )
+ {
+ try
+ {
+ // here we could possibly deserialize json to other types...
+ ValueDeserializer deserializer = module.instance()
+ .serviceFinder()
+ .findService( ValueDeserializer.class )
+ .get();
+ if( deserializer != null )
+ {
+ value = deserializer.deserialize( module, propertyType ).apply( (String) value );
+ }
+ }
+ catch( NoSuchServiceException e )
+ {
+ throw new MissingValueSerializationException( "@UseDefaults with initialization value requires that there is a visible ValueDeserializer service available.", e);
+ }
+ }
+ }
+ }
+ return value;
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
index cf13122..697d12c 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
@@ -156,23 +156,22 @@ public final class ImportedServiceReferenceInstance<T>
{
if( serviceInstance == null )
{
- serviceInstance = serviceModel.importInstance( module );
- instance = serviceInstance.instance();
-
+ ImportedServiceInstance<T> newServiceInstance = serviceModel.importInstance( module );
try
{
activation.activate(
serviceModel.newActivatorsInstance( module ),
- serviceInstance, () -> {
+ newServiceInstance, () -> {
active = true;
}
);
}
catch( Exception e )
{
- serviceInstance = null;
throw new ServiceUnavailableException( "Could not activate service " + serviceModel.identity(), e );
}
+ serviceInstance = newServiceInstance;
+ instance = newServiceInstance.instance();
}
}
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceInstance.java
index da40e1f..cae9e4b 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceInstance.java
@@ -35,8 +35,7 @@ import org.apache.polygene.runtime.composite.TransientStateInstance;
/**
* JAVADOC
*/
-public class ServiceInstance
- extends TransientInstance
+public class ServiceInstance extends TransientInstance
implements Activation
{
public static TransientInstance serviceInstanceOf( ServiceComposite composite )
@@ -54,8 +53,7 @@ public class ServiceInstance
{
super( compositeModel, mixins, state );
- implementsServiceAvailable =
- Classes.assignableTypeSpecification( Availability.class ).test( descriptor() );
+ implementsServiceAvailable = Classes.assignableTypeSpecification( Availability.class ).test( descriptor() );
hasEnabledConfiguration = compositeModel.configurationType() != null
&& Enabled.class.isAssignableFrom( compositeModel.configurationType() );
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceModel.java
index abbe40b..74dd852 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceModel.java
@@ -134,7 +134,7 @@ public final class ServiceModel extends CompositeModel
Map<AccessibleObject, Property<?>> properties = new HashMap<>();
stateModel.properties().forEach( propertyModel -> {
- Object initialValue = propertyModel.initialValue( module );
+ Object initialValue = propertyModel.resolveInitialValue(module);
if( propertyModel.accessor().equals( HasIdentity.IDENTITY_METHOD ) )
{
initialValue = identity;
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceReferenceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceReferenceInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceReferenceInstance.java
index e6e53bd..8cf7a1c 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceReferenceInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServiceReferenceInstance.java
@@ -149,19 +149,19 @@ public final class ServiceReferenceInstance<T>
{
if( instance == null )
{
- instance = serviceModel.newInstance( module );
+ ServiceInstance newInstance = serviceModel.newInstance( module );
try
{
activation.activate( serviceModel.newActivatorsInstance( module ),
- instance,
+ newInstance,
() -> active = true );
}
catch( Exception e )
{
- instance = null;
throw new ServiceUnavailableException( "Could not activate service " + serviceModel.identity(), e );
}
+ instance = newInstance;
}
}
}
@@ -262,16 +262,7 @@ public final class ServiceReferenceInstance<T>
return serviceModel.toString().hashCode();
}
}
-
ServiceInstance instance = getInstance();
-
-/*
- if (!instance.isAvailable())
- {
- throw new ServiceUnavailableException("Service is currently not available");
- }
-
-*/
return instance.invoke( object, method, objects );
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
index 4eb9ac1..3735130 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
@@ -216,8 +216,9 @@ public class ModuleInstance
model.state().properties().forEach(
propertyModel ->
{
+ Object initialValue = propertyModel.resolveInitialValue( model.module() );
Property<?> property = new PropertyInstance<>( ( (PropertyModel) propertyModel ).getBuilderInfo(),
- propertyModel.initialValue( model.module() ) );
+ initialValue );
properties.put( propertyModel.accessor(), property );
} );
@@ -296,7 +297,7 @@ public class ModuleInstance
@Override
public Object getPropertyState( PropertyDescriptor propertyDescriptor )
{
- return propertyDescriptor.initialValue( module );
+ return propertyDescriptor.resolveInitialValue(module);
}
@Override
@@ -468,18 +469,21 @@ public class ModuleInstance
public EntityStore entityStore()
{
- synchronized( this )
+ if( store == null )
{
- if( store == null )
+ synchronized( this )
{
- try
+ if( store == null )
{
- ServiceReference<EntityStore> service = findService( EntityStore.class );
- store = service.get();
- }
- catch( NoSuchServiceException e )
- {
- throw new UnitOfWorkException( "No EntityStore service available in module " + name() );
+ try
+ {
+ ServiceReference<EntityStore> service = findService( EntityStore.class );
+ store = service.get();
+ }
+ catch( NoSuchServiceException e )
+ {
+ throw new UnitOfWorkException( "No EntityStore service available in module " + name() );
+ }
}
}
}
@@ -488,18 +492,21 @@ public class ModuleInstance
public UnitOfWorkFactory unitOfWorkFactory()
{
- synchronized( this )
+ if( uowf == null )
{
- if( uowf == null )
+ synchronized( this )
{
- try
- {
- ServiceReference<UnitOfWorkFactory> service = findService( UnitOfWorkFactory.class );
- uowf = service.get();
- }
- catch( NoSuchServiceException e )
+ if( uowf == null )
{
- throw new UnitOfWorkException( "No UnitOfWorkFactory service available in module " + name() );
+ try
+ {
+ ServiceReference<UnitOfWorkFactory> service = findService( UnitOfWorkFactory.class );
+ uowf = service.get();
+ }
+ catch( NoSuchServiceException e )
+ {
+ throw new UnitOfWorkException( "No UnitOfWorkFactory service available in module " + name() );
+ }
}
}
}
@@ -532,31 +539,37 @@ public class ModuleInstance
public IdentityGenerator identityGenerator()
{
- synchronized( this )
+ if( generator == null )
{
- if( generator == null )
+ synchronized( this )
{
- ServiceReference<IdentityGenerator> service = findService( IdentityGenerator.class );
- generator = service.get();
+ if( generator == null )
+ {
+ ServiceReference<IdentityGenerator> service = findService( IdentityGenerator.class );
+ generator = service.get();
+ }
}
- return generator;
}
+ return generator;
}
public ValueSerialization valueSerialization()
{
- synchronized( this )
+ if( valueSerialization == null )
{
- if( valueSerialization == null )
+ synchronized( this )
{
- try
+ if( valueSerialization == null )
{
- ServiceReference<ValueSerialization> service = findService( ValueSerialization.class );
- valueSerialization = service.get();
- }
- catch( NoSuchServiceException e )
- {
- throw new ValueSerializationException( "No ValueSeriaservice available in module " + name() );
+ try
+ {
+ ServiceReference<ValueSerialization> service = findService( ValueSerialization.class );
+ valueSerialization = service.get();
+ }
+ catch( NoSuchServiceException e )
+ {
+ throw new ValueSerializationException( "No ValueSeriaservice available in module " + name() );
+ }
}
}
}
@@ -565,42 +578,24 @@ public class ModuleInstance
public MetricsProvider metricsProvider()
{
- synchronized( this )
+ if( metrics == null )
{
- if( metrics == null )
+ synchronized( this )
{
- try
+ if( metrics == null )
{
- ServiceReference<MetricsProvider> service = findService( MetricsProvider.class );
- metrics = service.get();
- }
- catch( NoSuchServiceException e )
- {
- metrics = new MetricsProviderAdapter();
+ try
+ {
+ ServiceReference<MetricsProvider> service = findService( MetricsProvider.class );
+ metrics = service.get();
+ }
+ catch( NoSuchServiceException e )
+ {
+ metrics = new MetricsProviderAdapter();
+ }
}
}
}
return metrics;
}
-
-// public Stream<ServiceReference<?>> visibleServices( Visibility visibility )
-// {
-// return concat( services.visibleServices( visibility ),
-// importedServices.visibleServices( visibility ) );
-// }
-//
-//
-//
-// public Stream<ServiceReference<?>> findVisibleServiceTypes()
-// {
-// return concat( visibleServices( Visibility.module ),
-// concat(
-// layer().visibleServices( Visibility.layer ),
-// concat(
-// layer().visibleServices( Visibility.application ),
-// layer().usedLayers().layers().flatMap( layer -> layer.visibleServices(Visibility.application) )
-// )
-// )
-// );
-// }
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueInstance.java
index 12ba7d9..573d659 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueInstance.java
@@ -39,10 +39,7 @@ public final class ValueInstance
return (ValueInstance) Proxy.getInvocationHandler( composite );
}
- public ValueInstance( ValueModel compositeModel,
- Object[] mixins,
- ValueStateInstance state
- )
+ public ValueInstance( ValueModel compositeModel, Object[] mixins, ValueStateInstance state )
{
super( compositeModel, mixins, state );
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/runtime/src/test/java/org/apache/polygene/api/common/PropertyTypeTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/api/common/PropertyTypeTest.java b/core/runtime/src/test/java/org/apache/polygene/api/common/PropertyTypeTest.java
index 4f33076..79349ae 100644
--- a/core/runtime/src/test/java/org/apache/polygene/api/common/PropertyTypeTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/api/common/PropertyTypeTest.java
@@ -22,6 +22,7 @@ package org.apache.polygene.api.common;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import org.apache.polygene.api.injection.scope.Invocation;
import org.apache.polygene.test.AbstractPolygeneTest;
import org.junit.Test;
import org.apache.polygene.api.composite.TransientBuilder;
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/core/testsupport/src/main/java/org/apache/polygene/test/entity/CanRemoveAll.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/entity/CanRemoveAll.java b/core/testsupport/src/main/java/org/apache/polygene/test/entity/CanRemoveAll.java
new file mode 100644
index 0000000..80b0a55
--- /dev/null
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/entity/CanRemoveAll.java
@@ -0,0 +1,7 @@
+package org.apache.polygene.test.entity;
+
+
+public interface CanRemoveAll
+{
+ void removeAll();
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/entitystore-preferences/src/main/java/org/apache/polygene/entitystore/prefs/PreferencesEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/main/java/org/apache/polygene/entitystore/prefs/PreferencesEntityStoreMixin.java b/extensions/entitystore-preferences/src/main/java/org/apache/polygene/entitystore/prefs/PreferencesEntityStoreMixin.java
index 72f4298..3198347 100644
--- a/extensions/entitystore-preferences/src/main/java/org/apache/polygene/entitystore/prefs/PreferencesEntityStoreMixin.java
+++ b/extensions/entitystore-preferences/src/main/java/org/apache/polygene/entitystore/prefs/PreferencesEntityStoreMixin.java
@@ -243,22 +243,22 @@ public class PreferencesEntityStoreMixin
if( primaryType.equals( Long.class ) )
{
properties.put( persistentPropertyDescriptor.qualifiedName(),
- this.getNumber( propsPrefs, persistentPropertyDescriptor, LONG_PARSER ) );
+ this.getNumber( propsPrefs, module, persistentPropertyDescriptor, LONG_PARSER ) );
}
else if( primaryType.equals( Integer.class ) )
{
properties.put( persistentPropertyDescriptor.qualifiedName(),
- this.getNumber( propsPrefs, persistentPropertyDescriptor, INT_PARSER ) );
+ this.getNumber( propsPrefs, module, persistentPropertyDescriptor, INT_PARSER ) );
}
else if( primaryType.equals( Double.class ) )
{
properties.put( persistentPropertyDescriptor.qualifiedName(),
- this.getNumber( propsPrefs, persistentPropertyDescriptor, DOUBLE_PARSER ) );
+ this.getNumber( propsPrefs, module, persistentPropertyDescriptor, DOUBLE_PARSER ) );
}
else if( primaryType.equals( Float.class ) )
{
properties.put( persistentPropertyDescriptor.qualifiedName(),
- this.getNumber( propsPrefs, persistentPropertyDescriptor, FLOAT_PARSER ) );
+ this.getNumber( propsPrefs, module, persistentPropertyDescriptor, FLOAT_PARSER ) );
}
else
{
@@ -279,7 +279,7 @@ public class PreferencesEntityStoreMixin
}
else if( primaryType.equals( Boolean.class ) )
{
- Boolean initialValue = (Boolean) persistentPropertyDescriptor.initialValue( module );
+ Boolean initialValue = (Boolean) persistentPropertyDescriptor.resolveInitialValue(module);
properties.put( persistentPropertyDescriptor.qualifiedName(),
propsPrefs.getBoolean( persistentPropertyDescriptor.qualifiedName().name(),
initialValue == null ? false : initialValue ) );
@@ -306,10 +306,10 @@ public class PreferencesEntityStoreMixin
String json = propsPrefs.get( persistentPropertyDescriptor.qualifiedName().name(), null );
if( json == null )
{
- if( persistentPropertyDescriptor.initialValue( module ) != null )
+ if( persistentPropertyDescriptor.resolveInitialValue( module ) != null )
{
- properties.put( persistentPropertyDescriptor.qualifiedName(), persistentPropertyDescriptor
- .initialValue( module ) );
+ properties.put( persistentPropertyDescriptor.qualifiedName(),
+ persistentPropertyDescriptor.resolveInitialValue( module ) );
}
else
{
@@ -640,9 +640,9 @@ public class PreferencesEntityStoreMixin
private static final NumberParser<Float> FLOAT_PARSER = Float::parseFloat;
- private <T> T getNumber( Preferences prefs, PropertyDescriptor pDesc, NumberParser<T> parser )
+ private <T> T getNumber( Preferences prefs, ModuleDescriptor module, PropertyDescriptor pDesc, NumberParser<T> parser )
{
- Object initialValue = pDesc.initialValue( null );
+ Object initialValue = pDesc.resolveInitialValue( module );
String str = prefs.get( pDesc.qualifiedName().name(), initialValue == null ? null : initialValue.toString() );
T result = null;
if( str != null )
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLEntityStoreMixin.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLEntityStoreMixin.java
index d3e3f3f..123a613 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLEntityStoreMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SQLEntityStoreMixin.java
@@ -389,7 +389,7 @@ public class SQLEntityStoreMixin
catch( JSONException e )
{
// Value not found, default it
- Object initialValue = propertyDescriptor.initialValue( module );
+ Object initialValue = propertyDescriptor.resolveInitialValue( module );
properties.put( propertyDescriptor.qualifiedName(), initialValue );
status[ 0 ] = EntityStatus.UPDATED;
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index b3c7621..6648590 100644
--- a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -29,6 +29,7 @@ import org.apache.polygene.api.common.QualifiedName;
import org.apache.polygene.api.common.Visibility;
import org.apache.polygene.api.entity.EntityDescriptor;
import org.apache.polygene.api.entity.EntityReference;
+import org.apache.polygene.api.identity.Identity;
import org.apache.polygene.api.property.PropertyDescriptor;
import org.apache.polygene.api.structure.ModuleDescriptor;
import org.apache.polygene.api.type.CollectionType;
@@ -81,6 +82,7 @@ class SQLCompatEntityStateWrapper
|| Character.class.isAssignableFrom( primaryType )
|| Enum.class.isAssignableFrom( primaryType )
|| String.class.isAssignableFrom( primaryType )
+ || Identity.class.isAssignableFrom( primaryType )
// || Date.class.isAssignableFrom( primaryType )
// || DateTime.class.isAssignableFrom( primaryType )
// || LocalDateTime.class.isAssignableFrom( primaryType )
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/migration/src/main/java/org/apache/polygene/migration/MigrationService.java
----------------------------------------------------------------------
diff --git a/extensions/migration/src/main/java/org/apache/polygene/migration/MigrationService.java b/extensions/migration/src/main/java/org/apache/polygene/migration/MigrationService.java
index 9f700d7..09b4663 100644
--- a/extensions/migration/src/main/java/org/apache/polygene/migration/MigrationService.java
+++ b/extensions/migration/src/main/java/org/apache/polygene/migration/MigrationService.java
@@ -94,8 +94,10 @@ public interface MigrationService
@Service
StateStore store;
+
@Service
EntityStore entityStore;
+
@Structure
UnitOfWorkFactory uowf;
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationBuilder.java
----------------------------------------------------------------------
diff --git a/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationBuilder.java b/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationBuilder.java
index e7d0c83..1b02746 100644
--- a/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationBuilder.java
+++ b/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationBuilder.java
@@ -25,15 +25,15 @@ package org.apache.polygene.migration.assembly;
*/
public class MigrationBuilder
{
- MigrationRules<EntityMigrationRule> entityRules;
- MigrationRules<MigrationRule> rules;
+ private MigrationRules<EntityMigrationRule> entityRules;
+ private MigrationRules<MigrationRule> rules;
- String fromVersion;
+ private String fromVersion;
public MigrationBuilder( String fromVersion )
{
- this.entityRules = new MigrationRules<EntityMigrationRule>();
- this.rules = new MigrationRules<MigrationRule>();
+ this.entityRules = new MigrationRules<>();
+ this.rules = new MigrationRules<>();
this.fromVersion = fromVersion;
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationRules.java
----------------------------------------------------------------------
diff --git a/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationRules.java b/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationRules.java
index f407cde..920e3de 100644
--- a/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationRules.java
+++ b/extensions/migration/src/main/java/org/apache/polygene/migration/assembly/MigrationRules.java
@@ -31,10 +31,10 @@ import org.apache.polygene.api.util.ListMap;
public class MigrationRules<T extends AbstractMigrationRule>
{
// to-version -> List of from-versions
- ListMap<String, String> versionChanges = new ListMap<String, String>();
+ private ListMap<String, String> versionChanges = new ListMap<>();
// key=fromversion->toversion value=list of rules for that transition
- ListMap<String, T> rules = new ListMap<String, T>();
+ private ListMap<String, T> rules = new ListMap<>();
public void addRule( T migrationRule )
{
@@ -70,7 +70,7 @@ public class MigrationRules<T extends AbstractMigrationRule>
if( fromVersion.equals( possibleFromVersion ) )
{
// We found the end of the version transitions - return rules, but filter on entity type
- return new ArrayList<T>( getRulesForTransition( fromVersion, toVersion ) );
+ return new ArrayList<>( getRulesForTransition( fromVersion, toVersion ) );
}
else
{
@@ -99,8 +99,8 @@ public class MigrationRules<T extends AbstractMigrationRule>
{
if( versionChanges.get( toVersion ) == null )
{
- List<String> toVersions = new ArrayList<String>( versionChanges.keySet() );
- Collections.sort( toVersions, Collections.reverseOrder() );
+ List<String> toVersions = new ArrayList<>(versionChanges.keySet());
+ toVersions.sort(Collections.reverseOrder());
for( String version : toVersions )
{
if( version.compareTo( toVersion ) <= 0 )
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/libraries/constraints/src/main/java/org/apache/polygene/library/constraints/NotEmptyStringConstraint.java
----------------------------------------------------------------------
diff --git a/libraries/constraints/src/main/java/org/apache/polygene/library/constraints/NotEmptyStringConstraint.java b/libraries/constraints/src/main/java/org/apache/polygene/library/constraints/NotEmptyStringConstraint.java
index dd1b9df..f00ef26 100644
--- a/libraries/constraints/src/main/java/org/apache/polygene/library/constraints/NotEmptyStringConstraint.java
+++ b/libraries/constraints/src/main/java/org/apache/polygene/library/constraints/NotEmptyStringConstraint.java
@@ -28,13 +28,9 @@ import org.apache.polygene.library.constraints.annotation.NotEmpty;
public class NotEmptyStringConstraint
implements Constraint<NotEmpty, String>
{
-
- private static final long serialVersionUID = 1L;
-
@Override
public boolean isValid( NotEmpty annotation, String value )
{
return value.trim().length() > 0;
}
-
}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/api/ContextResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/api/ContextResource.java b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/api/ContextResource.java
index d66a8a8..a50f29c 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/api/ContextResource.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/api/ContextResource.java
@@ -880,7 +880,7 @@ public class ContextResource
String value = getValue( propertyDescriptor.qualifiedName().name(), queryAsForm, entityAsForm );
if( value == null )
{
- Object initialValue = propertyDescriptor.initialValue( module.descriptor() );
+ Object initialValue = propertyDescriptor.resolveInitialValue(module.descriptor());
if( initialValue != null )
{
value = initialValue.toString();
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8e8ac22c/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/ValueDescriptorResponseWriter.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/ValueDescriptorResponseWriter.java b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/ValueDescriptorResponseWriter.java
index 5bf1d1b..7ff8a84 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/ValueDescriptorResponseWriter.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/ValueDescriptorResponseWriter.java
@@ -68,7 +68,7 @@ public class ValueDescriptorResponseWriter extends AbstractResponseWriter
vd.state().properties().forEach( propertyDescriptor -> {
try
{
- Object o = propertyDescriptor.initialValue( module );
+ Object o = propertyDescriptor.resolveInitialValue(module);
if( o == null )
{
json.put( propertyDescriptor.qualifiedName().name(), JSONObject.NULL );
[07/15] polygene-java git commit: POLYGENE-225 - Cassandra
entitystore implemented.
Posted by ni...@apache.org.
POLYGENE-225 - Cassandra entitystore implemented.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/c86b1154
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/c86b1154
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/c86b1154
Branch: refs/heads/develop
Commit: c86b1154e820d197516ace8da63d077d2f79f5b8
Parents: 96d03df
Author: niclas <ni...@spicter.com>
Authored: Tue Feb 14 12:44:48 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Tue Feb 14 12:44:48 2017 +0800
----------------------------------------------------------------------
dependencies.gradle | 3 +
extensions/entitystore-cassandra/build.gradle | 38 ++
extensions/entitystore-cassandra/dev-status.xml | 38 ++
.../entitystore/cassandra/CassandraCluster.java | 213 ++++++++++
.../CassandraEntityStoreConfiguration.java | 50 +++
.../cassandra/CassandraEntityStoreMixin.java | 425 +++++++++++++++++++
.../cassandra/CassandraEntityStoreService.java | 48 +++
.../cassandra/CassandraMigration.java | 28 ++
.../CassandraDBEntityStoreAssembler.java | 46 ++
.../polygene/entitystore/cassandra/package.html | 43 ++
.../cassandra/CassandraMapEntityStoreTest.java | 89 ++++
.../cassandra/EmptyCassandraTableMixin.java | 20 +
.../src/main/docker/cassandra/Dockerfile | 16 +
settings.gradle | 4 +-
tools/shell/build.gradle | 39 --
tools/shell/dev-status.xml | 38 --
.../create/project/NullProjectCreator.java | 37 --
17 files changed, 1059 insertions(+), 116 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/dependencies.gradle
----------------------------------------------------------------------
diff --git a/dependencies.gradle b/dependencies.gradle
index 6f6f0b9..4a00547 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -41,6 +41,7 @@ dependencies.libraries << [
// Extensions, Libraries and Tools dependencies
def bonecpVersion = '0.8.0.RELEASE'
def bouncyVersion = '1.55'
+def cassandraClientVersion = '3.1.3'
def codahaleMetricsVersion = '3.1.2'
def commonsDbcpVersion = '2.1.1'
def commonsLangVersion = '3.5'
@@ -77,6 +78,8 @@ def velocityVersion = '1.7'
dependencies.libraries << [
bonecp : "com.jolbox:bonecp:$bonecpVersion",
bouncy_castle : "org.bouncycastle:bcprov-jdk15on:$bouncyVersion",
+ cassandra_client : [ "com.datastax.cassandra:cassandra-driver-core:$cassandraClientVersion",
+ ],
codahale_metrics : [ "io.dropwizard.metrics:metrics-core:$codahaleMetricsVersion",
"io.dropwizard.metrics:metrics-healthchecks:$codahaleMetricsVersion" ],
commons_dbcp : "org.apache.commons:commons-dbcp2:$commonsDbcpVersion",
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/build.gradle b/extensions/entitystore-cassandra/build.gradle
new file mode 100644
index 0000000..2fb41a2
--- /dev/null
+++ b/extensions/entitystore-cassandra/build.gradle
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+apply plugin: 'polygene-extension'
+
+description = "Apache Polygene\u2122 Cassandra EntityStore Extension"
+
+jar { manifest { name = "Apache Polygene\u2122 Extension - EntityStore - Cassandra" } }
+
+dependencies {
+ compile polygene.core.bootstrap
+ compile polygene.library( 'locking' )
+ compile libraries.cassandra_client
+
+ runtime polygene.core.runtime
+
+ testCompile polygene.internals.testsupport
+ testCompile polygene.extension( 'valueserialization-orgjson' )
+
+ testRuntime libraries.logback
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/dev-status.xml
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/dev-status.xml b/extensions/entitystore-cassandra/dev-status.xml
new file mode 100644
index 0000000..fcc2930
--- /dev/null
+++ b/extensions/entitystore-cassandra/dev-status.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ ~
+ -->
+<module xmlns="http://polygene.apache.org/schemas/2008/dev-status/1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://polygene.apache.org/schemas/2008/dev-status/1
+ http://polygene.apache.org/schemas/2008/dev-status/1/dev-status.xsd">
+ <status>
+ <!--none,early,beta,stable,mature-->
+ <codebase>beta</codebase>
+
+ <!-- none, brief, good, complete -->
+ <documentation>none</documentation>
+
+ <!-- none, some, good, complete -->
+ <unittests>good</unittests>
+ </status>
+ <licenses>
+ <license>ALv2</license>
+ </licenses>
+</module>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraCluster.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraCluster.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraCluster.java
new file mode 100644
index 0000000..c5bcf72
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraCluster.java
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.KeyspaceMetadata;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.Session;
+import org.apache.polygene.api.configuration.Configuration;
+import org.apache.polygene.api.injection.scope.This;
+import org.apache.polygene.api.mixin.Mixins;
+import org.apache.polygene.api.service.ServiceActivation;
+
+@Mixins( CassandraCluster.Mixin.class )
+public interface CassandraCluster
+{
+ String CURRENT_STORAGE_VERSION = "1";
+ String DEFAULT_KEYSPACE_NAME = "polygene:entitystore";
+ String DEFAULT_TABLE_NAME = "polygene:entitystore:entities";
+ String IDENTITY_COLUMN = "_id";
+ String VERSION_COLUMN = "_version";
+ String USECASE_COLUMN = "_usecase";
+ String LASTMODIFIED_COLUMN = "_modified";
+ String APP_VERSION_COLUMN = "_appversion";
+ String STORE_VERSION_COLUMN = "_storeversion";
+ String TYPE_COLUMN = "_type";
+ String PROPERTIES_COLUMN = "_props";
+ String ASSOCIATIONS_COLUMN = "_assocs";
+ String MANYASSOCIATIONS_COLUMN = "_manyassocs";
+ String NAMEDASSOCIATIONS_COLUMN = "_namedassocs";
+
+ Session session();
+
+ String tableName();
+
+ PreparedStatement entityRetrieveStatement();
+ PreparedStatement versionRetrieveStatement();
+ PreparedStatement entityUpdateStatement();
+
+ String keyspaceName();
+
+ class Mixin
+ implements ServiceActivation, CassandraCluster
+ {
+ @This
+ private Configuration<CassandraEntityStoreConfiguration> configuration;
+
+ private Cluster cluster;
+ private Session session;
+ private String keyspaceName;
+ private PreparedStatement getEntityStatement;
+ private PreparedStatement updateEntityStatement;
+ private PreparedStatement getVersionStatement;
+
+ @Override
+ public Session session()
+ {
+ return session;
+ }
+
+ @Override
+ public PreparedStatement entityRetrieveStatement()
+ {
+ return getEntityStatement;
+ }
+
+ @Override
+ public PreparedStatement versionRetrieveStatement()
+ {
+ return getVersionStatement;
+ }
+
+ @Override
+ public PreparedStatement entityUpdateStatement()
+ {
+ return updateEntityStatement;
+ }
+
+ @Override
+ public String keyspaceName()
+ {
+ return keyspaceName;
+ }
+
+ public String tableName( )
+ {
+ CassandraEntityStoreConfiguration config = configuration.get();
+ String tableName = config.table().get();
+ if( tableName == null )
+ {
+ tableName = DEFAULT_TABLE_NAME;
+ }
+ return tableName;
+ }
+
+ @Override
+ public void activateService()
+ throws Exception
+ {
+ configuration.refresh();
+ CassandraEntityStoreConfiguration config = configuration.get();
+
+ String[] hostNames = config.hostnames().get().split( "," );
+ Cluster.Builder builder =
+ Cluster.builder()
+ .withClusterName( "myCluster" )
+ .addContactPoints( hostNames )
+ .withCredentials( config.username().get(), config.password().get() );
+ cluster = builder.build();
+ keyspaceName = config.keySpace().get();
+ if( keyspaceName == null )
+ {
+ keyspaceName = DEFAULT_KEYSPACE_NAME;
+ }
+ String tableName = tableName();
+ KeyspaceMetadata keyspace = cluster.getMetadata().getKeyspace( keyspaceName );
+ if( keyspace == null )
+ {
+ createKeyspace( keyspaceName, config.replicationFactor().get() );
+ session = cluster.connect( keyspaceName );
+ createPolygeneStateTable( tableName );
+ }
+ else
+ {
+ session = cluster.connect( keyspaceName );
+ }
+ session.init();
+
+ getEntityStatement = session.prepare( "SELECT "
+ + IDENTITY_COLUMN + ", "
+ + VERSION_COLUMN + ", "
+ + APP_VERSION_COLUMN + ", "
+ + STORE_VERSION_COLUMN + ", "
+ + LASTMODIFIED_COLUMN + ", "
+ + USECASE_COLUMN + ", "
+ + PROPERTIES_COLUMN + ", "
+ + ASSOCIATIONS_COLUMN + ", "
+ + MANYASSOCIATIONS_COLUMN + ", "
+ + NAMEDASSOCIATIONS_COLUMN
+ + " FROM " + tableName
+ + " WHERE "
+ + IDENTITY_COLUMN + " = ?" );
+
+ getVersionStatement = session.prepare( "SELECT "
+ + VERSION_COLUMN + ", "
+ + " FROM " + tableName
+ + " WHERE "
+ + IDENTITY_COLUMN + " = ?" );
+
+ updateEntityStatement = session.prepare( "INSERT INTO " + tableName + "( "
+ + IDENTITY_COLUMN + ", "
+ + VERSION_COLUMN + ", "
+ + APP_VERSION_COLUMN + ", "
+ + STORE_VERSION_COLUMN + ", "
+ + LASTMODIFIED_COLUMN + ", "
+ + USECASE_COLUMN + ", "
+ + PROPERTIES_COLUMN + ", "
+ + ASSOCIATIONS_COLUMN + ", "
+ + MANYASSOCIATIONS_COLUMN + ", "
+ + NAMEDASSOCIATIONS_COLUMN
+ + " ) VALUES (?,?,?," + CURRENT_STORAGE_VERSION + "?,?,?,?,?,?)" );
+ }
+
+ private void createPolygeneStateTable( String tableName )
+ {
+ session.execute( "CREATE TABLE " + tableName + "(\n"
+ + " " + IDENTITY_COLUMN + " text PRIMARYKEY,\n"
+ + " " + VERSION_COLUMN + " text,\n"
+ + " " + APP_VERSION_COLUMN + " text,\n"
+ + " " + STORE_VERSION_COLUMN + " text,\n"
+ + " " + LASTMODIFIED_COLUMN + " timestamp,\n"
+ + " " + USECASE_COLUMN + " text,\n"
+ + " " + PROPERTIES_COLUMN + " map,\n"
+ + " " + ASSOCIATIONS_COLUMN + " map,\n"
+ + " " + MANYASSOCIATIONS_COLUMN + " map,\n"
+ + " " + NAMEDASSOCIATIONS_COLUMN + " map,\n"
+ + " )" );
+ }
+
+ private void createKeyspace( String keyspaceName, int replication )
+ {
+ try( Session defaultSession = cluster.connect() )
+ {
+ String query = "CREATE KEYSPACE " + keyspaceName + "WITH replication = {'class':'SimpleStrategy', 'replication_factor' : " + replication + "};";
+ defaultSession.execute( query );
+ }
+ }
+
+ @Override
+ public void passivateService()
+ throws Exception
+ {
+ cluster.close();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreConfiguration.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreConfiguration.java
new file mode 100644
index 0000000..4a5e512
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreConfiguration.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import org.apache.polygene.api.common.Optional;
+import org.apache.polygene.api.common.UseDefaults;
+import org.apache.polygene.api.configuration.ConfigurationComposite;
+import org.apache.polygene.api.property.Property;
+
+// START SNIPPET: config
+public interface CassandraEntityStoreConfiguration
+ extends ConfigurationComposite
+{
+
+ @Optional
+ Property<String> hostnames();
+
+ @Optional
+ Property<Integer> replicationFactor();
+
+ @UseDefaults
+ Property<String> username();
+
+ @UseDefaults
+ Property<String> password();
+
+ @Optional
+ Property<String> keySpace();
+
+ @Optional
+ Property<String> table();
+}
+// END SNIPPET: config
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
new file mode 100644
index 0000000..159bc9c
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
@@ -0,0 +1,425 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.TypeTokens;
+import com.google.common.reflect.TypeToken;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.polygene.api.association.AssociationDescriptor;
+import org.apache.polygene.api.common.Optional;
+import org.apache.polygene.api.common.QualifiedName;
+import org.apache.polygene.api.entity.EntityDescriptor;
+import org.apache.polygene.api.entity.EntityReference;
+import org.apache.polygene.api.identity.HasIdentity;
+import org.apache.polygene.api.identity.Identity;
+import org.apache.polygene.api.identity.IdentityGenerator;
+import org.apache.polygene.api.identity.StringIdentity;
+import org.apache.polygene.api.injection.scope.Service;
+import org.apache.polygene.api.injection.scope.Structure;
+import org.apache.polygene.api.injection.scope.This;
+import org.apache.polygene.api.property.PropertyDescriptor;
+import org.apache.polygene.api.service.ServiceActivation;
+import org.apache.polygene.api.service.qualifier.Tagged;
+import org.apache.polygene.api.structure.Application;
+import org.apache.polygene.api.structure.ModuleDescriptor;
+import org.apache.polygene.api.unitofwork.NoSuchEntityTypeException;
+import org.apache.polygene.api.unitofwork.UnitOfWork;
+import org.apache.polygene.api.usecase.Usecase;
+import org.apache.polygene.api.value.ValueSerialization;
+import org.apache.polygene.spi.entity.EntityState;
+import org.apache.polygene.spi.entity.EntityStatus;
+import org.apache.polygene.spi.entity.ManyAssociationState;
+import org.apache.polygene.spi.entity.NamedAssociationState;
+import org.apache.polygene.spi.entitystore.DefaultEntityStoreUnitOfWork;
+import org.apache.polygene.spi.entitystore.EntityStore;
+import org.apache.polygene.spi.entitystore.EntityStoreSPI;
+import org.apache.polygene.spi.entitystore.EntityStoreUnitOfWork;
+import org.apache.polygene.spi.entitystore.StateCommitter;
+import org.apache.polygene.spi.entitystore.helpers.DefaultEntityState;
+
+import static java.util.stream.StreamSupport.stream;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.APP_VERSION_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.ASSOCIATIONS_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.IDENTITY_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.LASTMODIFIED_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.MANYASSOCIATIONS_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.NAMEDASSOCIATIONS_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.PROPERTIES_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.STORE_VERSION_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.TYPE_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.USECASE_COLUMN;
+import static org.apache.polygene.entitystore.cassandra.CassandraCluster.VERSION_COLUMN;
+
+/**
+ * MongoDB implementation of MapEntityStore.
+ */
+public class CassandraEntityStoreMixin
+ implements EntityStore, EntityStoreSPI
+{
+
+ @This
+ private CassandraCluster cluster;
+
+ @Structure
+ private Application application;
+
+ @Optional
+ @Service
+ private CassandraMigration migration;
+
+ @Service
+ @Tagged( ValueSerialization.Formats.JSON )
+ private ValueSerialization valueSerialization;
+
+
+ @Optional
+ @Service
+ private IdentityGenerator idGenerator;
+
+ @Override
+ public EntityState newEntityState( EntityStoreUnitOfWork unitOfWork, EntityReference reference, EntityDescriptor entityDescriptor )
+ {
+ return new DefaultEntityState( unitOfWork.currentTime(), reference, entityDescriptor );
+ }
+
+ @Override
+ public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, ModuleDescriptor module, EntityReference reference )
+ {
+ return queryFor( cluster.entityRetrieveStatement().bind( reference.toURI() ), module, reference );
+ }
+
+ private EntityState queryFor( BoundStatement statement, ModuleDescriptor module, EntityReference reference )
+ {
+ ResultSet result = cluster.session().execute( statement );
+ Row row = result.one();
+ return deserialize( row, module);
+ }
+
+ private EntityState deserialize( Row row, ModuleDescriptor module )
+ {
+ String version = row.getString( VERSION_COLUMN );
+ Instant lastModifed = row.getTimestamp( LASTMODIFIED_COLUMN ).toInstant();
+ EntityStatus[] status = new EntityStatus[ 1 ];
+ status[ 0 ] = EntityStatus.LOADED;
+
+ // Check if version is correct
+ String currentAppVersion = row.getString( APP_VERSION_COLUMN );
+ if( !currentAppVersion.equals( application.version() ) )
+ {
+ if( migration != null )
+ {
+ migration.migrate( row, application.version(), cluster.session() );
+ // State may have changed
+ status[ 0 ] = EntityStatus.UPDATED;
+ }
+// else
+// {
+ // Do nothing ?? Should we update to newer version? Probably not...
+// }
+ }
+ String type = row.getString( TYPE_COLUMN );
+
+ EntityDescriptor entityDescriptor = module.entityDescriptor( type );
+ if( entityDescriptor == null )
+ {
+ throw new NoSuchEntityTypeException( type, module.name(), module.typeLookup() );
+ }
+ Map<String, String> storedProperties = row.getMap( PROPERTIES_COLUMN, String.class, String.class );
+ Map<String, String> storedAssociations = row.getMap( ASSOCIATIONS_COLUMN, String.class, String.class );
+
+ TypeToken<String> stringToken = TypeToken.of( String.class );
+ TypeToken<List<String>> listOfStringsToken = TypeTokens.listOf( String.class );
+ TypeToken<Map<String, String>> mapOfStringsToken = TypeTokens.mapOf( String.class, String.class );
+ Map<String, List<String>> storedManyassociation = row.getMap( MANYASSOCIATIONS_COLUMN, stringToken, listOfStringsToken );
+ Map<String, Map<String, String>> storedNamedassociation = row.getMap( NAMEDASSOCIATIONS_COLUMN, stringToken, mapOfStringsToken );
+
+ Map<QualifiedName, Object> properties = new HashMap<>();
+ entityDescriptor
+ .state()
+ .properties()
+ .forEach(
+ propertyDescriptor ->
+ {
+ String storedValue;
+ try
+ {
+ storedValue = storedProperties.get( propertyDescriptor.qualifiedName().name() );
+ if( storedValue == null )
+ {
+ properties.put( propertyDescriptor.qualifiedName(), null );
+ }
+ else
+ {
+ Object deserialized = valueSerialization.deserialize( module, propertyDescriptor.valueType(), storedValue );
+ properties.put( propertyDescriptor.qualifiedName(), deserialized );
+ }
+ }
+ catch( RuntimeException e )
+ {
+ // Value not found, or value is corrupt, default it. Is this correct behavior?
+ Object initialValue = propertyDescriptor.resolveInitialValue( module );
+ properties.put( propertyDescriptor.qualifiedName(), initialValue );
+ status[ 0 ] = EntityStatus.UPDATED;
+ }
+ } );
+
+ Map<QualifiedName, EntityReference> associations = new HashMap<>();
+ entityDescriptor
+ .state()
+ .associations()
+ .forEach(
+ associationType ->
+ {
+ try
+ {
+ String storedValue = storedAssociations.get( associationType.qualifiedName().name() );
+ EntityReference value = storedValue == null
+ ? null
+ : EntityReference.parseEntityReference( storedValue );
+ associations.put( associationType.qualifiedName(), value );
+ }
+ catch( RuntimeException e )
+ {
+ // Association not found, default it to null
+ associations.put( associationType.qualifiedName(), null );
+ status[ 0 ] = EntityStatus.UPDATED;
+ }
+ } );
+
+ Map<QualifiedName, List<EntityReference>> manyAssociations = new HashMap<>();
+ entityDescriptor
+ .state()
+ .manyAssociations()
+ .forEach(
+ manyAssociationType ->
+ {
+ List<EntityReference> references = new ArrayList<>();
+ try
+ {
+ List<String> storedValue = storedManyassociation.get( manyAssociationType.qualifiedName().name() );
+ if( storedValue != null )
+ {
+ for( String value : storedValue )
+ {
+ EntityReference ref = value == null
+ ? null
+ : EntityReference.parseEntityReference( value );
+ references.add( ref );
+ }
+ manyAssociations.put( manyAssociationType.qualifiedName(), references );
+ }
+ }
+ catch( RuntimeException e )
+ {
+ // ManyAssociation not found, default to empty one
+ manyAssociations.put( manyAssociationType.qualifiedName(), references );
+ }
+ } );
+
+ Map<QualifiedName, Map<String, EntityReference>> namedAssociations = new HashMap<>();
+ entityDescriptor
+ .state()
+ .namedAssociations()
+ .forEach(
+ namedAssociationType ->
+ {
+ Map<String, EntityReference> references = new LinkedHashMap<>();
+ try
+ {
+ Map<String, String> storedValues = storedNamedassociation.get( namedAssociationType.qualifiedName().name() );
+ if( storedValues != null )
+ {
+ for( Map.Entry<String, String> entry : storedValues.entrySet() )
+ {
+ String name = entry.getKey();
+ String value = entry.getValue();
+ EntityReference ref = value == null
+ ? null
+ : EntityReference.parseEntityReference( value );
+ references.put( name, ref );
+ }
+ namedAssociations.put( namedAssociationType.qualifiedName(), references );
+ }
+ }
+ catch( RuntimeException e )
+ {
+ // NamedAssociation not found, default to empty one
+ namedAssociations.put( namedAssociationType.qualifiedName(), references );
+ }
+ } );
+
+ EntityReference reference = EntityReference.parseEntityReference( storedProperties.get( "identity" ) );
+ return new DefaultEntityState( version,
+ lastModifed,
+ reference,
+ status[ 0 ],
+ entityDescriptor,
+ properties,
+ associations,
+ manyAssociations,
+ namedAssociations
+ );
+ }
+
+ @Override
+ public String versionOf( EntityStoreUnitOfWork unitOfWork, EntityReference reference )
+ {
+ ResultSet result = cluster.session().execute( cluster.entityRetrieveStatement().bind( reference.toURI() ) );
+ Row row = result.one();
+ return row.getString( VERSION_COLUMN );
+ }
+
+ @Override
+ public StateCommitter applyChanges( EntityStoreUnitOfWork unitOfWork, Iterable<EntityState> state )
+ {
+ return new StateCommitter()
+ {
+ @Override
+ public void commit()
+ {
+
+ stream( state.spliterator(), false )
+ .filter( entity -> entity.status() == EntityStatus.UPDATED || entity.status() == EntityStatus.NEW )
+ .forEach(
+ entityState ->
+ {
+ Map<String, String> props = new HashMap<>();
+ Map<String, String> assocs = new HashMap<>();
+ Map<String, List<String>> many = new HashMap<>();
+ Map<String, Map<String, String>> named = new HashMap<>();
+ serializeProperties( entityState, props );
+ serializeAssociations( entityState, assocs );
+ serializeManyAssociations( entityState, many );
+ serializeNamedAssociations( entityState, named );
+ Identity identity = (Identity) entityState.propertyValueOf( HasIdentity.IDENTITY_STATE_NAME );
+ String ver = entityState.version();
+ String appVersion = application.version();
+ Date lastModified = new Date( entityState.lastModified().toEpochMilli() );
+ String usecase = unitOfWork.usecase().name();
+ BoundStatement statement = cluster.entityUpdateStatement().bind( identity.toString(), ver, appVersion, lastModified, usecase, props, assocs, many, named );
+ ResultSet result = cluster.session().execute( statement );
+ System.out.println( result );
+ } );
+ }
+
+ private void serializeProperties( EntityState entityState, Map<String, String> props )
+ {
+ Stream<? extends PropertyDescriptor> properties = entityState.entityDescriptor().state().properties();
+ properties.forEach(
+ descriptor ->
+ {
+ Object value = entityState.propertyValueOf( descriptor.qualifiedName() );
+ String serialized = valueSerialization.serialize( value );
+ props.put( descriptor.qualifiedName().name(), serialized );
+ } );
+ }
+
+ private void serializeAssociations( EntityState entityState, Map<String, String> assocs )
+ {
+ Stream<? extends AssociationDescriptor> associations = entityState.entityDescriptor().state().associations();
+ associations.forEach(
+ descriptor ->
+ {
+ EntityReference ref = entityState.associationValueOf( descriptor.qualifiedName() );
+ assocs.put( descriptor.qualifiedName().name(), ref.toString() );
+ } );
+ }
+
+ private void serializeManyAssociations( EntityState entityState, Map<String, List<String>> many )
+ {
+ Stream<? extends AssociationDescriptor> associations = entityState.entityDescriptor().state().associations();
+ associations.forEach(
+ descriptor ->
+ {
+ ManyAssociationState references = entityState.manyAssociationValueOf( descriptor.qualifiedName() );
+ List<String> refs = references.stream().map( EntityReference::toString ).collect( Collectors.toList() );
+ many.put( descriptor.qualifiedName().name(), refs );
+ } );
+ }
+
+ private void serializeNamedAssociations( EntityState entityState, Map<String, Map<String, String>> named )
+ {
+ Stream<? extends AssociationDescriptor> associations = entityState.entityDescriptor().state().associations();
+ associations.forEach(
+ descriptor ->
+ {
+ NamedAssociationState references = entityState.namedAssociationValueOf( descriptor.qualifiedName() );
+ Map<String, String> refs =
+ references.stream()
+ .collect(
+ Collectors.toMap( Map.Entry::getKey,
+ entry -> entry.getValue().toString() ) );
+ named.put( descriptor.qualifiedName().name(), refs );
+ } );
+ }
+
+ @Override
+ public void cancel()
+ {
+ }
+ };
+ }
+
+ @Override
+ public EntityStoreUnitOfWork newUnitOfWork( ModuleDescriptor module, Usecase usecase, Instant currentTime )
+ {
+ Identity newIdentity;
+ if( idGenerator == null )
+ {
+ newIdentity = new StringIdentity( UUID.randomUUID().toString() );
+ }
+ else
+ {
+ newIdentity= idGenerator.generate( UnitOfWork.class );
+ }
+ return new DefaultEntityStoreUnitOfWork( module, this, newIdentity, usecase, currentTime );
+ }
+
+ @Override
+ public Stream<EntityState> entityStates( ModuleDescriptor module )
+ {
+ ResultSet resultSet = cluster.session().execute( "SELECT "
+ + IDENTITY_COLUMN + ", "
+ + VERSION_COLUMN + ", "
+ + APP_VERSION_COLUMN + ", "
+ + STORE_VERSION_COLUMN + ", "
+ + LASTMODIFIED_COLUMN + ", "
+ + USECASE_COLUMN + ", "
+ + PROPERTIES_COLUMN + ", "
+ + ASSOCIATIONS_COLUMN + ", "
+ + MANYASSOCIATIONS_COLUMN + ", "
+ + NAMEDASSOCIATIONS_COLUMN
+ + " FROM " + cluster.tableName() );
+ return stream(resultSet.spliterator(), false).map( row -> deserialize( row, module ));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreService.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreService.java
new file mode 100644
index 0000000..e7531ce
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreService.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import org.apache.polygene.api.concern.Concerns;
+import org.apache.polygene.api.configuration.Configuration;
+import org.apache.polygene.api.mixin.Mixins;
+import org.apache.polygene.api.service.ServiceActivation;
+import org.apache.polygene.api.service.ServiceComposite;
+import org.apache.polygene.library.locking.LockingAbstractComposite;
+import org.apache.polygene.spi.entitystore.ConcurrentModificationCheckConcern;
+import org.apache.polygene.spi.entitystore.EntityStateVersions;
+import org.apache.polygene.spi.entitystore.EntityStore;
+import org.apache.polygene.spi.entitystore.StateChangeNotificationConcern;
+import org.apache.polygene.spi.entitystore.helpers.JSONMapEntityStoreActivation;
+import org.apache.polygene.spi.entitystore.helpers.JSONMapEntityStoreMixin;
+
+/**
+ * Cassandra EntityStore service.
+ */
+@Concerns( { StateChangeNotificationConcern.class, ConcurrentModificationCheckConcern.class } )
+@Mixins( { CassandraEntityStoreMixin.class } )
+public interface CassandraEntityStoreService
+ extends EntityStore,
+ EntityStateVersions,
+ ServiceComposite,
+ ServiceActivation,
+ LockingAbstractComposite,
+ Configuration
+{
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraMigration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraMigration.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraMigration.java
new file mode 100644
index 0000000..72b4060
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraMigration.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import com.datastax.driver.core.Row;
+import com.datastax.driver.core.Session;
+
+public interface CassandraMigration
+{
+ Row migrate( Row existingRow, String toVersion, Session session );
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/assembly/CassandraDBEntityStoreAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/assembly/CassandraDBEntityStoreAssembler.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/assembly/CassandraDBEntityStoreAssembler.java
new file mode 100644
index 0000000..15b3c60
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/assembly/CassandraDBEntityStoreAssembler.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra.assembly;
+
+import org.apache.polygene.bootstrap.Assemblers;
+import org.apache.polygene.bootstrap.AssemblyException;
+import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.bootstrap.ServiceDeclaration;
+import org.apache.polygene.entitystore.cassandra.CassandraEntityStoreConfiguration;
+import org.apache.polygene.entitystore.cassandra.CassandraEntityStoreService;
+
+public class CassandraDBEntityStoreAssembler
+ extends Assemblers.VisibilityIdentityConfig<CassandraDBEntityStoreAssembler>
+{
+ @Override
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ ServiceDeclaration service = module.services( CassandraEntityStoreService.class ).visibleIn( visibility() );
+ if( hasIdentity() )
+ {
+ service.identifiedBy( identity() );
+ }
+ if( hasConfig() )
+ {
+ configModule().entities( CassandraEntityStoreConfiguration.class ).visibleIn( configVisibility() );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/package.html
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/package.html b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/package.html
new file mode 100644
index 0000000..2a0077e
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/package.html
@@ -0,0 +1,43 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ ~
+ -->
+<html>
+<body>
+<h2>Casssandra EntityStore.</h2>
+ <p>
+ The Cassandra EntityStore leverages the CQL 'map' type, which is the "newer" way of doing variable-wdith rows.
+ </p>
+<p>
+ For properties, there is a map called '_props' with string key (the name of the property) and string value,
+ which is the serialized state of the property.
+</p>
+<p>
+ For associations, there is map called '_assocs' with string key (the name of the association) and string value,
+ which is the entity reference in toString() format.
+</p>
+<p>
+ For manyassociations, there is map called '_manyassocs' with string key (the name of the manyassociation) and
+ list of strings value, which is the list of entity references in toString() format.
+</p>
+<p>
+ For namedassociations, there is map called '_manyassocs' with string key (the name of the association) and
+ map of strings value, which is the name as the key and the value is the entity reference in toString() format.
+</p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraMapEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraMapEntityStoreTest.java b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraMapEntityStoreTest.java
new file mode 100644
index 0000000..3f5cc12
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraMapEntityStoreTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+package org.apache.polygene.entitystore.cassandra;
+
+import org.apache.polygene.entitystore.cassandra.assembly.CassandraDBEntityStoreAssembler;
+import org.apache.polygene.test.entity.CanRemoveAll;
+import org.junit.BeforeClass;
+import org.apache.polygene.api.common.Visibility;
+import org.apache.polygene.bootstrap.AssemblyException;
+import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.EntityTestAssembler;
+import org.apache.polygene.test.entity.AbstractEntityStoreTest;
+import org.apache.polygene.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
+
+import static org.apache.polygene.test.util.Assume.assumeConnectivity;
+
+/**
+ * Test the CassandraEntityStoreService.
+ * <p>Installing Cassandra and starting it should suffice as the test use Cassandra defaults: 127.0.0.1:3000</p>
+ */
+public class CassandraMapEntityStoreTest
+ extends AbstractEntityStoreTest
+{
+
+
+ @BeforeClass
+ public static void beforeCassandraEntityStoreTests()
+ {
+ assumeConnectivity( "localhost", 9042 );
+ }
+
+ @Override
+ // START SNIPPET: assembly
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ // END SNIPPET: assembly
+ super.assemble( module );
+
+ ModuleAssembly config = module.layer().module( "config" );
+ new EntityTestAssembler().assemble( config );
+ module.services( CassandraEntityStoreService.class ).withTypes( CanRemoveAll.class ).withMixins( EmptyCassandraTableMixin.class );
+ new OrgJsonValueSerializationAssembler().assemble( module );
+
+ // START SNIPPET: assembly
+ new CassandraDBEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
+ // END SNIPPET: assembly
+
+ CassandraEntityStoreConfiguration cassandraConfig = config.forMixin( CassandraEntityStoreConfiguration.class ).declareDefaults();
+ cassandraConfig.keySpace().set( "polygene:test" );
+ cassandraConfig.table().set( "polygene:test:entities" );
+ cassandraConfig.replicationFactor().set( 1 );
+ // START SNIPPET: assembly
+ }
+ // END SNIPPET: assembly
+
+ @Override
+ public void setUp()
+ throws Exception
+ {
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown()
+ throws Exception
+ {
+ CanRemoveAll cleaner = serviceFinder.findService( CanRemoveAll.class ).get();
+ cleaner.removeAll();
+ super.tearDown();
+ }
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/EmptyCassandraTableMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/EmptyCassandraTableMixin.java b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/EmptyCassandraTableMixin.java
new file mode 100644
index 0000000..a620d32
--- /dev/null
+++ b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/EmptyCassandraTableMixin.java
@@ -0,0 +1,20 @@
+package org.apache.polygene.entitystore.cassandra;
+
+import com.datastax.driver.core.querybuilder.Delete;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import org.apache.polygene.api.injection.scope.This;
+import org.apache.polygene.test.entity.CanRemoveAll;
+
+public class EmptyCassandraTableMixin
+ implements CanRemoveAll
+{
+ @This
+ private CassandraCluster cluster;
+
+ @Override
+ public void removeAll()
+ {
+ Delete delete = QueryBuilder.delete().from(cluster.keyspaceName(), cluster.tableName());
+ cluster.session().execute( delete );
+ }
+}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/internals/testsupport-internal/src/main/docker/cassandra/Dockerfile
----------------------------------------------------------------------
diff --git a/internals/testsupport-internal/src/main/docker/cassandra/Dockerfile b/internals/testsupport-internal/src/main/docker/cassandra/Dockerfile
new file mode 100644
index 0000000..e382cc1
--- /dev/null
+++ b/internals/testsupport-internal/src/main/docker/cassandra/Dockerfile
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM cassandra:3.9
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 6858c4c..67ec7c4 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -57,13 +57,14 @@ include 'core:api',
'libraries:uowfile',
'extensions:cache-ehcache',
'extensions:cache-memcache',
- 'extensions:entitystore-memory',
+ 'extensions:entitystore-cassandra',
'extensions:entitystore-file',
'extensions:entitystore-geode',
'extensions:entitystore-hazelcast',
'extensions:entitystore-jclouds',
'extensions:entitystore-jdbm',
'extensions:entitystore-leveldb',
+ 'extensions:entitystore-memory',
'extensions:entitystore-mongodb',
'extensions:entitystore-preferences',
'extensions:entitystore-redis',
@@ -81,7 +82,6 @@ include 'core:api',
'extensions:valueserialization-stax',
'tools:model-detail',
'tools:envisage',
- 'tools:shell',
// 'tools:qidea',
'tests:regression',
'tests:performance',
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/tools/shell/build.gradle
----------------------------------------------------------------------
diff --git a/tools/shell/build.gradle b/tools/shell/build.gradle
deleted file mode 100644
index 1ec559f..0000000
--- a/tools/shell/build.gradle
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-apply plugin: 'polygene-tool'
-apply plugin: 'application'
-
-description = "Command line tools for building Apache Polygene\u2122 applications."
-mainClassName = "org.apache.polygene.tools.shell.Main"
-
-jar {
- manifest {
- name = "Apache Polygene\u2122 Command Line"
- attributes("Main-Class": mainClassName )
- }
-}
-
-[ distZip, distTar ].each { dist -> dist.classifier = 'bin' }
-distTar.compression = Compression.GZIP
-
-dependencies {
- testRuntime libraries.logback
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/tools/shell/dev-status.xml
----------------------------------------------------------------------
diff --git a/tools/shell/dev-status.xml b/tools/shell/dev-status.xml
deleted file mode 100644
index 01d0c15..0000000
--- a/tools/shell/dev-status.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-<module xmlns="http://polygene.apache.org/schemas/2008/dev-status/1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://polygene.apache.org/schemas/2008/dev-status/1
- http://polygene.apache.org/schemas/2008/dev-status/1/dev-status.xsd">
- <status>
- <!--none,early,beta,stable,mature-->
- <codebase>beta</codebase>
-
- <!-- none, brief, good, complete -->
- <documentation>brief</documentation>
-
- <!-- none, some, good, complete -->
- <unittests>good</unittests>
- </status>
- <licenses>
- <license>ALv2</license>
- </licenses>
-</module>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c86b1154/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/NullProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/NullProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/NullProjectCreator.java
deleted file mode 100644
index 8018dc6..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/NullProjectCreator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-public class NullProjectCreator extends AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName, File projectDir, Map<String, String> properties )
- throws IOException
- {
- super.create( projectName, projectDir, properties ); // creates the directory structures.
- }
-}
[14/15] polygene-java git commit: Yeoman generator doc inclusion
Posted by ni...@apache.org.
Yeoman generator doc inclusion
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/7410895a
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/7410895a
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/7410895a
Branch: refs/heads/develop
Commit: 7410895a371dee7f05896fd37828ff183a640bd8
Parents: 75b3668
Author: niclas <ni...@spicter.com>
Authored: Tue Feb 14 12:49:31 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Tue Feb 14 12:49:31 2017 +0800
----------------------------------------------------------------------
manual/src/docs/userguide/tools.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/7410895a/manual/src/docs/userguide/tools.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/userguide/tools.txt b/manual/src/docs/userguide/tools.txt
index 4d94a49..9da85a3 100644
--- a/manual/src/docs/userguide/tools.txt
+++ b/manual/src/docs/userguide/tools.txt
@@ -32,7 +32,7 @@ The tools are available in the +tools/+ directory of the Polygene\u2122 SDK.
:leveloffset: 2
-include::../../../../tools/shell/src/docs/shell.txt[]
+include::../../../../tools/src/docs/yeoman_polygene.txt[]
:leveloffset: 2
[10/15] polygene-java git commit: Removed the previous shell system,
as the Yeoman one seems more promising.
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/Main.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/Main.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/Main.java
deleted file mode 100644
index 5054b79..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/Main.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.TreeMap;
-import org.apache.polygene.tools.shell.create.CreateProject;
-import org.apache.polygene.tools.shell.help.HelpCommand;
-
-public class Main
-{
- private Map<String, Command> commands = new TreeMap<>();
-
- public static void main( String[] args )
- {
- new Main().run( args );
- }
-
- private Main()
- {
- HelpCommand helpCommand = new HelpCommand();
- addCommand( helpCommand );
- addCommand( new CreateProject() );
- helpCommand.setCommands( commands.values() );
- }
-
- private void addCommand( Command command )
- {
- commands.put( command.name(), command );
- }
-
- private void run( String[] args )
- {
- if( !contains( args, "-q" ) )
- {
- System.out.println( "\n\nPolygene - Classes are Dead. Long Live Interfaces!" );
- System.out.println( "----------------------------------------------\n" );
- }
- if( args.length == 0 )
- {
- commands.get( "help" ).execute( args, input(), error() );
- }
- else
- {
- try
- {
- executeCommand( args );
- }
- catch( HelpNeededException e )
- {
- commands.get( "help" ).execute( args, input(), error() );
- }
- }
- }
-
- private void executeCommand( String[] args )
- {
- Command command = commands.get( args[ 0 ] );
- if( command == null )
- {
- System.err.println( "Command " + args[ 0 ] + " is unknown." );
- System.err.println( "" );
- commands.get( "help" ).execute( args, input(), error() );
- }
- else
- {
- command.execute( args, input(), output() );
- }
- }
-
- private boolean contains( String[] args, String s )
- {
- for( String arg : args )
- {
- if( s.equals( arg ) )
- {
- return true;
- }
- }
- return false;
- }
-
- private PrintWriter error()
- {
- return new PrintWriter( System.err );
- }
-
- private PrintWriter output()
- {
- return new PrintWriter( System.out );
- }
-
- private BufferedReader input()
- {
- return new BufferedReader( new InputStreamReader( System.in ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/CreateProject.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/CreateProject.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/CreateProject.java
deleted file mode 100644
index 57b186c..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/CreateProject.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell.create;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.AbstractCommand;
-import org.apache.polygene.tools.shell.FileUtils;
-import org.apache.polygene.tools.shell.HelpNeededException;
-import org.apache.polygene.tools.shell.create.project.ProjectCreator;
-
-public class CreateProject extends AbstractCommand
-{
-
- @Override
- public void execute( String[] args, BufferedReader input, PrintWriter output )
- throws HelpNeededException
- {
- if( args.length != 4 )
- {
- throw new HelpNeededException();
- }
- String template = args[ 1 ];
- String projectName = args[ 2 ];
- String rootPackage = args[ 3 ];
- File projectDir = FileUtils.createDir( projectName );
- Map<String, String> props = FileUtils.readTemplateProperties( template );
- if( props == null )
- {
- System.err.println( "Project Template " + template + " does not exist. \n\n" );
- throw new HelpNeededException();
- }
- props.put( "project.dir", projectDir.getAbsolutePath() );
- props.put( "project.name", projectName);
- props.put( "template", template);
- props.put( "root.package", rootPackage);
- String classname = props.get( "creator.class" );
- try
- {
- ProjectCreator creator = (ProjectCreator) Class.forName( classname ).newInstance();
- creator.create( args[ 0 ], projectDir, props );
- }
- catch( Exception e )
- {
- e.printStackTrace();
- throw new RuntimeException( "Unable to create the Project Creator." );
- }
- }
-
- @Override
- public String description()
- {
- return "type name package\tCreates a new skeletal project in directory [name].";
- }
-
- @Override
- public String name()
- {
- return "create-project";
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/AbstractProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/AbstractProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/AbstractProjectCreator.java
deleted file mode 100644
index 66f7c40..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/AbstractProjectCreator.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.PosixFilePermissions;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-abstract class AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName,
- File projectDir,
- Map<String, String> properties
- )
- throws IOException
- {
- File templateDir = new File( FileUtils.polygeneHome(), properties.get( "template.dir" ) );
- copyFiles( templateDir, projectDir, properties.get( "root.package" ) );
- File gradlewFile = new File( projectDir, "gradlew" );
- Path gradlewPath = gradlewFile.toPath();
- setGradlewPermissions( gradlewFile, gradlewPath );
- }
-
- private void copyFiles( File fromDir, File toDir, String rootpackage )
- throws IOException
- {
- File[] files = fromDir.listFiles();
- if( files == null )
- {
- return;
- }
- Files.createDirectories( toDir.toPath() );
- for( File f : files )
- {
- String filename = f.getName();
- if( f.isDirectory() )
- {
- if( filename.equals( "__package__" ) )
- {
- toDir = new File( toDir, rootpackage.replaceAll( "\\.", "/" ) );
- copyFiles( f, toDir, rootpackage );
- }
- else
- {
- copyFiles( f, new File( toDir, filename ), rootpackage );
- }
- }
- if( f.isFile() )
- {
- if( !filename.equals( "___placeholder___" ) ) // skip these files that are needed for GIT.
- {
- if( filename.endsWith( "_" ) )
- {
- filename = filename.substring( 0, filename.length() - 1 );
- }
- File dest = new File( toDir, filename );
- FileUtils.copyFile( f, dest );
- }
- }
- }
- }
-
- private void setGradlewPermissions( File gradlewFile, Path gradlewPath )
- throws IOException
- {
- try
- {
- if( gradlewFile.exists() )
- {
- Files.setPosixFilePermissions( gradlewPath, PosixFilePermissions.fromString( "rwxr-xr-x" ) );
- }
- }
- catch( Exception e )
- {
- if( !System.getProperty( "os.name" ).contains( "Windows" ) )
- {
- throw new IOException( "Unable to set file permissions on " + gradlewPath.toString(), e );
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreator.java
deleted file mode 100644
index f5ca030..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import org.apache.polygene.tools.shell.create.project.common.ApplicationAssemblerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConnectivityLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.CrudModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.CustomerWriter;
-import org.apache.polygene.tools.shell.create.project.common.DomainLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.FileConfigurationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.HardCodedSecurityRepositoryMixinWriter;
-import org.apache.polygene.tools.shell.create.project.common.IndexingModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.InfrastructureLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.OrderItemWriter;
-import org.apache.polygene.tools.shell.create.project.common.OrderModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.OrderWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityRepositoryWriter;
-import org.apache.polygene.tools.shell.create.project.common.SerializationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.StorageModuleWriter;
-import org.apache.polygene.tools.shell.create.project.defaultp.ApplicationWriter;
-import org.apache.polygene.tools.shell.create.project.defaultp.SettingsWriter;
-
-public class DefaultProjectCreator extends AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName, File projectDir, Map<String, String> properties )
- throws IOException
- {
- super.create( projectName, projectDir, properties ); // creates the directory structures.
- new ApplicationAssemblerWriter().writeClass( properties );
- new ApplicationWriter().writeClass( properties );
- new ConfigLayerWriter().writeClass( properties );
- new ConfigModuleWriter().writeClass( properties );
- new InfrastructureLayerWriter().writeClass( properties );
- new FileConfigurationModuleWriter().writeClass( properties );
- new StorageModuleWriter().writeClass( properties );
- new IndexingModuleWriter().writeClass( properties );
- new SerializationModuleWriter().writeClass( properties );
- new DomainLayerWriter().writeClass( properties );
- new OrderModuleWriter().writeClass( properties );
- new CrudModuleWriter().writeClass( properties );
- new ConnectivityLayerWriter().writeClass( properties );
-
- new SecurityModuleWriter().writeClass( properties );
- new SecurityRepositoryWriter().writeClass( properties );
- new HardCodedSecurityRepositoryMixinWriter().writeClass( properties );
- new OrderWriter().writeClass( properties );
- new OrderItemWriter().writeClass( properties );
- new CustomerWriter().writeClass( properties );
-
- new SettingsWriter().writeClass( properties );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/HeroesProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/HeroesProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/HeroesProjectCreator.java
deleted file mode 100644
index b7ca22e..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/HeroesProjectCreator.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import org.apache.polygene.tools.shell.create.project.common.ApplicationAssemblerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConnectivityLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.CrudModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.DomainLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.FileConfigurationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.HardCodedSecurityRepositoryMixinWriter;
-import org.apache.polygene.tools.shell.create.project.common.IndexingModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.InfrastructureLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityRepositoryWriter;
-import org.apache.polygene.tools.shell.create.project.common.SerializationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.StorageModuleWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.ApplicationWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.IndexHtmlWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.RestModuleWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SettingsWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SimpleEnrolerWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SimpleVerifierWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.WebXmlWriter;
-
-public class HeroesProjectCreator extends AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName, File projectDir, Map<String, String> properties )
- throws IOException
- {
- super.create( projectName, projectDir, properties ); // creates the directory structures.
- new ApplicationAssemblerWriter().writeClass( properties );
- new ConfigLayerWriter().writeClass( properties );
- new ConfigModuleWriter().writeClass( properties );
- new InfrastructureLayerWriter().writeClass( properties );
- new FileConfigurationModuleWriter().writeClass( properties );
- new StorageModuleWriter().writeClass( properties );
- new IndexingModuleWriter().writeClass( properties );
- new SerializationModuleWriter().writeClass( properties );
- new DomainLayerWriter().writeClass( properties );
- new CrudModuleWriter().writeClass( properties );
- new ConnectivityLayerWriter().writeClass( properties );
- new RestModuleWriter().writeClass( properties );
-
- new ApplicationWriter().writeClass( properties );
- new SimpleEnrolerWriter().writeClass( properties );
- new SimpleVerifierWriter().writeClass( properties );
-
- new SecurityModuleWriter().writeClass( properties );
- new SecurityRepositoryWriter().writeClass( properties );
- new HardCodedSecurityRepositoryMixinWriter().writeClass( properties );
-
- new SettingsWriter().writeClass( properties );
- new IndexHtmlWriter().writeClass( properties );
- new WebXmlWriter().writeClass( properties );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/ProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/ProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/ProjectCreator.java
deleted file mode 100644
index c4cee69..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/ProjectCreator.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-public interface ProjectCreator
-{
- void create( String projectName,
- File projectDir,
- Map<String, String> properties
- )
- throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/RestProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/RestProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/RestProjectCreator.java
deleted file mode 100644
index 78d3aef..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/RestProjectCreator.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import org.apache.polygene.tools.shell.create.project.common.ApplicationAssemblerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConfigModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.ConnectivityLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.CrudModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.CustomerWriter;
-import org.apache.polygene.tools.shell.create.project.common.DomainLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.FileConfigurationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.HardCodedSecurityRepositoryMixinWriter;
-import org.apache.polygene.tools.shell.create.project.common.IndexingModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.InfrastructureLayerWriter;
-import org.apache.polygene.tools.shell.create.project.common.OrderItemWriter;
-import org.apache.polygene.tools.shell.create.project.common.OrderWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.SecurityRepositoryWriter;
-import org.apache.polygene.tools.shell.create.project.common.SerializationModuleWriter;
-import org.apache.polygene.tools.shell.create.project.common.StorageModuleWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.ApplicationWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.IndexHtmlWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.OrderModuleWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.RestModuleWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SettingsWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SimpleEnrolerWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.SimpleVerifierWriter;
-import org.apache.polygene.tools.shell.create.project.restapp.WebXmlWriter;
-
-public class RestProjectCreator extends AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName, File projectDir, Map<String, String> properties )
- throws IOException
- {
- super.create( projectName, projectDir, properties ); // creates the directory structures.
- new ApplicationAssemblerWriter().writeClass( properties );
- new ConfigLayerWriter().writeClass( properties );
- new ConfigModuleWriter().writeClass( properties );
- new InfrastructureLayerWriter().writeClass( properties );
- new FileConfigurationModuleWriter().writeClass( properties );
- new StorageModuleWriter().writeClass( properties );
- new IndexingModuleWriter().writeClass( properties );
- new SerializationModuleWriter().writeClass( properties );
- new DomainLayerWriter().writeClass( properties );
- new CrudModuleWriter().writeClass( properties );
- new ConnectivityLayerWriter().writeClass( properties );
- new RestModuleWriter().writeClass( properties );
-
- new ApplicationWriter().writeClass( properties );
- new SimpleEnrolerWriter().writeClass( properties );
- new SimpleVerifierWriter().writeClass( properties );
-
- new SecurityModuleWriter().writeClass( properties );
- new SecurityRepositoryWriter().writeClass( properties );
- new HardCodedSecurityRepositoryMixinWriter().writeClass( properties );
- new OrderWriter().writeClass( properties );
- new OrderItemWriter().writeClass( properties );
- new CustomerWriter().writeClass( properties );
-
- new OrderModuleWriter().writeClass( properties );
- new SettingsWriter().writeClass( properties );
- new IndexHtmlWriter().writeClass( properties );
- new WebXmlWriter().writeClass( properties );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/SingletonProjectCreator.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/SingletonProjectCreator.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/SingletonProjectCreator.java
deleted file mode 100644
index a4815a7..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/SingletonProjectCreator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import org.apache.polygene.tools.shell.create.project.singleton.SettingsWriter;
-import org.apache.polygene.tools.shell.create.project.singleton.SingletonApplicationAssemblerWriter;
-
-public class SingletonProjectCreator extends AbstractProjectCreator
- implements ProjectCreator
-{
-
- @Override
- public void create( String projectName, File projectDir, Map<String, String> properties )
- throws IOException
- {
- super.create( projectName, projectDir, properties ); // creates the directory structures.
- new SingletonApplicationAssemblerWriter().writeClass( properties );
- new SettingsWriter().writeClass( properties );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
deleted file mode 100644
index d5ba78e..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ApplicationAssemblerWriter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class ApplicationAssemblerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap;" );
- pw.println();
- pw.println( "import java.io.IOException;" );
- pw.println( "import java.nio.file.Files;" );
- pw.println( "import java.nio.file.Path;" );
- pw.println( "import java.nio.file.Paths;" );
- pw.println();
- pw.println( "import org.apache.polygene.bootstrap.ApplicationAssembly;" );
- pw.println( "import org.apache.polygene.bootstrap.AssemblyException;" );
- pw.println( "import org.apache.polygene.bootstrap.LayerAssembly;" );
- pw.println( "import org.apache.polygene.bootstrap.ModuleAssembly;" );
- pw.println( "import org.apache.polygene.bootstrap.layered.LayeredApplicationAssembler;" );
- pw.println();
- pw.println( "import " + rootPackage + ".bootstrap.connectivity.ConnectivityLayer;" );
- pw.println( "import " + rootPackage + ".bootstrap.domain.DomainLayer;" );
- pw.println( "import " + rootPackage + ".bootstrap.config.ConfigurationLayer;" );
- pw.println( "import " + rootPackage + ".bootstrap.infrastructure.InfrastructureLayer;" );
- pw.println();
- pw.print( "public class " );
- pw.print( projectName );
- pw.println( "ApplicationAssembler extends LayeredApplicationAssembler" );
- pw.println( "{" );
- pw.print( " private static final String NAME = \"" );
- pw.print( projectName );
- pw.println( "\";" );
- pw.println( " private static final String VERSION = \"1.0.alpha\";" );
- pw.println();
- pw.print( " public " );
- pw.print( projectName );
- pw.println( "ApplicationAssembler( Application.Mode mode )" );
- pw.println( " throws AssemblyException" );
- pw.println( " {" );
- pw.println( " super( NAME, VERSION, mode );" );
- pw.println( " }" );
- pw.println();
- pw.println( " @Override" );
- pw.println( " protected void assembleLayers( ApplicationAssembly assembly )" );
- pw.println( " throws AssemblyException" );
- pw.println( " {" );
- pw.println( " LayerAssembly configLayer = createLayer( ConfigurationLayer.class );" );
- pw.println( " ModuleAssembly configModule = assemblerOf( ConfigurationLayer.class ).configModule();" );
- pw.println( " LayerAssembly domainLayer = createLayer( DomainLayer.class );" );
- pw.println( " LayerAssembly infraLayer = new InfrastructureLayer( configModule ).assemble( assembly.layer( InfrastructureLayer.NAME ) );" );
- pw.println( " LayerAssembly connectivityLayer = createLayer( ConnectivityLayer.class );" );
- pw.println( " connectivityLayer.uses( domainLayer );" );
- pw.println( " domainLayer.uses( infraLayer );" );
- pw.println( " infraLayer.uses( configLayer );" );
- pw.println( " }" );
- pw.println( "}" );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/";
- String classname = properties.get( "project.name" ) + "ApplicationAssembler";
-
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigLayerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigLayerWriter.java
deleted file mode 100644
index 09dc0f6..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigLayerWriter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class ConfigLayerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.config;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.LayerAssembler;\n" +
- "import org.apache.polygene.bootstrap.layered.LayeredLayerAssembler;\n" +
- "\n" +
- "public class ConfigurationLayer extends LayeredLayerAssembler\n" +
- " implements LayerAssembler\n" +
- "{\n" +
- " public static final String NAME = \"Configuration Layer\";\n" +
- " private ModuleAssembly configModule;\n" +
- "\n" +
- " @Override\n" +
- " public LayerAssembly assemble( LayerAssembly layer )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " configModule = createModule( layer, ConfigModule.class );\n" +
- " return layer;\n" +
- " }\n" +
- "\n" +
- " public ModuleAssembly configModule()\n" +
- " {\n" +
- " return configModule;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/config/";
- String classname = "ConfigurationLayer";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigModuleWriter.java
deleted file mode 100644
index 69a613a..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConfigModuleWriter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class ConfigModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.config;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.entitystore.memory.MemoryEntityStoreService;\n" +
- "import org.apache.polygene.valueserialization.jackson.JacksonValueSerializationAssembler;\n" +
- "\n" +
- "public class ConfigModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.services( MemoryEntityStoreService.class ).visibleIn( Visibility.layer );\n" +
- " new JacksonValueSerializationAssembler().visibleIn( Visibility.layer ).assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n");
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/config/";
- String classname = "ConfigModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConnectivityLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConnectivityLayerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConnectivityLayerWriter.java
deleted file mode 100644
index 40edec4..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/ConnectivityLayerWriter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class ConnectivityLayerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.connectivity;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.LayerAssembler;\n" +
- "import org.apache.polygene.bootstrap.layered.LayeredLayerAssembler;\n" +
- "\n" +
- "public class ConnectivityLayer extends LayeredLayerAssembler\n" +
- " implements LayerAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public LayerAssembly assemble( LayerAssembly layer )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " createModule( layer, RestModule.class );\n" +
- " return layer;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/connectivity/";
- String classname = "ConnectivityLayer";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CrudModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CrudModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CrudModuleWriter.java
deleted file mode 100644
index 15bf791..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CrudModuleWriter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class CrudModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.domain;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.library.restlet.assembly.CrudServiceAssembler;\n" +
- "\n" +
- "public class CrudModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " new CrudServiceAssembler().assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/domain/";
- String classname = "CrudModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CustomerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CustomerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CustomerWriter.java
deleted file mode 100644
index acf7f81..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/CustomerWriter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class CustomerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".model.orders;" );
- pw.println();
- pw.println("import java.time.ZonedDateTime;");
- pw.println("import org.apache.polygene.api.identity.HasIdentity;");
- pw.println("import org.apache.polygene.api.property.Property;");
- pw.println();
- pw.println(
- "public interface Customer extends HasIdentity\n" +
- "{\n" +
- " Property<String> name();\n\n" +
- " Property<String> address();\n\n" +
- " Property<String> city();\n\n" +
- " Property<String> country();\n\n" +
- " Property<String> phone();\n\n" +
- " Property<ZonedDateTime> registered();\n\n" +
- "}\n");
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/orders/";
- String classname = "Customer";
- return FileUtils.createJavaClassPrintWriter( properties, "model", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
deleted file mode 100644
index dd8a684..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/DomainLayerWriter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class DomainLayerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.domain;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.LayerAssembler;\n" +
- "import org.apache.polygene.bootstrap.layered.LayeredLayerAssembler;\n" +
- "\n" +
- "public class DomainLayer extends LayeredLayerAssembler\n" +
- " implements LayerAssembler\n" +
- "{\n" +
- " @Override\n" +
- " public LayerAssembly assemble(LayerAssembly layer)\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " createModule( layer, CrudModule.class );\n" +
- " createModule( layer, OrderModule.class ); // This is a simple sample that you typically remove.\n" +
- " createModule( layer, SecurityModule.class ); // This is a simple sample that you typically remove.\n" +
- " return layer;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/domain/";
- String classname = "DomainLayer";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/FileConfigurationModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/FileConfigurationModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/FileConfigurationModuleWriter.java
deleted file mode 100644
index c4bdacb..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/FileConfigurationModuleWriter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class FileConfigurationModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.infrastructure;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.library.fileconfig.FileConfigurationAssembler;\n" +
- "\n" +
- "public class FileConfigurationModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " new FileConfigurationAssembler().visibleIn( Visibility.layer ).assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/infrastructure/";
- String classname = "FileConfigurationModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/HardCodedSecurityRepositoryMixinWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/HardCodedSecurityRepositoryMixinWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/HardCodedSecurityRepositoryMixinWriter.java
deleted file mode 100644
index 987ff2f..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/HardCodedSecurityRepositoryMixinWriter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class HardCodedSecurityRepositoryMixinWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".model.security;" );
- pw.println();
- pw.println(
- "import java.util.Collections;\n" +
- "import java.util.List;\n" +
- "import org.apache.polygene.api.unitofwork.concern.UnitOfWorkPropagation;\n" +
- "\n" +
- "public class HardcodedSecurityRepositoryMixin\n" +
- " implements SecurityRepository\n" +
- "{\n" +
- "\n" +
- " @Override\n" +
- " public boolean verifyPassword( String userName, String password )\n" +
- " {\n" +
- " if( userName.equals(\"admin\") && password.equals(\"secret\") )" +
- " {\n" +
- " return true;\n" +
- " }\n" +
- " if( userName.equals(\"user\") && password.equals(\"123\") )" +
- " {\n" +
- " return true;\n" +
- " }\n" +
- " return false;\n" +
- " }\n" +
- "\n" +
- " @UnitOfWorkPropagation\n" +
- " public List<String> findRoleNamesOfUser( String name )\n" +
- " {\n" +
- " if( \"admin\".equals( name ) )\n" +
- " {\n" +
- " return Collections.singletonList(\"admin\");\n" +
- " }\n" +
- " return Collections.singletonList(\"user\");\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/security/";
- String classname = "HardcodedSecurityRepositoryMixin";
- return FileUtils.createJavaClassPrintWriter( properties, "model", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/IndexingModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/IndexingModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/IndexingModuleWriter.java
deleted file mode 100644
index ef714f0..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/IndexingModuleWriter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class IndexingModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.infrastructure;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.index.rdf.assembly.RdfNativeSesameStoreAssembler;\n" +
- "import org.apache.polygene.library.rdf.repository.NativeConfiguration;\n" +
- "\n" +
- "public class IndexingModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static final String NAME = \"Indexing Module\";\n" +
- " private final ModuleAssembly configModule;\n" +
- "\n" +
- " public IndexingModule( ModuleAssembly configModule )\n" +
- " {\n" +
- " this.configModule = configModule;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " configModule.entities( NativeConfiguration.class ).visibleIn( Visibility.application );\n" +
- " new RdfNativeSesameStoreAssembler(Visibility.application, Visibility.module).assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/infrastructure/";
- String classname = "IndexingModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
deleted file mode 100644
index 464e938..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/InfrastructureLayerWriter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class InfrastructureLayerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.infrastructure;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.LayerAssembler;\n" +
- "import org.apache.polygene.bootstrap.layered.LayeredLayerAssembler;\n" +
- "\n" +
- "public class InfrastructureLayer extends LayeredLayerAssembler\n" +
- " implements LayerAssembler\n" +
- "{\n" +
- " public static final String NAME = \"Infrastructure Layer\";\n" +
- " private final ModuleAssembly configModule;\n" +
- "\n" +
- " public InfrastructureLayer( ModuleAssembly configModule )\n" +
- " {\n" +
- " this.configModule = configModule;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public LayerAssembly assemble( LayerAssembly layer )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " createModule( layer, FileConfigurationModule.class );\n" +
- "\n" +
- " new StorageModule( configModule ).assemble( layer, layer.module( StorageModule.NAME ) );\n" +
- " new IndexingModule( configModule ).assemble( layer, layer.module( IndexingModule.NAME ) );\n" +
- " new SerializationModule().assemble( layer, layer.module( SerializationModule.NAME ) );\n" +
- "\n" +
- " return layer;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/infrastructure/";
- String classname = "InfrastructureLayer";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderItemWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderItemWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderItemWriter.java
deleted file mode 100644
index 9540dd2..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderItemWriter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class OrderItemWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".model.orders;" );
- pw.println();
- pw.println("import java.math.BigDecimal;");
- pw.println("import org.apache.polygene.api.identity.HasIdentity;");
- pw.println("import org.apache.polygene.api.property.Property;");
- pw.println();
- pw.println(
- "public interface OrderItem extends HasIdentity\n" +
- "{\n" +
- " Property<String> partNumber();\n\n" +
- " Property<BigDecimal> unitPrice();\n\n" +
- " Property<Integer> units();\n\n" +
- " Property<BigDecimal> discount();\n\n" +
- "}\n");
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/orders/";
- String classname = "OrderItem";
- return FileUtils.createJavaClassPrintWriter( properties, "model", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderModuleWriter.java
deleted file mode 100644
index 7cf4b75..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderModuleWriter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class OrderModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.domain;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;");
- pw.println(format("import %s.model.orders.Order;", rootPackage));
- pw.println(format("import %s.model.orders.OrderItem;", rootPackage));
- pw.println(format("import %s.model.orders.Customer;", rootPackage));
- pw.println();
- pw.println(
- "public class OrderModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.values( /* add value types */ );\n" +
- " module.entities( Customer.class, Order.class, OrderItem.class );\n" +
- " module.services( /* add services */ )\n" +
- " .visibleIn( Visibility.layer )\n" +
- " .instantiateOnStartup();\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/domain/";
- String classname = "OrderModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderWriter.java
deleted file mode 100644
index 94ab2eb..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/OrderWriter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class OrderWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".model.orders;" );
- pw.println();
- pw.println("import java.time.ZonedDateTime;");
- pw.println("import org.apache.polygene.api.association.Association;");
- pw.println("import org.apache.polygene.api.association.ManyAssociation;");
- pw.println("import org.apache.polygene.api.common.Optional;");
- pw.println("import org.apache.polygene.api.identity.HasIdentity;");
- pw.println("import org.apache.polygene.api.property.Property;");
- pw.println();
- pw.println(
- "public interface Order extends HasIdentity\n" +
- "{\n" +
- " Property<String> orderNumber();\n\n" +
- " Property<ZonedDateTime> registered();\n\n" +
- " @Optional\n" +
- " Property<ZonedDateTime> shipped();\n\n" +
- " Association<Customer> customer();\n\n" +
- " ManyAssociation<OrderItem> items();\n\n" +
- "}\n");
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/orders/";
- String classname = "Order";
- return FileUtils.createJavaClassPrintWriter( properties, "model", packagename, classname );
- }
-}
[09/15] polygene-java git commit: Removed the previous shell system,
as the Yeoman one seems more promising.
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityModuleWriter.java
deleted file mode 100644
index baebfd6..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityModuleWriter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class SecurityModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.domain;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;");
- pw.println(format("import %s.model.orders.Order;", rootPackage));
- pw.println(format("import %s.model.orders.OrderItem;", rootPackage));
- pw.println(format("import %s.model.orders.Customer;", rootPackage));
- pw.println(format("import %s.model.security.SecurityRepository;", rootPackage));
- pw.println(format("import %s.model.security.HardcodedSecurityRepositoryMixin;", rootPackage));
- pw.println();
- pw.println(
- "public class SecurityModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.services( SecurityRepository.class )\n" +
- " .withMixins( HardcodedSecurityRepositoryMixin.class )\n" +
- " .visibleIn( Visibility.application )\n" +
- " .instantiateOnStartup();\n" +
- "\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/domain/";
- String classname = "SecurityModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityRepositoryWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityRepositoryWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityRepositoryWriter.java
deleted file mode 100644
index 013286a..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SecurityRepositoryWriter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class SecurityRepositoryWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".model.security;" );
- pw.println();
- pw.println(
- "import java.util.List;\n" +
- "import org.apache.polygene.api.concern.Concerns;\n" +
- "import org.apache.polygene.api.unitofwork.concern.UnitOfWorkConcern;\n" +
- "import org.apache.polygene.api.unitofwork.concern.UnitOfWorkPropagation;\n" +
- "\n" +
- "@Concerns( UnitOfWorkConcern.class )\n" +
- "public interface SecurityRepository\n" +
- "{\n" +
- " @UnitOfWorkPropagation\n" +
- " boolean verifyPassword( String user, String password );\n" +
- "\n" +
- " @UnitOfWorkPropagation\n" +
- " List<String> findRoleNamesOfUser( String name );\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/security/";
- String classname = "SecurityRepository";
- return FileUtils.createJavaClassPrintWriter( properties, "model", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
deleted file mode 100644
index b604916..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/SerializationModuleWriter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class SerializationModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.infrastructure;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.valueserialization.jackson.JacksonValueSerializationAssembler;\n" +
- "\n" +
- "public class SerializationModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static final String NAME = \"Serialization Module\";\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " new JacksonValueSerializationAssembler()\n" +
- " .visibleIn( Visibility.application )\n" +
- " .assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/infrastructure/";
- String classname = "SerializationModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/StorageModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/StorageModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/StorageModuleWriter.java
deleted file mode 100644
index 3eaf068..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/common/StorageModuleWriter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.common;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class StorageModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.infrastructure;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.entitystore.file.assembly.FileEntityStoreAssembler;\n" +
- "\n" +
- "public class StorageModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static final String NAME = \"Storage Module\";\n" +
- " private final ModuleAssembly configModule;\n" +
- "\n" +
- " public StorageModule( ModuleAssembly configModule )\n" +
- " {\n" +
- " this.configModule = configModule;\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- "\n" +
- " new FileEntityStoreAssembler()\n" +
- " .visibleIn( Visibility.application )\n" +
- " .withConfig( configModule, Visibility.application )\n" +
- " .identifiedBy( \"filestore\" )\n" +
- " .assemble( module );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/infrastructure/";
- String classname = "StorageModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/ApplicationWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/ApplicationWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/ApplicationWriter.java
deleted file mode 100644
index cfa0a95..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/ApplicationWriter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.defaultp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class ApplicationWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".app;" );
- pw.println();
- pw.println( "import java.lang.reflect.UndeclaredThrowableException;" );
- pw.println( "import org.apache.polygene.api.structure.Application;" );
- pw.println( "import org.apache.polygene.api.structure.Module;" );
- pw.println( "import org.apache.polygene.bootstrap.AssemblyException;" );
- pw.println( "import org.apache.polygene.bootstrap.Energy4Java;" );
- pw.println( "import org.apache.polygene.bootstrap.layered.LayeredApplicationAssembler;" );
- pw.println( "import org.apache.polygene.library.restlet.ZrestApplication;" );
- pw.println( format( "import %s.bootstrap.%sApplicationAssembler;", rootPackage, projectName ) );
- pw.println( format( "import %s.model.security.SecurityRepository;", rootPackage ) );
- pw.println();
- pw.println( format( "public class %s", projectName ) );
- pw.println( "{\n" );
- pw.println( " private static Energy4Java polygene;" );
- pw.println( " private static Application app;" );
- pw.println();
-
- pw.println( " private static void registerShutdownHook()" );
- pw.println( " {" );
- pw.println( " Runtime.getRuntime().addShutdownHook( new Thread( new Runnable()\n" +
- " {\n" +
- " @Override\n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " app.passivate();\n" +
- " }\n" +
- " catch( Exception e )\n" +
- " {\n" +
- " System.err.println( \"Clean Shutdown of application failed.\" );\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " }, \"Shutdown Hook for Polygene\" ) );\n" );
- pw.println( " }\n" );
- pw.println( " public static void main( String[] args )" );
- pw.println( " {" );
- pw.println( " polygene = new Energy4Java();" );
- pw.println( format(" app = polygene.newApplication( new %sApplicationAssembler() );", projectName) );
- pw.println( " registerShutdownHook();" );
- pw.println( " app.activate();\n" );
- pw.println();
- pw.println( " // Example interfacing" );
- pw.println( " Module securityModule = app.findModule( \"DomainLayer\", \"SecurityModule\" );" );
- pw.println( " SecurityRepository = securityModule.serviceFinder().findService( SecurityRepository.class );" );
- pw.println( " }\n" );
- pw.println( "}" );
- pw.println();
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/app/";
- String classname = properties.get("project.name");
- return FileUtils.createJavaClassPrintWriter( properties, "app", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/SettingsWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/SettingsWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/SettingsWriter.java
deleted file mode 100644
index 51fc344..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/defaultp/SettingsWriter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.defaultp;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-public class SettingsWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.println(
- String.format(
- "\n" +
- "include 'app',\n" +
- " 'bootstrap',\n" +
- " 'model'\n" +
- "\n" +
- "rootProject.name = \"%s\"\n" +
- "\n" +
- "validateProject(rootProject, \"\")\n" +
- "\n" +
- "def validateProject(project, parentName)\n" +
- "{\n" +
- " assert project.projectDir.isDirectory()\n" +
- " if( new File(\"$project.projectDir/src/main/java\").exists() )\n" +
- " {\n" +
- " assert project.buildFile.isFile()\n" +
- " }\n" +
- " if( parentName.length() > 0 )\n" +
- " println \"Project: \" + project.name\n" +
- " project.children.each { child ->\n" +
- " validateProject(child, project.name)\n" +
- " }\n" +
- "}\n" +
- "\n", projectName
- ) );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- if( !projectDir.exists() )
- {
- if( !projectDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + projectDir.getAbsolutePath() );
- }
- }
- return new PrintWriter( new FileWriter( new File( projectDir, "settings.gradle" ) ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/ApplicationWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/ApplicationWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/ApplicationWriter.java
deleted file mode 100644
index 6b4816a..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/ApplicationWriter.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class ApplicationWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".app;" );
- pw.println();
- pw.println( "import java.lang.reflect.UndeclaredThrowableException;" );
- pw.println( "import org.apache.polygene.api.structure.Application;" );
- pw.println( "import org.apache.polygene.bootstrap.AssemblyException;" );
- pw.println( "import org.apache.polygene.bootstrap.layered.LayeredApplicationAssembler;" );
- pw.println( "import org.apache.polygene.library.restlet.ZrestApplication;" );
- pw.println( "import org.restlet.Context;" );
- pw.println( "import org.restlet.routing.Filter;" );
- pw.println( "import org.restlet.routing.Router;" );
- pw.println( "import org.restlet.security.Enroler;" );
- pw.println( "import org.restlet.security.Verifier;" );
- pw.println( format( "import %s.bootstrap.%sApplicationAssembler;", rootPackage, projectName ) );
- pw.println( format( "import %s.bootstrap.connectivity.ConnectivityLayer;", rootPackage ) );
- pw.println( format( "import %s.bootstrap.connectivity.RestModule;", rootPackage ) );
- pw.println( format( "import %s.model.orders.Order;", rootPackage ) );
- pw.println( format( "import %s.model.orders.Customer;", rootPackage ) );
- pw.println(format("import %s.rest.security.SimpleEnroler;", rootPackage));
- pw.println(format("import %s.rest.security.SimpleVerifier;", rootPackage));
- pw.println();
- pw.println( format( "public class %s extends ZrestApplication", projectName ) );
- pw.println( "{\n" );
- pw.println( format( " public %s( Context context )", projectName ) );
- pw.println( " throws AssemblyException" );
- pw.println( " {" );
- pw.println( " super( context );" );
- pw.println( " }\n" );
- pw.println( " @Override" );
- pw.println( " protected void addRoutes( Router router )" );
- pw.println( " {" );
- pw.println( " addResourcePath( \"orders\", Order.class, \"/\" );" );
- pw.println( " addResourcePath( \"customers\", Customer.class, \"/\" );" );
- pw.println( " }\n" );
-
- pw.println( " @Override" );
- pw.println( " protected LayeredApplicationAssembler createApplicationAssembler( String mode )" );
- pw.println( " throws AssemblyException" );
- pw.println( " {" );
- pw.println( " if( mode != null )" );
- pw.println( " {" );
- pw.println( format(" return new %sApplicationAssembler( Application.Mode.valueOf( mode ) );", projectName) );
- pw.println( " }" );
- pw.println( format(" return new %sApplicationAssembler( Application.Mode.production );", projectName) );
- pw.println( " }" );
- pw.println();
- pw.println( " @Override" );
- pw.println( " protected Verifier createVerifier()" );
- pw.println( " {" );
- pw.println( " return newObject( SimpleVerifier.class );" );
- pw.println( " }" );
- pw.println();
- pw.println( " @Override" );
- pw.println( " protected Enroler createEnroler()" );
- pw.println( " {" );
- pw.println( " return newObject( SimpleEnroler.class, this );" );
- pw.println( " }" );
- pw.println();
- pw.println( " @Override" );
- pw.println( " protected String getConnectivityLayer()" );
- pw.println( " {" );
- pw.println( " return ConnectivityLayer.NAME;" );
- pw.println( " }" );
- pw.println();
- pw.println( " @Override" );
- pw.println( " protected String getConnectivityModule()" );
- pw.println( " {" );
- pw.println( " return RestModule.NAME;" );
- pw.println( " }" );
- pw.println();
- pw.println( " private <T> T newObject( Class<T> type, Object... uses )" );
- pw.println( " {" );
- pw.println( " try" );
- pw.println( " {" );
- pw.println( " T instamce = type.newInstance();" );
- pw.println( " objectFactory.injectTo( instamce, uses );" );
- pw.println( " return instamce;" );
- pw.println( " }" );
- pw.println( " catch( Exception e )" );
- pw.println( " {" );
- pw.println( " throw new UndeclaredThrowableException( e );" );
- pw.println( " }" );
- pw.println( " }" );
- pw.println( "}" );
- pw.println();
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/app/";
- String classname = properties.get("project.name");
- return FileUtils.createJavaClassPrintWriter( properties, "app", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/IndexHtmlWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/IndexHtmlWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/IndexHtmlWriter.java
deleted file mode 100644
index 3252b9b..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/IndexHtmlWriter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-public class IndexHtmlWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.println(
- String.format(
- "<!DOCTYPE html>\n" +
- "<html>\n" +
- "<head>\n" +
- "</head>\n" +
- "<body>\n" +
- "<h1>Welcome to %s</h1>\n" +
- "</body></html>\n" +
- "\n", projectName )
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- File destDir = new File( projectDir, "app/src/main/webapp" );
- if( !destDir.exists() )
- {
- if( !destDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + destDir.getAbsolutePath() );
- }
- }
- return new PrintWriter( new FileWriter( new File( destDir, "index.html" ) ) );
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/OrderModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/OrderModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/OrderModuleWriter.java
deleted file mode 100644
index f837d9d..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/OrderModuleWriter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class OrderModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.domain;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.common.Visibility;\n" +
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;" +
- "import org.apache.polygene.library.restlet.assembly.RestletCrudModuleAssembler;");
- pw.println(format("import %s.model.orders.Order;", rootPackage));
- pw.println(format("import %s.model.orders.OrderItem;", rootPackage));
- pw.println(format("import %s.model.orders.Customer;", rootPackage));
- pw.println();
- pw.println(
- "public class OrderModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.values( /* add value types */ );\n" +
- " module.entities( /* add entity types */ );\n\n" +
- " // These assemblers sets up CRUD access to the entity types listed.\n" +
- " new RestletCrudModuleAssembler( Order.class ).assemble( module );\n" +
- " new RestletCrudModuleAssembler( OrderItem.class ).assemble( module );\n" +
- " new RestletCrudModuleAssembler( Customer.class ).assemble( module );\n" +
- " module.services( /* add services */ )\n" +
- " .visibleIn( Visibility.layer )\n" +
- " .instantiateOnStartup();\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/domain/";
- String classname = "OrderModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/RestModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/RestModuleWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/RestModuleWriter.java
deleted file mode 100644
index 3913f59..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/RestModuleWriter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class RestModuleWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".bootstrap.connectivity;" );
- pw.println();
- pw.println(format("import %s.rest.security.SimpleEnroler;", rootPackage));
- pw.println(format("import %s.rest.security.SimpleVerifier;", rootPackage));
- pw.println(
- "import org.apache.polygene.bootstrap.AssemblyException;\n" +
- "import org.apache.polygene.bootstrap.LayerAssembly;\n" +
- "import org.apache.polygene.bootstrap.ModuleAssembly;\n" +
- "import org.apache.polygene.bootstrap.layered.ModuleAssembler;\n" +
- "import org.apache.polygene.library.restlet.assembly.RestletCrudConnectivityAssembler;\n" +
- "import org.apache.polygene.library.restlet.resource.EntryPoint;\n" +
- "\n" +
- "public class RestModule\n" +
- " implements ModuleAssembler\n" +
- "{\n" +
- " public static String NAME;\n" +
- "\n" +
- " @Override\n" +
- " public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.objects( SimpleVerifier.class, SimpleEnroler.class);\n" +
- "\n" +
- " new RestletCrudConnectivityAssembler().assemble( module );\n" +
- " module.values( EntryPoint.class );\n" +
- " module.values( /* add value types */ );\n" +
- " module.services( /* add services */ );\n" +
- " return module;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/bootstrap/connectivity/";
- String classname = "RestModule";
- return FileUtils.createJavaClassPrintWriter( properties, "bootstrap", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SettingsWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SettingsWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SettingsWriter.java
deleted file mode 100644
index 022a272..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SettingsWriter.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-public class SettingsWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.println(
- String.format(
- "\n" +
- "include 'app',\n" +
- " 'bootstrap',\n" +
- " 'model',\n" +
- " 'rest'\n" +
- "\n" +
- "rootProject.name = \"%s\"\n" +
- "\n" +
- "validateProject(rootProject, \"\")\n" +
- "\n" +
- "def validateProject(project, parentName)\n" +
- "{\n" +
- " assert project.projectDir.isDirectory()\n" +
- " if( new File(\"$project.projectDir/src/main/java\").exists() )\n" +
- " {\n" +
- " assert project.buildFile.isFile()\n" +
- " }\n" +
- " if( parentName.length() > 0 )\n" +
- " println \"Project: \" + project.name\n" +
- " project.children.each { child ->\n" +
- " validateProject(child, project.name)\n" +
- " }\n" +
- "}\n" +
- "\n", projectName
- ) );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- if( !projectDir.exists() )
- {
- if( !projectDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + projectDir.getAbsolutePath() );
- }
- }
- return new PrintWriter( new FileWriter( new File( projectDir, "settings.gradle" ) ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleEnrolerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleEnrolerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleEnrolerWriter.java
deleted file mode 100644
index 2abf0c5..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleEnrolerWriter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class SimpleEnrolerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".rest.security;" );
- pw.println();
- pw.println(
- "import java.util.ArrayList;\n" +
- "import java.util.List;\n" +
- "import org.apache.polygene.api.injection.scope.Service;\n" +
- "import org.apache.polygene.api.injection.scope.Uses;\n" +
- "import org.restlet.Application;\n" +
- "import org.restlet.data.ClientInfo;\n" +
- "import org.restlet.security.Enroler;\n" +
- "import org.restlet.security.Role;" );
- pw.println( format( "import %s.model.security.SecurityRepository;\n", rootPackage ));
- pw.println();
- pw.println(
- "public class SimpleEnroler\n" +
- " implements Enroler\n" +
- "{\n" +
- " @Service\n" +
- " private SecurityRepository repository;\n" +
- "\n" +
- " @Uses\n" +
- " private Application application;\n" +
- "\n" +
- " @Override\n" +
- " public void enrole( ClientInfo clientInfo )\n" +
- " {\n" +
- " org.restlet.security.User user = clientInfo.getUser();\n" +
- " String name = user.getName();\n" +
- " List<String> roleList = repository.findRoleNamesOfUser( name );\n" +
- " List<Role> restletRoles = new ArrayList<>();\n" +
- " roleList.stream().map( roleName -> Role.get( application, roleName ) );\n" +
- " clientInfo.setRoles( restletRoles );\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/rest/security/";
- String classname = "SimpleEnroler";
- return FileUtils.createJavaClassPrintWriter( properties, "rest", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleVerifierWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleVerifierWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleVerifierWriter.java
deleted file mode 100644
index 48a6d0a..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/SimpleVerifierWriter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class SimpleVerifierWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".rest.security;" );
- pw.println();
- pw.println(
- "import org.apache.polygene.api.injection.scope.Service;\n" +
- "import org.restlet.security.SecretVerifier;\n" +
- "import org.restlet.security.Verifier;\n" +
- format( "import %s.model.security.SecurityRepository;\n", rootPackage ) +
- "\n" +
- "public class SimpleVerifier extends SecretVerifier\n" +
- " implements Verifier\n" +
- "{\n" +
- " @Service\n" +
- " private SecurityRepository repository;\n" +
- "\n" +
- " @Override\n" +
- " public int verify( String user, char[] secret )\n" +
- " {\n" +
- " if( user == null || secret == null )\n" +
- " {\n" +
- " return RESULT_UNKNOWN;\n" +
- " }\n" +
- " if( repository.verifyPassword( user, String.valueOf( secret ) ) )\n" +
- " {\n" +
- " return RESULT_VALID;\n" +
- " }\n" +
- " return RESULT_INVALID;\n" +
- " }\n" +
- "}\n"
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/rest/security/";
- String classname = "SimpleVerifier";
- return FileUtils.createJavaClassPrintWriter( properties, "rest", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/WebXmlWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/WebXmlWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/WebXmlWriter.java
deleted file mode 100644
index 5a181ec..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/restapp/WebXmlWriter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.restapp;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-public class WebXmlWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.println(
- String.format(
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "\n" +
- "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n" +
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
- " xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\"\n" +
- " version=\"3.0\">\n" +
- "\n" +
- " <servlet>\n" +
- " <servlet-name>polygenerest</servlet-name>\n" +
- " <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>\n" +
- " <init-param>\n" +
- " <param-name>org.apache.polygene.runtime.mode</param-name>\n" +
- " <param-value>production</param-value>\n" +
- " </init-param>\n" +
- " <init-param>\n" +
- " <!-- Application class name -->\n" +
- " <param-name>org.restlet.application</param-name>\n" +
- " <param-value>%s</param-value>\n" +
- " </init-param>\n" +
- " <init-param>\n" +
- " <!-- Protocols to be bound to-->\n" +
- " <param-name>org.restlet.clients</param-name>\n" +
- " <param-value>HTTP HTTPS</param-value>\n" +
- " </init-param>\n" +
- " <load-on-startup>1</load-on-startup>\n" +
- " </servlet>\n" +
- "\n" +
- " <servlet-mapping>\n" +
- " <servlet-name>polygenerest</servlet-name>\n" +
- " <url-pattern>/api/*</url-pattern>\n" +
- " </servlet-mapping>\n" +
- "\n" +
- "</web-app>\n", rootPackage + ".app." + projectName )
- );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- File destDir = new File( projectDir, "app/src/main/webapp/WEB-INF" );
- if( !destDir.exists() )
- {
- if( !destDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + destDir.getAbsolutePath() );
- }
- }
- return new PrintWriter( new FileWriter( new File( destDir, "web.xml" ) ) );
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SettingsWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SettingsWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SettingsWriter.java
deleted file mode 100644
index 8622933..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SettingsWriter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.singleton;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-
-public class SettingsWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.println(
- String.format(
- "\n" +
- "rootProject.name = \"%s\"\n" +
- "\n" +
- "validateProject(rootProject, \"\")\n" +
- "\n" +
- "def validateProject(project, parentName)\n" +
- "{\n" +
- " assert project.projectDir.isDirectory()\n" +
- " if( new File(\"$project.projectDir/src/main/java\").exists() )\n" +
- " {\n" +
- " assert project.buildFile.isFile()\n" +
- " }\n" +
- " if( parentName.length() > 0 )\n" +
- " println \"Project: \" + project.name\n" +
- " project.children.each { child ->\n" +
- " validateProject(child, project.name)\n" +
- " }\n" +
- "}\n" +
- "\n", projectName
- ) );
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- if( !projectDir.exists() )
- {
- if( !projectDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + projectDir.getAbsolutePath() );
- }
- }
- return new PrintWriter( new FileWriter( new File( projectDir, "settings.gradle" ) ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
deleted file mode 100644
index 4069841..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.singleton;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-import static java.lang.String.format;
-
-public class SingletonApplicationAssemblerWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ".app;" );
- pw.println();
- pw.println( "import org.apache.polygene.api.structure.Application;" );
- pw.println( "import org.apache.polygene.bootstrap.AssemblyException;" );
- pw.println();
- pw.println( format( "public class %s", projectName ) );
- pw.println( "{\n" );
- pw.println( " public static void main( String[] args )");
- pw.println( " throws Exception" );
- pw.println( " {" );
- pw.println( " SingletonAssembly app = new SingletonAssembly()" );
- pw.println( " {" );
- pw.println( " @Override\n" +
- " public void assemble( ModuleAssembly module )\n" +
- " throws AssemblyException\n" +
- " {\n" +
- " module.values( );\n" +
- " module.entities( );\n" +
- " module.services( StartupService.class );\n" +
- " .instantiateOnStartup();\n" +
- " }\n" );
- pw.println( " }" );
- pw.println();
- pw.println( " registerShutdownHook();" );
- pw.println( " StartupService startup = app.serviceFinder().findService( StartupService.class );" );
- pw.println();
- pw.println( " // Here the application is ready to do something." );
- pw.println( " // You should add functionality in the StartupService class." );
- pw.println( " }" );
- pw.println( );
- pw.println( " private void registerShutdownHook()" );
- pw.println( " {" );
- pw.println( " Runtime.getRuntime().addShutdownHook( new Thread( new Runnable()\n" +
- " {\n" +
- " @Override\n" +
- " public void run()\n" +
- " {\n" +
- " try\n" +
- " {\n" +
- " app.passivate();\n" +
- " }\n" +
- " catch( Exception e )\n" +
- " {\n" +
- " System.err.println( \"Clean Shutdown of application failed.\" );\n" +
- " e.printStackTrace();\n" +
- " }\n" +
- " }\n" +
- " }, \"Shutdown Hook for Polygene\" ) );\n" );
- pw.println( " }" );
- pw.println( "}" );
- pw.println();
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" );
- String classname = properties.get("project.name");
- return FileUtils.createJavaClassPrintWriter( properties, "", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/StartupServiceWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/StartupServiceWriter.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/StartupServiceWriter.java
deleted file mode 100644
index 9fafd03..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/create/project/singleton/StartupServiceWriter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project.singleton;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Map;
-import org.apache.polygene.tools.shell.FileUtils;
-
-public class StartupServiceWriter
-{
-
- public void writeClass( Map<String, String> properties )
- throws IOException
- {
- String rootPackage = properties.get( "root.package" );
- String projectName = properties.get( "project.name" );
- try (PrintWriter pw = createPrinter( properties ))
- {
- pw.print( "package " );
- pw.print( properties.get( "root.package" ) );
- pw.println( ";" );
- pw.println();
- pw.println("import org.apache.polygene.api.activation.Activation;");
- pw.println();
- pw.println(
- "public interface StartupService\n" +
- " implements Activation\n" +
- "{\n" +
- " public void activate()\n" +
- " {\n" +
- " // TODO This method is called when the application starts.\n" +
- " }\n" +
- "\n" +
- " public void passivate()\n" +
- " {\n" +
- " // TODO This method is called when the application shutsdown.\n" +
- " }\n" +
- "}\n");
- }
- }
-
- private PrintWriter createPrinter( Map<String, String> properties )
- throws IOException
- {
- String packagename = properties.get( "root.package" ).replaceAll( "\\.", "/" ) + "/model/";
- String classname = "StartupService";
- return FileUtils.createJavaClassPrintWriter( properties, "", packagename, classname );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/help/HelpCommand.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/help/HelpCommand.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/help/HelpCommand.java
deleted file mode 100644
index fe61bdc..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/help/HelpCommand.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell.help;
-
-import java.io.BufferedReader;
-import java.io.PrintWriter;
-import org.apache.polygene.tools.shell.AbstractCommand;
-import org.apache.polygene.tools.shell.Command;
-
-public class HelpCommand extends AbstractCommand
-{
- private Iterable<Command> commands;
-
- public HelpCommand()
- {
- }
-
- public void setCommands( Iterable<Command> commands )
- {
- this.commands = commands;
- }
-
- @Override
- public void execute( String[] args, BufferedReader input, PrintWriter output )
- {
- for( Command command : commands )
- {
- String text = command.name() + " " + command.description();
- output.println( text );
- output.flush();
- }
- }
-
- @Override
- public String description()
- {
- return "\t\t\t\t\tPrints this help text.";
- }
-
- @Override
- public String name()
- {
- return "help";
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/FileUtilsTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/FileUtilsTest.java
deleted file mode 100644
index f2d02b5..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/FileUtilsTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.util.Map;
-import org.junit.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-
-public class FileUtilsTest
-{
- @Test
- public void createDirectoryTest() throws IOException
- {
- File f = new File( "habba-zout" );
- assertThat( f.exists(), equalTo( false ) );
- FileUtils.createDir( "habba-zout" );
- assertThat( f.exists(), equalTo( true ) );
- Files.delete( f.toPath() );
- assertThat( f.exists(), equalTo( false ) );
- }
-
- @Test
- public void removeDirTest() throws Exception
- {
- File srcFile = new File( "build.gradle" );
- Files.write( srcFile.toPath(), "Some content".getBytes() );
- File f = new File( "habba-zout" );
- assertThat( f.exists(), equalTo( false ) );
- File f1 = FileUtils.createDir( "habba-zout" );
- File f2 = FileUtils.createDir( "habba-zout/src" );
- File f3 = FileUtils.createDir( "habba-zout/src/main" );
- File f4 = FileUtils.createDir( "habba-zout/src/test" );
- File f5 = FileUtils.createDir( "habba-zout/src/main/abc" );
- FileUtils.copyFile( srcFile, new File( f1, "build.gradle__" ) );
- FileUtils.copyFile( srcFile, new File( f2, "build.gradle__" ) );
- FileUtils.copyFile( srcFile, new File( f3, "build.gradle__" ) );
- FileUtils.copyFile( srcFile, new File( f4, "build.gradle__" ) );
- FileUtils.copyFile( srcFile, new File( f5, "build.gradle__" ) );
- FileUtils.removeDir( f );
- assertThat( f1.exists(), equalTo( false ) );
- assertThat( f2.exists(), equalTo( false ) );
- assertThat( f3.exists(), equalTo( false ) );
- assertThat( f4.exists(), equalTo( false ) );
- assertThat( f5.exists(), equalTo( false ) );
- }
-
- @Test
- public void readPropertiesResourceTest()
- {
- TestHelper.setPolygeneZome();
- Map<String, String> map = FileUtils.readTemplateProperties( "restapp" );
- assertThat( map, notNullValue() );
- assertThat( map.get( "template.dir" ), equalTo( "etc/templates/restapp/files" ) );
- }
-
- @Test
- public void copyFileTest()
- throws Exception
- {
- File srcFile = new File( "build.gradle" );
- Files.write( srcFile.toPath(), "Some content".getBytes() );
- File dest = new File( "build.gradle.copy" );
- assertThat( dest.exists(), equalTo( false ) );
- FileUtils.copyFile( srcFile, dest );
- assertThat( dest.exists(), equalTo( true ) );
- Files.delete( dest.toPath() );
- assertThat( dest.exists(), equalTo( false ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpCommandTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpCommandTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpCommandTest.java
deleted file mode 100644
index f2a6c2a..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpCommandTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.polygene.tools.shell.create.CreateProject;
-import org.apache.polygene.tools.shell.help.HelpCommand;
-import org.junit.Test;
-
-public class HelpCommandTest
-{
- @Test
- public void givenTwoCommandsWhenExecutingHelpExpectExplanation(){
- HelpCommand underTest = new HelpCommand();
- List<Command> commands = Arrays.asList( underTest, new CreateProject() );
- underTest.setCommands( commands );
- ByteArrayOutputStream baos = new ByteArrayOutputStream( );
- PrintWriter pw = new PrintWriter( baos );
- underTest.execute( null, null, pw );
- System.out.println(baos.toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpNeededExceptionTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpNeededExceptionTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpNeededExceptionTest.java
deleted file mode 100644
index 5436502..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/HelpNeededExceptionTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell;
-
-import org.apache.polygene.tools.shell.create.CreateProject;
-import org.junit.Test;
-
-public class HelpNeededExceptionTest
-{
- @Test(expected = HelpNeededException.class )
- public void helpTest() {
- new CreateProject().execute( new String[0], null, null );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/TestHelper.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/TestHelper.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/TestHelper.java
deleted file mode 100644
index c512820..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/TestHelper.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell;
-
-import java.io.File;
-
-public class TestHelper
-{
- public static void setPolygeneZome()
- {
- String cwd = new File( ".").getAbsolutePath();
- if( cwd.endsWith( "/java/." )) // IDEA default runner
- {
- String polygeneHome = new File( new File(".").getAbsoluteFile(), "tools/shell/src/dist" ).getAbsolutePath();
- System.setProperty( "polygene.home", polygeneHome );
- }
- if( cwd.endsWith( "tools/shell/." )) // Gradle build
- {
- String polygeneHome = new File( new File(".").getAbsoluteFile(), "src/dist" ).getAbsolutePath();
- System.setProperty( "polygene.home", polygeneHome );
- }
- if( cwd.endsWith( "test/work/." ) ) // Parallel Gradle build
- {
- String polygeneHome = new File( cwd + "./../../../../src/dist" ).getAbsolutePath();
- System.setProperty( "polygene.home", polygeneHome );
- }
- }
-}
[08/15] polygene-java git commit: Removed the previous shell system,
as the Yeoman one seems more promising.
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/CreateProjectTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/CreateProjectTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/CreateProjectTest.java
deleted file mode 100644
index 2d6b15c..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/CreateProjectTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create;
-
-import java.io.File;
-import java.io.IOException;
-import org.apache.polygene.tools.shell.HelpNeededException;
-import org.apache.polygene.tools.shell.TestHelper;
-import org.junit.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-public class CreateProjectTest
-{
- private CreateProject underTest = new CreateProject();
-
- @Test
- public void givenCommandWhenRequestNameExpectName()
- {
- assertThat( underTest.name(), equalTo( "create-project" ) );
- }
-
- @Test
- public void givenCommandWhenRequestDescriptionExpectDescription()
- {
- assertThat( underTest.description(), equalTo( "type name package\tCreates a new skeletal project in directory [name]." ) );
- }
-
- @Test( expected = HelpNeededException.class )
- public void givenCommandWhenTemplateDoesNotExistExpectException()
- {
- new CreateProject().execute( new String[]{ "habba", "PolygeneTest", "org.apache.polygene" }, null, null );
- }
-
- @Test
- public void givenCommandWhenTemplateExistExpectCreatedProject() throws IOException
- {
- TestHelper.setPolygeneZome();
- File dest = new File( "PolygeneTest" );
- new CreateProject().execute( new String[]{ "create-project", "null", "PolygeneTest", "org.apache.polygene" }, null, null );
-
- assertThat( dest.exists(), equalTo( true ) );
- File file = new File( dest, "src/main/java/org/apache/polygene/package.html" );
- assertThat( file.exists(), equalTo( true ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreatorTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreatorTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreatorTest.java
deleted file mode 100644
index c3c183c..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/DefaultProjectCreatorTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.polygene.tools.shell.TestHelper;
-import org.junit.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class DefaultProjectCreatorTest
-{
- private DefaultProjectCreator underTest = new DefaultProjectCreator();
-
- @Test
- public void givenCorrectInputWhenCreatedProjectExpectCompleteProjectCreated()
- throws Exception
- {
-
- TestHelper.setPolygeneZome();
- File projectDir = new File( "PolygeneTest" );
- Map<String, String> properties = new HashMap<>();
- properties.put( "polygene.home", System.getProperty( "polygene.home" ) );
- properties.put( "root.package", "org.apache.polygene.test" );
- properties.put( "project.dir", "PolygeneTest" );
- properties.put( "project.name", "PolygeneTest" );
- properties.put( "template.dir", "etc/templates/restapp/files" );
- underTest.create( "PolygeneTest", projectDir, properties );
-
- assertThat( projectDir.exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/java/org/apache/polygene/test/app/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/java/org/apache/polygene/test/app/PolygeneTest.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/ConfigModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/ConfigurationLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/connectivity/ConnectivityLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/connectivity/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/CrudModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/DomainLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/OrderModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/SecurityModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/FileConfigurationModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/IndexingModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/InfrastructureLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/SerializationModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/StorageModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/PolygeneTestApplicationAssembler.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/Customer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/Order.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/OrderItem.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/HardcodedSecurityRepositoryMixin.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/SecurityRepository.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradle/wrapper/gradle-wrapper.jar" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradle/wrapper/gradle-wrapper.properties" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradlew" ).exists(), equalTo( true ) );
- assertTrue( new File( projectDir, "gradlew" ).canExecute() );
- assertThat( new File( projectDir, "gradlew.bat" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "settings.gradle" ).exists(), equalTo( true ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/NullProjectCreatorTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/NullProjectCreatorTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/NullProjectCreatorTest.java
deleted file mode 100644
index 2ab1cc4..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/NullProjectCreatorTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.polygene.tools.shell.TestHelper;
-import org.junit.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-public class NullProjectCreatorTest
-{
- private NullProjectCreator underTest = new NullProjectCreator();
-
- @Test
- public void givenCorrectInputWhenCreatedProjectExpectCompleteProjectCreated()
- throws Exception
- {
-
- TestHelper.setPolygeneZome();
- File projectDir = new File( "PolygeneTest" );
- Map<String, String> properties = new HashMap<>();
- properties.put( "polygene.home", System.getProperty( "polygene.home" ) );
- properties.put( "root.package", "org.apache.polygene.test" );
- properties.put( "template.dir", "etc/templates/null/files" );
- underTest.create( "PolygeneTest", projectDir, properties );
-
- assertThat( projectDir.exists(), equalTo( true ) );
- assertThat( new File( projectDir, "src/main/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradlew" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradlew.bat" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "build.gradle" ).exists(), equalTo( true ) );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/RestProjectCreatorTest.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/RestProjectCreatorTest.java b/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/RestProjectCreatorTest.java
deleted file mode 100644
index fd30e32..0000000
--- a/tools/shell/src/test/java/org/apache/polygene/tools/shell/create/project/RestProjectCreatorTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-package org.apache.polygene.tools.shell.create.project;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.polygene.tools.shell.TestHelper;
-import org.junit.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-public class RestProjectCreatorTest
-{
- private RestProjectCreator underTest = new RestProjectCreator();
-
- @Test
- public void givenCorrectInputWhenCreatedProjectExpectCompleteProjectCreated()
- throws Exception
- {
-
- TestHelper.setPolygeneZome();
- File projectDir = new File( "PolygeneTest" );
- Map<String, String> properties = new HashMap<>();
- properties.put( "polygene.home", System.getProperty( "polygene.home" ) );
- properties.put( "root.package", "org.apache.polygene.test" );
- properties.put( "project.dir", "PolygeneTest" );
- properties.put( "project.name", "PolygeneTest" );
- properties.put( "template.dir", "etc/templates/restapp/files" );
- underTest.create( "PolygeneTest", projectDir, properties );
-
- assertThat( projectDir.exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/java/org/apache/polygene/test/app/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/java/org/apache/polygene/test/app/PolygeneTest.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/main/webapp/WEB-INF/web.xml" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "app/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/ConfigModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/config/ConfigurationLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/connectivity/ConnectivityLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/connectivity/RestModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/connectivity/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/CrudModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/DomainLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/OrderModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/domain/SecurityModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/FileConfigurationModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/IndexingModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/InfrastructureLayer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/SerializationModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/infrastructure/StorageModule.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/java/org/apache/polygene/test/bootstrap/PolygeneTestApplicationAssembler.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/main" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "bootstrap/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/Customer.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/Order.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/OrderItem.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/orders/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/HardcodedSecurityRepositoryMixin.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/SecurityRepository.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/main/java/org/apache/polygene/test/model/security/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "model/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src/main/resources" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src/main/java/org/apache/polygene/test/rest/security/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src/main/java/org/apache/polygene/test/rest/security/SimpleEnroler.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src/main/java/org/apache/polygene/test/rest/security/SimpleVerifier.java" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "rest/src/test/java/org/apache/polygene/test/package.html" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradle/wrapper/gradle-wrapper.jar" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradle/wrapper/gradle-wrapper.properties" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradlew" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "gradlew.bat" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "build.gradle" ).exists(), equalTo( true ) );
- assertThat( new File( projectDir, "settings.gradle" ).exists(), equalTo( true ) );
- }
-}
[04/15] polygene-java git commit: Merge remote-tracking branch
'origin/develop' into develop
Posted by ni...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/0655a442
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/0655a442
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/0655a442
Branch: refs/heads/develop
Commit: 0655a4428a9078a631bbacdaf4bef3036aec3055
Parents: 1ada97d b61d025
Author: niclas <ni...@spicter.com>
Authored: Wed Jan 25 14:33:06 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Wed Jan 25 14:33:06 2017 +0800
----------------------------------------------------------------------
.../org/apache/polygene/api/type/ValueType.java | 4 +-
.../polygene/runtime/structure/ModuleModel.java | 12 +-
.../runtime/structure/VisibilityPredicate.java | 48 ++++++++
.../runtime/structure/Visibilitypredicate.java | 48 --------
.../spi/entitystore/Polygene142Test.java | 112 +++++++++++++++++++
.../AbstractPlainValueSerializationTest.java | 84 --------------
.../prefs/PreferencesEntityStoreMixin.java | 28 ++---
.../skeletons/SQLCompatEntityStateWrapper.java | 20 ++--
.../JacksonPlainValueSerializationTest.java | 6 -
.../OrgJsonPlainValueSerializationTest.java | 6 -
.../stax/StaxPlainValueSerializationTest.java | 8 +-
.../appbrowser/json/ValueModelFormatter.java | 2 +-
.../jmx/ConfigurationManagerService.java | 4 +-
.../rdf/entity/EntityTypeSerializer.java | 2 +-
.../library/restlet/crud/EntityResource.java | 2 +-
.../DataSourceConfigurationManagerService.java | 2 +-
16 files changed, 199 insertions(+), 189 deletions(-)
----------------------------------------------------------------------
[02/15] polygene-java git commit: Deprecating the Visitor pattern. It
is not in line with the Stream API that we use everywhere else.
Posted by ni...@apache.org.
Deprecating the Visitor pattern. It is not in line with the Stream API that we use everywhere else.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/4e619fbf
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/4e619fbf
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/4e619fbf
Branch: refs/heads/develop
Commit: 4e619fbf1f3a6b0521855eaec0f7cbd8dcc2fe1a
Parents: a547927
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Jan 7 14:59:44 2017 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Jan 7 14:59:44 2017 +0800
----------------------------------------------------------------------
.../java/org/apache/polygene/bootstrap/LayerAssembly.java | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/4e619fbf/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
index 0385040..f5c3b09 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/LayerAssembly.java
@@ -91,6 +91,16 @@ public interface LayerAssembly
@SuppressWarnings( { "unchecked","varargs" } )
LayerAssembly withActivators( Class<? extends Activator<Layer>>... activators );
+ /**
+ * The visitor pattern to inspect the entire pre-instantiated model.
+ *
+ * @deprecated New mechanism is considered, using Java 8 Stream API.
+ *
+ * @param visitor The visitor to be called.
+ * @param <ThrowableType> The exceptions that may be thrown.
+ * @throws ThrowableType when there is an underlying problem in the model.
+ */
+ @Deprecated
<ThrowableType extends Throwable> void visit( AssemblyVisitor<ThrowableType> visitor )
throws ThrowableType;
[11/15] polygene-java git commit: Removed the previous shell system,
as the Yeoman one seems more promising.
Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew_
deleted file mode 100755
index 91a7e26..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew_
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/build.gradle_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/build.gradle_
deleted file mode 100644
index 83f55b2..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/build.gradle_
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-dependencies {
-
- compile "org.restlet.jee:org.restlet:2.3.4"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/orders/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/orders/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/orders/package.html_
deleted file mode 100644
index 441cb85..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/orders/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Domain Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/security/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/security/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/security/package.html_
deleted file mode 100644
index bcf0ee4..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/java/__package__/model/security/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Security Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/model/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/build.gradle_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/build.gradle_
deleted file mode 100644
index f2630ea..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/build.gradle_
+++ /dev/null
@@ -1,8 +0,0 @@
-
-dependencies {
- compile project( ":model" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/java/__package__/rest/security/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/java/__package__/rest/security/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/java/__package__/rest/security/package.html_
deleted file mode 100644
index 249f68c..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/java/__package__/rest/security/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for the security handling in the Connectivity Layer</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/images/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/images/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/images/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/model/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/model/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/main/webapp/model/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/rest/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/template.properties
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/template.properties b/tools/shell/src/dist/etc/templates/ng2-heroes/template.properties
deleted file mode 100644
index e889ad6..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/template.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-#
-
-
-creator.class=org.apache.polygene.tools.shell.create.project.HeroesProjectCreator
-
-template.dir=etc/templates/ng2-heroes/files
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/build.gradle_ b/tools/shell/src/dist/etc/templates/null/files/build.gradle_
deleted file mode 100644
index 549574f..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/build.gradle_
+++ /dev/null
@@ -1,22 +0,0 @@
-
-version = 1.0
-
-rootProject.ext {
- polygeneVersion = @version@
-}
-
-allprojects() {
- apply plugin: 'java'
- apply plugin: 'maven'
-
- repositories {
- mavenLocal()
- mavenCentral()
- }
-
- dependencies {
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- testCompile "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.jar_
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_
deleted file mode 100644
index fafa8dd..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/gradle/wrapper/gradle-wrapper.properties_
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Jul 06 10:43:59 EEST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_
deleted file mode 100644
index 8a0b282..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/gradlew.bat_
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/gradlew_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/gradlew_ b/tools/shell/src/dist/etc/templates/null/files/gradlew_
deleted file mode 100644
index 91a7e26..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/gradlew_
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_
deleted file mode 100644
index e071c79..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/src/main/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for the Java source files</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_
deleted file mode 100644
index eaefd36..0000000
--- a/tools/shell/src/dist/etc/templates/null/files/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for testing classes.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/null/template.properties
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/null/template.properties b/tools/shell/src/dist/etc/templates/null/template.properties
deleted file mode 100644
index 0ce53ca..0000000
--- a/tools/shell/src/dist/etc/templates/null/template.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# This project template is the absolute minimal project possible.
-# Only creates a build file and directory structure for java sources.
-
-
-creator.class=org.apache.polygene.tools.shell.create.project.NullProjectCreator
-
-template.dir=etc/templates/null/files
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_
deleted file mode 100644
index 1fed99b..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/app/build.gradle_
+++ /dev/null
@@ -1,22 +0,0 @@
-
-plugins {
- id 'war'
- id "org.akhikhl.gretty" version "1.4.0"
-}
-
-dependencies {
- compile project( ":bootstrap" )
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.servlet:$polygeneVersion"
-
- compile "javax.servlet:servlet-api:2.5"
- compile "org.restlet.jee:org.restlet:2.3.4"
-
- runtime "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
- runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4"
-
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html
deleted file mode 100644
index 1f859fb..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/java/__package__/app/package.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html>
-<body>This package contains the bootstrap code.</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/app/src/main/webapp/WEB-INF/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html b/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html
deleted file mode 100644
index 8bb0a631..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/app/src/test/java/__package__/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html><body>Test directory</body></html>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_
deleted file mode 100644
index 37ddd9e..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/build.gradle_
+++ /dev/null
@@ -1,16 +0,0 @@
-
-dependencies {
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
-
-
- compile "org.apache.polygene.library:org.apache.polygene.library.fileconfig:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.entitystore-file:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.indexing-rdf:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.valueserialization-jackson:$polygeneVersion"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
deleted file mode 100644
index e4bffa5..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Config layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
deleted file mode 100644
index 21dbaa9..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Connectivity layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
deleted file mode 100644
index 2bdc426..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Domain layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
deleted file mode 100644
index cf2f9b5..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Infrastructure layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/bootstrap/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_
deleted file mode 100644
index c5b2044..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/build.gradle_
+++ /dev/null
@@ -1,23 +0,0 @@
-
-version = 1.0
-
-rootProject.ext {
- polygeneVersion = @version@
-}
-
-allprojects() {
- apply plugin: 'java'
- apply plugin: 'maven'
-
- repositories {
- mavenLocal()
- mavenCentral()
- maven { name 'restlet-repo'; url 'http://maven.restlet.org/' }
- }
-
- dependencies {
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- testCompile "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_
deleted file mode 100644
index 0087cd3..0000000
Binary files a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.jar_ and /dev/null differ
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_
deleted file mode 100644
index fafa8dd..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/gradle/wrapper/gradle-wrapper.properties_
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Jul 06 10:43:59 EEST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_
deleted file mode 100644
index 8a0b282..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/gradlew.bat_
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/gradlew_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/gradlew_ b/tools/shell/src/dist/etc/templates/restapp/files/gradlew_
deleted file mode 100755
index 91a7e26..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/gradlew_
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_
deleted file mode 100644
index 83f55b2..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/model/build.gradle_
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-dependencies {
-
- compile "org.restlet.jee:org.restlet:2.3.4"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_
deleted file mode 100644
index 441cb85..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/orders/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Domain Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_
deleted file mode 100644
index bcf0ee4..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/java/__package__/model/security/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Security Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/model/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/model/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/model/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/model/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/rest/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/rest/build.gradle_ b/tools/shell/src/dist/etc/templates/restapp/files/rest/build.gradle_
deleted file mode 100644
index f2630ea..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/rest/build.gradle_
+++ /dev/null
@@ -1,8 +0,0 @@
-
-dependencies {
- compile project( ":model" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/java/__package__/rest/security/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/java/__package__/rest/security/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/java/__package__/rest/security/package.html_
deleted file mode 100644
index 249f68c..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/java/__package__/rest/security/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for the security handling in the Connectivity Layer</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/restapp/files/rest/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/files/rest/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/files/rest/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/restapp/files/rest/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/files/rest/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/restapp/template.properties
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/restapp/template.properties b/tools/shell/src/dist/etc/templates/restapp/template.properties
deleted file mode 100644
index 5e22ab6..0000000
--- a/tools/shell/src/dist/etc/templates/restapp/template.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-#
-
-creator.class=org.apache.polygene.tools.shell.create.project.RestProjectCreator
-
-template.dir=etc/templates/restapp/files
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/build.gradle_ b/tools/shell/src/dist/etc/templates/singleton/files/build.gradle_
deleted file mode 100644
index 549574f..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/build.gradle_
+++ /dev/null
@@ -1,22 +0,0 @@
-
-version = 1.0
-
-rootProject.ext {
- polygeneVersion = @version@
-}
-
-allprojects() {
- apply plugin: 'java'
- apply plugin: 'maven'
-
- repositories {
- mavenLocal()
- mavenCentral()
- }
-
- dependencies {
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- testCompile "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.jar_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.jar_
deleted file mode 100644
index 0087cd3..0000000
Binary files a/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.jar_ and /dev/null differ
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.properties_
deleted file mode 100644
index fafa8dd..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/gradle/wrapper/gradle-wrapper.properties_
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Jul 06 10:43:59 EEST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/gradlew.bat_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/singleton/files/gradlew.bat_
deleted file mode 100644
index 8a0b282..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/gradlew.bat_
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/gradlew_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/gradlew_ b/tools/shell/src/dist/etc/templates/singleton/files/gradlew_
deleted file mode 100755
index 91a7e26..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/gradlew_
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/src/main/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/src/main/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/singleton/files/src/main/java/__package__/package.html_
deleted file mode 100644
index e071c79..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/src/main/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for the Java source files</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/files/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/files/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/singleton/files/src/test/java/__package__/package.html_
deleted file mode 100644
index eaefd36..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/files/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Package for testing classes.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/singleton/template.properties
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/singleton/template.properties b/tools/shell/src/dist/etc/templates/singleton/template.properties
deleted file mode 100644
index 2fba476..0000000
--- a/tools/shell/src/dist/etc/templates/singleton/template.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# This template create a simple project with a single layer and a single module.
-# It is based around the SingletonAssembler.
-
-
-creator.class=org.apache.polygene.tools.shell.create.project.SingletonProjectCreator
-
-template.dir=etc/templates/singleton/files
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/docs/quick-start.txt
----------------------------------------------------------------------
diff --git a/tools/shell/src/docs/quick-start.txt b/tools/shell/src/docs/quick-start.txt
deleted file mode 100644
index b22db2c..0000000
--- a/tools/shell/src/docs/quick-start.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-///////////////////////////////////////////////////////////////
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-///////////////////////////////////////////////////////////////
-
-WARNING! This guide is written before the code, and may not work yet.
-
-[[quick-start,Quick Start Guide]]
-= Quick Start =
-If you want to test Apache Polygene in the smallest amount of time possible,
-without getting bogged down by the details, you have come to the right
-place.
-
-== Quick Download / No Install ==
-The following procedure will download one JAR file, one script and put it
-on your PATH.
-
-=== Windows ===
-TBD.
-
-=== Linux / Mac OSX ===
-The assumption is that +wget+ is installed.
-
-[snippet,bash]
-----
-source=tools/shell/src/docs/use-boot.txt
-tag=boot-quick
-----
-
-The boot script will place the the +polygene+ script and the accompanying
-jar file into the $HOME/bin directory, which should already be on your PATH.
-
-== Create a small Project ==
-
-[snippet,bash]
-----
-source=tools/shell/src/docs/use-boot.txt
-tag=create-singleton
-----
-
-== Create a complete Project ==
-
-[snippet,bash]
-----
-source=tools/shell/src/docs/use-boot.txt
-tag=create-ngheroes
-----
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/docs/use-boot.txt
----------------------------------------------------------------------
diff --git a/tools/shell/src/docs/use-boot.txt b/tools/shell/src/docs/use-boot.txt
deleted file mode 100644
index c2a1e6a..0000000
--- a/tools/shell/src/docs/use-boot.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-///////////////////////////////////////////////////////////////
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-///////////////////////////////////////////////////////////////
-
-THIS FILE CONTAINS SNIPPETS for quick-start.txt and shell.txt. DO NOT INCLUDE IN DOCUMENTATION.
-
-
-START SNIPPET: boot-quick
-wget http://polygene.apache.org/latest/shell/polygene-boot
-sh polygene-boot
-END SNIPPET: boot-quick
-
-START SNIPPET: boot-sdk
-wget http://polygene.apache.org/latest/shell/polygene-boot
-sh polygene-boot sdk
-END SNIPPET: boot-sdk
-
-START SNIPPET: create-singleton
-polygene create-project singleton com.acme.quick quickstart
-cd quickstart
-./gradlew assemble
-./gradlew run
-END SNIPPET: create-singleton
-
-START SNIPPET: create-ngheroes
-polygene create-project ng-heroes com.acme.heroes heroes
-cd heroes
-./gradlew assemble
-./gradlew run
-END SNIPPET: create-ngheroes
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/AbstractCommand.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/AbstractCommand.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/AbstractCommand.java
deleted file mode 100644
index 47c8e2f..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/AbstractCommand.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell;
-
-public abstract class AbstractCommand
- implements Command, Comparable<Command>
-{
-
- @Override
- public int compareTo( Command o )
- {
- return getClass().getSimpleName().compareTo( o.getClass().getSimpleName() );
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/Command.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/Command.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/Command.java
deleted file mode 100644
index c14f120..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/Command.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell;
-
-import java.io.BufferedReader;
-import java.io.PrintWriter;
-
-public interface Command
-{
- void execute( String[] args, BufferedReader input, PrintWriter output )
- throws HelpNeededException;
-
- String description();
-
- String name();
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/FileUtils.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/FileUtils.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/FileUtils.java
deleted file mode 100644
index add4b1b..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/FileUtils.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.UncheckedIOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-public class FileUtils
-{
- public static File createDir( String directoryName )
- {
- try
- {
- File dir = new File( directoryName ).getAbsoluteFile();
- Files.createDirectories( dir.toPath() );
- return dir;
- }
- catch( IOException ex )
- {
- throw new UncheckedIOException( ex );
- }
- }
-
- public static void removeDir( File dir ) throws IOException
- {
- Files.walkFileTree( dir.toPath(), new SimpleFileVisitor<Path>()
- {
- @Override
- public FileVisitResult visitFile( final Path file, final BasicFileAttributes attrs ) throws IOException
- {
- Files.delete( file );
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult postVisitDirectory( final Path dir, final IOException exc ) throws IOException
- {
- Files.delete( dir );
- return FileVisitResult.CONTINUE;
- }
- } );
- }
-
- public static Map<String, String> readTemplateProperties( String templateName )
- {
- File propertiesFile = new File( polygeneHome(), "etc/templates/" + templateName + "/template.properties" );
- try( InputStream in = new BufferedInputStream( new FileInputStream( propertiesFile ) ) )
- {
- Properties properties = readProperties( in );
- Map<String, String> result = new HashMap<String, String>();
- for( Map.Entry prop : properties.entrySet() )
- {
- result.put( prop.getKey().toString(), prop.getValue().toString() );
- }
- return result;
- }
- catch( Exception e )
- {
- String message = "Unable to read template \'" + templateName + "\'.";
- System.err.println( message );
- throw new RuntimeException( message );
- }
- }
-
- private static Properties readProperties( InputStream in )
- throws IOException
- {
- Properties p = new Properties();
- p.load( in );
- return p;
- }
-
- public static void copyFile( File srcFile, File dest )
- throws IOException
- {
- System.out.println( "Creating " + dest.getAbsolutePath() );
- if( dest.exists() )
- {
- Files.delete( dest.toPath() );
- }
- Files.copy( srcFile.toPath(), dest.toPath() );
- }
-
- public static File polygeneHome()
- {
- String home = System.getProperty( "polygene.home" );
- return new File( home ).getAbsoluteFile();
- }
-
- public static PrintWriter createJavaClassPrintWriter( Map<String, String> properties,
- String module,
- String packagename,
- String classname
- )
- throws IOException
- {
- File projectDir = new File( properties.get( "project.dir" ) );
- File packageDir = new File( projectDir, module + "/src/main/java/" + packagename );
- if( !packageDir.exists() )
- {
- if( !packageDir.mkdirs() )
- {
- System.err.println( "Unable to create directory: " + packageDir.getAbsolutePath() );
- }
- }
- final File destination = new File( packageDir, classname + ".java" );
- return new PrintWriter( new FileWriter( destination ) )
- {
- @Override
- public void close()
- {
- super.close();
- System.out.println( "Creating " + destination );
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/main/java/org/apache/polygene/tools/shell/HelpNeededException.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/polygene/tools/shell/HelpNeededException.java b/tools/shell/src/main/java/org/apache/polygene/tools/shell/HelpNeededException.java
deleted file mode 100644
index d413997..0000000
--- a/tools/shell/src/main/java/org/apache/polygene/tools/shell/HelpNeededException.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-package org.apache.polygene.tools.shell;
-
-public class HelpNeededException extends RuntimeException
-{
-}
[12/15] polygene-java git commit: Removed the previous shell system,
as the Yeoman one seems more promising.
Posted by ni...@apache.org.
Removed the previous shell system, as the Yeoman one seems more promising.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/ea639e83
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/ea639e83
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/ea639e83
Branch: refs/heads/develop
Commit: ea639e83a96ca7deb3e5e9ddc878c126ec99cae4
Parents: c86b115
Author: niclas <ni...@spicter.com>
Authored: Tue Feb 14 12:46:29 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Tue Feb 14 12:46:29 2017 +0800
----------------------------------------------------------------------
.../library/restlet/PolygeneServerServlet.java | 3 +-
tools/shell/src/dist/bin/polygene-boot | 79 ---------
.../templates/default/files/app/build.gradle_ | 22 ---
.../src/main/java/__package__/app/package.html | 23 ---
.../app/src/main/resources/___placeholder___ | 0
.../app/src/test/java/__package__/package.html | 21 ---
.../default/files/bootstrap/build.gradle_ | 16 --
.../__package__/bootstrap/config/package.html_ | 1 -
.../bootstrap/connectivity/package.html_ | 1 -
.../__package__/bootstrap/domain/package.html_ | 1 -
.../bootstrap/infrastructure/package.html_ | 1 -
.../src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../etc/templates/default/files/build.gradle_ | 23 ---
.../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties_ | 6 -
.../etc/templates/default/files/gradlew.bat_ | 90 ----------
.../dist/etc/templates/default/files/gradlew_ | 164 -------------------
.../templates/default/files/model/build.gradle_ | 7 -
.../java/__package__/model/orders/package.html_ | 1 -
.../__package__/model/security/package.html_ | 1 -
.../model/src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../etc/templates/default/template.properties | 24 ---
.../ng2-heroes/files/app/build.gradle_ | 22 ---
.../src/main/java/__package__/app/package.html | 23 ---
.../app/src/main/resources/___placeholder___ | 0
.../src/main/webapp/WEB-INF/___placeholder___ | 0
.../app/src/main/webapp/app/app.component.css | 34 ----
.../app/src/main/webapp/app/app.component.ts | 37 -----
.../src/main/webapp/app/dashboard.component.css | 67 --------
.../main/webapp/app/dashboard.component.html | 15 --
.../src/main/webapp/app/dashboard.component.ts | 31 ----
.../main/webapp/app/hero-detail.component.css | 36 ----
.../main/webapp/app/hero-detail.component.html | 16 --
.../main/webapp/app/hero-detail.component.ts | 34 ----
.../app/src/main/webapp/app/hero.service.ts | 22 ---
.../files/app/src/main/webapp/app/hero.ts | 11 --
.../src/main/webapp/app/heroes.component.css | 66 --------
.../src/main/webapp/app/heroes.component.html | 21 ---
.../app/src/main/webapp/app/heroes.component.ts | 39 -----
.../files/app/src/main/webapp/app/main.ts | 16 --
.../app/src/main/webapp/app/mock-heroes.ts | 21 ---
.../files/app/src/main/webapp/index.html | 41 -----
.../files/app/src/main/webapp/styles.css | 149 -----------------
.../app/src/test/java/__package__/package.html | 21 ---
.../ng2-heroes/files/bootstrap/build.gradle_ | 16 --
.../__package__/bootstrap/config/package.html_ | 1 -
.../bootstrap/connectivity/package.html_ | 1 -
.../__package__/bootstrap/domain/package.html_ | 1 -
.../bootstrap/infrastructure/package.html_ | 1 -
.../src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../templates/ng2-heroes/files/build.gradle_ | 23 ---
.../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties_ | 6 -
.../etc/templates/ng2-heroes/files/gradlew.bat_ | 90 ----------
.../etc/templates/ng2-heroes/files/gradlew_ | 164 -------------------
.../ng2-heroes/files/model/build.gradle_ | 7 -
.../java/__package__/model/orders/package.html_ | 1 -
.../__package__/model/security/package.html_ | 1 -
.../model/src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../ng2-heroes/files/rest/build.gradle_ | 8 -
.../__package__/rest/security/package.html_ | 1 -
.../rest/src/main/resources/___placeholder___ | 0
.../src/main/webapp/images/___placeholder___ | 0
.../src/main/webapp/model/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../templates/ng2-heroes/template.properties | 24 ---
.../dist/etc/templates/null/files/build.gradle_ | 22 ---
.../files/gradle/wrapper/gradle-wrapper.jar_ | 0
.../gradle/wrapper/gradle-wrapper.properties_ | 6 -
.../dist/etc/templates/null/files/gradlew.bat_ | 90 ----------
.../src/dist/etc/templates/null/files/gradlew_ | 164 -------------------
.../src/main/java/__package__/package.html_ | 1 -
.../src/test/java/__package__/package.html_ | 1 -
.../dist/etc/templates/null/template.properties | 25 ---
.../templates/restapp/files/app/build.gradle_ | 22 ---
.../src/main/java/__package__/app/package.html | 23 ---
.../app/src/main/resources/___placeholder___ | 0
.../src/main/webapp/WEB-INF/___placeholder___ | 0
.../app/src/test/java/__package__/package.html | 21 ---
.../restapp/files/bootstrap/build.gradle_ | 16 --
.../__package__/bootstrap/config/package.html_ | 1 -
.../bootstrap/connectivity/package.html_ | 1 -
.../__package__/bootstrap/domain/package.html_ | 1 -
.../bootstrap/infrastructure/package.html_ | 1 -
.../src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../etc/templates/restapp/files/build.gradle_ | 23 ---
.../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties_ | 6 -
.../etc/templates/restapp/files/gradlew.bat_ | 90 ----------
.../dist/etc/templates/restapp/files/gradlew_ | 164 -------------------
.../templates/restapp/files/model/build.gradle_ | 7 -
.../java/__package__/model/orders/package.html_ | 1 -
.../__package__/model/security/package.html_ | 1 -
.../model/src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../templates/restapp/files/rest/build.gradle_ | 8 -
.../__package__/rest/security/package.html_ | 1 -
.../rest/src/main/resources/___placeholder___ | 0
.../src/test/java/__package__/package.html_ | 1 -
.../etc/templates/restapp/template.properties | 23 ---
.../etc/templates/singleton/files/build.gradle_ | 22 ---
.../files/gradle/wrapper/gradle-wrapper.jar_ | Bin 51348 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties_ | 6 -
.../etc/templates/singleton/files/gradlew.bat_ | 90 ----------
.../dist/etc/templates/singleton/files/gradlew_ | 164 -------------------
.../src/main/java/__package__/package.html_ | 1 -
.../src/test/java/__package__/package.html_ | 1 -
.../etc/templates/singleton/template.properties | 24 ---
tools/shell/src/docs/quick-start.txt | 61 -------
tools/shell/src/docs/use-boot.txt | 46 ------
.../polygene/tools/shell/AbstractCommand.java | 31 ----
.../apache/polygene/tools/shell/Command.java | 33 ----
.../apache/polygene/tools/shell/FileUtils.java | 148 -----------------
.../tools/shell/HelpNeededException.java | 24 ---
.../org/apache/polygene/tools/shell/Main.java | 117 -------------
.../tools/shell/create/CreateProject.java | 80 ---------
.../create/project/AbstractProjectCreator.java | 106 ------------
.../create/project/DefaultProjectCreator.java | 79 ---------
.../create/project/HeroesProjectCreator.java | 82 ----------
.../shell/create/project/ProjectCreator.java | 34 ----
.../create/project/RestProjectCreator.java | 90 ----------
.../create/project/SingletonProjectCreator.java | 41 -----
.../common/ApplicationAssemblerWriter.java | 100 -----------
.../project/common/ConfigLayerWriter.java | 79 ---------
.../project/common/ConfigModuleWriter.java | 73 ---------
.../project/common/ConnectivityLayerWriter.java | 72 --------
.../create/project/common/CrudModuleWriter.java | 71 --------
.../create/project/common/CustomerWriter.java | 66 --------
.../project/common/DomainLayerWriter.java | 72 --------
.../common/FileConfigurationModuleWriter.java | 74 ---------
.../HardCodedSecurityRepositoryMixinWriter.java | 85 ----------
.../project/common/IndexingModuleWriter.java | 82 ----------
.../common/InfrastructureLayerWriter.java | 84 ----------
.../create/project/common/OrderItemWriter.java | 64 --------
.../project/common/OrderModuleWriter.java | 83 ----------
.../create/project/common/OrderWriter.java | 69 --------
.../project/common/SecurityModuleWriter.java | 85 ----------
.../common/SecurityRepositoryWriter.java | 67 --------
.../common/SerializationModuleWriter.java | 76 ---------
.../project/common/StorageModuleWriter.java | 85 ----------
.../project/defaultp/ApplicationWriter.java | 102 ------------
.../create/project/defaultp/SettingsWriter.java | 80 ---------
.../project/restapp/ApplicationWriter.java | 136 ---------------
.../create/project/restapp/IndexHtmlWriter.java | 68 --------
.../project/restapp/OrderModuleWriter.java | 88 ----------
.../project/restapp/RestModuleWriter.java | 83 ----------
.../create/project/restapp/SettingsWriter.java | 81 ---------
.../project/restapp/SimpleEnrolerWriter.java | 86 ----------
.../project/restapp/SimpleVerifierWriter.java | 80 ---------
.../create/project/restapp/WebXmlWriter.java | 93 -----------
.../project/singleton/SettingsWriter.java | 76 ---------
.../SingletonApplicationAssemblerWriter.java | 103 ------------
.../project/singleton/StartupServiceWriter.java | 68 --------
.../polygene/tools/shell/help/HelpCommand.java | 62 -------
.../polygene/tools/shell/FileUtilsTest.java | 93 -----------
.../polygene/tools/shell/HelpCommandTest.java | 43 -----
.../tools/shell/HelpNeededExceptionTest.java | 32 ----
.../apache/polygene/tools/shell/TestHelper.java | 46 ------
.../tools/shell/create/CreateProjectTest.java | 65 --------
.../project/DefaultProjectCreatorTest.java | 99 -----------
.../create/project/NullProjectCreatorTest.java | 55 -------
.../create/project/RestProjectCreatorTest.java | 108 ------------
167 files changed, 1 insertion(+), 6691 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/PolygeneServerServlet.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/PolygeneServerServlet.java b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/PolygeneServerServlet.java
index f925cbe..27080d8 100644
--- a/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/PolygeneServerServlet.java
+++ b/libraries/restlet/src/main/java/org/apache/polygene/library/restlet/PolygeneServerServlet.java
@@ -31,8 +31,7 @@ import org.restlet.ext.servlet.ServerServlet;
* Restlet ServerServlet backed by a org.restlet.Application object.
*/
@Mixins( PolygeneServerServlet.Mixin.class )
-public interface PolygeneServerServlet
- extends Servlet
+public interface PolygeneServerServlet extends Servlet
{
class Mixin
extends ServerServlet
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/bin/polygene-boot
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/bin/polygene-boot b/tools/shell/src/dist/bin/polygene-boot
deleted file mode 100644
index 4fcc7d5..0000000
--- a/tools/shell/src/dist/bin/polygene-boot
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-# This files copies itself to $HOME/bin, renames itself to "polygene"
-# and from then on pretends to be the tools.shell script.
-#
-
-JARNAME=org.apache.polygene.tool.shell-@version@.jar
-
-MYNAME=`basename $0`
-
-# check if it is executing as boot script or regular script.
-if [ "$MYNAME" == "polygene-boot" ] ; then
- mkdir $HOME/bin >/dev/null 2>&1
- cp $0 $HOME/bin/polygene
- if [ -f $HOME/bin/$JARNAME ] ; then
- echo "JAR file exists."
- else
- JAR_URL=http://repo1.maven.org/maven2/org/apache/polygene/$JARNAME
-
- # check for wget
- WGET=`which wget`
-
- if [ "$WGET" == "" ] ; then
-
- # check for curl
- CURL=`which curl`
- if [ "$CURL" == "" ] ; then
- echo "You need either wget or curl installed to use this script."
- exit 1
- else
- curl --output $HOME/bin/ $JAR_URL
- fi
- else
- wget --output-document=$HOME/bin/ $HOME/bin/polygene $JAR_URL
- fi
- fi
-else
- # Capture current directory
- CWD=`pwd`
-
- # Goto directory where this script was started from.
- cd `dirname $0`
- # Up one level
- cd ..
- # Get the home directory of Polygene
- POLYGENEPATH=`pwd`
-
- # Figure out if we are executing from within the SDK or the QuickStart
- if [ -f libs/$JARNAME ] ; then
- JARFILE=libs/org/apache/polygene/tools/org.apache.polygene.tool.shell/@version@/$JARNAME
- else
- if [ -f bin/$JARNAME ] ; then
- JARFILE=bin/$JARNAME
- else
- fi
- fi
- # Restore the current directory
- cd $CWD
-
- java -Dpolygene.home=$POLYGENEPATH -jar $POLYGENEPATH/$JARFILE "$@"
-fi
-
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_
deleted file mode 100644
index 1fed99b..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/app/build.gradle_
+++ /dev/null
@@ -1,22 +0,0 @@
-
-plugins {
- id 'war'
- id "org.akhikhl.gretty" version "1.4.0"
-}
-
-dependencies {
- compile project( ":bootstrap" )
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.servlet:$polygeneVersion"
-
- compile "javax.servlet:servlet-api:2.5"
- compile "org.restlet.jee:org.restlet:2.3.4"
-
- runtime "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
- runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4"
-
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html b/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html
deleted file mode 100644
index 1f859fb..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/app/src/main/java/__package__/app/package.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html>
-<body>This package contains the bootstrap code.</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/app/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html b/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html
deleted file mode 100644
index 8bb0a631..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/app/src/test/java/__package__/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html><body>Test directory</body></html>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_
deleted file mode 100644
index 37ddd9e..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/build.gradle_
+++ /dev/null
@@ -1,16 +0,0 @@
-
-dependencies {
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
-
-
- compile "org.apache.polygene.library:org.apache.polygene.library.fileconfig:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.entitystore-file:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.indexing-rdf:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.valueserialization-jackson:$polygeneVersion"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
deleted file mode 100644
index e4bffa5..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Config layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
deleted file mode 100644
index 21dbaa9..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Connectivity layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
deleted file mode 100644
index 2bdc426..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Domain layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
deleted file mode 100644
index cf2f9b5..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Infrastructure layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/bootstrap/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/build.gradle_
deleted file mode 100644
index c5b2044..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/build.gradle_
+++ /dev/null
@@ -1,23 +0,0 @@
-
-version = 1.0
-
-rootProject.ext {
- polygeneVersion = @version@
-}
-
-allprojects() {
- apply plugin: 'java'
- apply plugin: 'maven'
-
- repositories {
- mavenLocal()
- mavenCentral()
- maven { name 'restlet-repo'; url 'http://maven.restlet.org/' }
- }
-
- dependencies {
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- testCompile "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_
deleted file mode 100644
index 0087cd3..0000000
Binary files a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.jar_ and /dev/null differ
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_
deleted file mode 100644
index fafa8dd..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/gradle/wrapper/gradle-wrapper.properties_
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Jul 06 10:43:59 EEST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_
deleted file mode 100644
index 8a0b282..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/gradlew.bat_
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/gradlew_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/gradlew_ b/tools/shell/src/dist/etc/templates/default/files/gradlew_
deleted file mode 100755
index 91a7e26..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/gradlew_
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_ b/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_
deleted file mode 100644
index 83f55b2..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/model/build.gradle_
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-dependencies {
-
- compile "org.restlet.jee:org.restlet:2.3.4"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_
deleted file mode 100644
index 441cb85..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/orders/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Domain Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_
deleted file mode 100644
index bcf0ee4..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/model/src/main/java/__package__/model/security/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Very simple Security Model to showcase the features of the Restlet library</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/default/files/model/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/default/files/model/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/default/template.properties
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/default/template.properties b/tools/shell/src/dist/etc/templates/default/template.properties
deleted file mode 100644
index f49a548..0000000
--- a/tools/shell/src/dist/etc/templates/default/template.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-#
-
-
-creator.class=org.apache.polygene.tools.shell.create.project.DefaultProjectCreator
-
-template.dir=etc/templates/default/files
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/build.gradle_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/build.gradle_
deleted file mode 100644
index 1fed99b..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/build.gradle_
+++ /dev/null
@@ -1,22 +0,0 @@
-
-plugins {
- id 'war'
- id "org.akhikhl.gretty" version "1.4.0"
-}
-
-dependencies {
- compile project( ":bootstrap" )
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.servlet:$polygeneVersion"
-
- compile "javax.servlet:servlet-api:2.5"
- compile "org.restlet.jee:org.restlet:2.3.4"
-
- runtime "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
- runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4"
-
-}
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/java/__package__/app/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/java/__package__/app/package.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/java/__package__/app/package.html
deleted file mode 100644
index 1f859fb..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/java/__package__/app/package.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html>
-<body>This package contains the bootstrap code.</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/WEB-INF/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/WEB-INF/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/WEB-INF/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.css
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.css b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.css
deleted file mode 100644
index cb651f5..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.css
+++ /dev/null
@@ -1,34 +0,0 @@
-nav a {
- padding: 5px 10px;
- text-decoration: none;
- margin-top: 10px;
- display: inline-block;
- background-color: #eee;
- border-radius: 4px;
-}
-nav a:visited, a:link {
- color: #607D8B;
-}
-nav a:hover {
- color: #039be5;
- background-color: #CFD8DC;
-}
-nav a.router-link-active {
- color: #039be5;
-}
-h1 {
- font-size: 1.2em;
- color: #999;
- margin-bottom: 0;
-}
-h2 {
- font-size: 2em;
- margin-top: 0;
- padding-top: 0;
-}
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.ts
deleted file mode 100644
index 222874b..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/app.component.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import {Component} from 'angular2/core';
-import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
-import {HeroesComponent} from './heroes.component';
-import {HeroDetailComponent} from './hero-detail.component';
-import {DashboardComponent} from './dashboard.component';
-import {HeroService} from './hero.service';
-
-@Component({
- selector: 'my-app',
- template: `
- <h1>{{title}}</h1>
- <nav>
- <a [routerLink]="['Dashboard']">Dashboard</a>
- <a [routerLink]="['Heroes']">Heroes</a>
- </nav>
- <router-outlet></router-outlet>
- `,
- styleUrls: ['app/app.component.css'],
- directives: [ROUTER_DIRECTIVES],
- providers: [HeroService]
-})
-@RouteConfig([
- // {path: '/', redirectTo: ['Dashboard'] },
- {path: '/dashboard', name: 'Dashboard', component: DashboardComponent, useAsDefault: true},
- {path: '/heroes', name: 'Heroes', component: HeroesComponent},
- {path: '/detail/:id', name: 'HeroDetail', component: HeroDetailComponent}
-])
-export class AppComponent {
- title = 'Tour of Heroes';
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.css
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.css b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.css
deleted file mode 100644
index b9d3215..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.css
+++ /dev/null
@@ -1,67 +0,0 @@
-[class*='col-'] {
- float: left;
-}
-*, *:after, *:before {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-h3 {
- text-align: center; margin-bottom: 0;
-}
-[class*='col-'] {
- padding-right: 20px;
- padding-bottom: 20px;
-}
-[class*='col-']:last-of-type {
- padding-right: 0;
-}
-.grid {
- margin: 0;
-}
-.col-1-4 {
- width: 25%;
-}
-.module {
- padding: 20px;
- text-align: center;
- color: #eee;
- max-height: 120px;
- min-width: 120px;
- background-color: #607D8B;
- border-radius: 2px;
-}
-h4 {
- position: relative;
-}
-.module:hover {
- background-color: #EEE;
- cursor: pointer;
- color: #607d8b;
-}
-.grid-pad {
- padding: 10px 0;
-}
-.grid-pad > [class*='col-']:last-of-type {
- padding-right: 20px;
-}
-@media (max-width: 600px) {
- .module {
- font-size: 10px;
- max-height: 75px; }
-}
-@media (max-width: 1024px) {
- .grid {
- margin: 0;
- }
- .module {
- min-width: 60px;
- }
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.html
deleted file mode 100644
index 3fc7517..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<h3>Top Heroes</h3>
-<div class="grid grid-pad">
- <div *ngFor="#hero of heroes" class="col-1-4" (click)="gotoDetail(hero)">
- <div class="module hero">
- <h4>{{hero.name}}</h4>
- </div>
- </div>
-</div>
-
-
-<!--
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
--->
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.ts
deleted file mode 100644
index c8160d1..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/dashboard.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import {Component, OnInit} from 'angular2/core';
-import {Router} from 'angular2/router';
-import {Hero} from './hero';
-import {HeroService} from './hero.service';
-
-@Component({
- selector: 'my-dashboard',
- templateUrl: 'app/dashboard.component.html',
- styleUrls: ['app/dashboard.component.css']
-})
-export class DashboardComponent implements OnInit {
- heroes: Hero[] = [];
-
- constructor(private _heroService: HeroService, private _router: Router) { }
-
- ngOnInit() {
- this._heroService.getHeroes().then(heroes => this.heroes = heroes.slice(1,5));
- }
-
- gotoDetail(hero: Hero) {
- let link = ['HeroDetail', { id: hero.id }];
- this._router.navigate(link);
- }
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.css
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.css b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.css
deleted file mode 100644
index 2a0e285..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.css
+++ /dev/null
@@ -1,36 +0,0 @@
-label {
- display: inline-block;
- width: 3em;
- margin: .5em 0;
- color: #607D8B;
- font-weight: bold;
-}
-input {
- height: 2em;
- font-size: 1em;
- padding-left: .4em;
-}
-button {
- margin-top: 20px;
- font-family: Arial;
- background-color: #eee;
- border: none;
- padding: 5px 10px;
- border-radius: 4px;
- cursor: pointer; cursor: hand;
-}
-button:hover {
- background-color: #cfd8dc;
-}
-button:disabled {
- background-color: #eee;
- color: #ccc;
- cursor: auto;
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.html
deleted file mode 100644
index 1e85e75..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<div *ngIf="hero">
- <h2>{{hero.name}} details!</h2>
- <div>
- <label>id: </label>{{hero.id}}</div>
- <div>
- <label>name: </label>
- <input [(ngModel)]="hero.name" placeholder="name"/>
- </div>
- <button (click)="goBack()">Back</button>
-</div>
-
-<!--
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
--->
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.ts
deleted file mode 100644
index 0181847..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero-detail.component.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {Component, OnInit} from 'angular2/core';
-import {RouteParams} from 'angular2/router';
-
-import {Hero} from './hero';
-import {HeroService} from './hero.service';
-
-@Component({
- selector: 'my-hero-detail',
- templateUrl: 'app/hero-detail.component.html',
- styleUrls: ['app/hero-detail.component.css']
-})
-export class HeroDetailComponent implements OnInit {
- hero: Hero;
-
- constructor(private _heroService: HeroService,
- private _routeParams: RouteParams) {
- }
-
- ngOnInit() {
- let id = +this._routeParams.get('id');
- this._heroService.getHero(id).then(hero => this.hero = hero);
- }
-
- goBack() {
- window.history.back();
- }
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.service.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.service.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.service.ts
deleted file mode 100644
index aee78a1..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.service.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import {Injectable} from 'angular2/core';
-import {HEROES} from './mock-heroes';
-
-@Injectable()
-export class HeroService {
- getHeroes() {
- return Promise.resolve(HEROES);
- }
-
- getHero(id: number) {
- return Promise.resolve(HEROES).then(
- heroes => heroes.filter(hero => hero.id === id)[0]
- );
- }
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.ts
deleted file mode 100644
index 812726c..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/hero.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export class Hero {
- id: number;
- name: string;
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.css
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.css b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.css
deleted file mode 100644
index 98e7ecc..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.css
+++ /dev/null
@@ -1,66 +0,0 @@
-.selected {
- background-color: #CFD8DC !important;
- color: white;
-}
-.heroes {
- margin: 0 0 2em 0;
- list-style-type: none;
- padding: 0;
- width: 15em;
-}
-.heroes li {
- cursor: pointer;
- position: relative;
- left: 0;
- background-color: #EEE;
- margin: .5em;
- padding: .3em 0;
- height: 1.6em;
- border-radius: 4px;
-}
-.heroes li:hover {
- color: #607D8B;
- background-color: #DDD;
- left: .1em;
-}
-.heroes li.selected:hover {
- background-color: #BBD8DC !important;
- color: white;
-}
-.heroes .text {
- position: relative;
- top: -3px;
-}
-.heroes .badge {
- display: inline-block;
- font-size: small;
- color: white;
- padding: 0.8em 0.7em 0 0.7em;
- background-color: #607D8B;
- line-height: 1em;
- position: relative;
- left: -1px;
- top: -4px;
- height: 1.8em;
- margin-right: .8em;
- border-radius: 4px 0 0 4px;
-}
-button {
- font-family: Arial;
- background-color: #eee;
- border: none;
- padding: 5px 10px;
- border-radius: 4px;
- cursor: pointer;
- cursor: hand;
-}
-button:hover {
- background-color: #cfd8dc;
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.html
deleted file mode 100644
index 0688e6a..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<div>
- <h2>My Heroes</h2>
- <ul class="heroes">
- <li *ngFor="#hero of heroes"
- [class.selected]="hero === selectedHero"
- (click)="onSelect(hero)">
- <span class="badge">{{hero.id}}</span> {{hero.name}}
- </li>
- </ul>
- <div *ngIf="selectedHero">
- <h2>{{selectedHero.name | uppercase}} is my hero</h2>
- <button (click)="gotoDetail()">View Details</button>
- </div>
-</div>
-
-
-<!--
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
--->
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.ts
deleted file mode 100644
index 0002025..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/heroes.component.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import {Component, OnInit} from 'angular2/core';
-import {Router} from 'angular2/router';
-import {HeroService} from './hero.service';
-import {HeroDetailComponent} from './hero-detail.component';
-import {Hero} from './hero';
-
-@Component({
- selector: 'my-heroes',
- templateUrl: 'app/heroes.component.html',
- styleUrls: ['app/heroes.component.css'],
- directives: [HeroDetailComponent]
-})
-export class HeroesComponent implements OnInit {
- heroes: Hero[];
- selectedHero: Hero;
-
- constructor(private _heroService: HeroService, private _router: Router) { }
-
- getHeroes() {
- this._heroService.getHeroes().then(heroes => this.heroes = heroes);
- }
-
- gotoDetail() {
- this._router.navigate(['HeroDetail', { id: this.selectedHero.id }]);
- }
-
- ngOnInit() {
- this.getHeroes();
- }
-
- onSelect(hero: Hero) { this.selectedHero = hero; }
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/main.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/main.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/main.ts
deleted file mode 100644
index 95e2d0b..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/main.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import {bootstrap} from 'angular2/platform/browser';
-import {ROUTER_PROVIDERS} from 'angular2/router';
-import {HeroService} from './hero.service';
-import {AppComponent} from './app.component';
-
-bootstrap(AppComponent, [
- ROUTER_PROVIDERS,
- HeroService
-]);
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/mock-heroes.ts
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/mock-heroes.ts b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/mock-heroes.ts
deleted file mode 100644
index 673cf53..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/app/mock-heroes.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Hero } from './hero';
-
-export var HEROES: Hero[] = [
- {"id": 11, "name": "Mr. Nice"},
- {"id": 12, "name": "Narco"},
- {"id": 13, "name": "Bombasto"},
- {"id": 14, "name": "Celeritas"},
- {"id": 15, "name": "Magneta"},
- {"id": 16, "name": "RubberMan"},
- {"id": 17, "name": "Dynama"},
- {"id": 18, "name": "Dr IQ"},
- {"id": 19, "name": "Magma"},
- {"id": 20, "name": "Tornado"}
-];
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/index.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/index.html
deleted file mode 100644
index 753dd48..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <script>document.write('<base href="' + document.location + '" />');</script>
- <title>Angular 2 Tour of Heroes</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="styles.css">
-
- <!-- IE required polyfills, in this exact order -->
- <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js"></script>
- <script src="https://npmcdn.com/angular2@2.0.0-beta.15/es6/dev/src/testing/shims_for_IE.js"></script>
-
- <script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system.js"></script>
- <script src="https://npmcdn.com/typescript@1.8.10/lib/typescript.js"></script>
- <script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
- <script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
- <script src="https://code.angularjs.org/2.0.0-beta.15/router.dev.js"></script>
- <script>
- System.config({
- transpiler: 'typescript',
- typescriptOptions: { emitDecoratorMetadata: true },
- packages: {'app': {defaultExtension: 'ts'}}
- });
- System.import('app/main')
- .then(null, console.error.bind(console));
- </script>
- </head>
-
- <body>
- <my-app>Loading...</my-app>
- </body>
-</html>
-
-
-<!--
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
--->
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/styles.css
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/styles.css b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/styles.css
deleted file mode 100644
index 1774fd6..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/main/webapp/styles.css
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Master Styles */
-h1 {
- color: #369;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 250%;
-}
-h2, h3 {
- color: #444;
- font-family: Arial, Helvetica, sans-serif;
- font-weight: lighter;
-}
-body {
- margin: 2em;
-}
-body, input[text], button {
- color: #888;
- font-family: Cambria, Georgia;
-}
-a {
- cursor: pointer;
- cursor: hand;
-}
-button {
- font-family: Arial;
- background-color: #eee;
- border: none;
- padding: 5px 10px;
- border-radius: 4px;
- cursor: pointer;
- cursor: hand;
-}
-button:hover {
- background-color: #cfd8dc;
-}
-button:disabled {
- background-color: #eee;
- color: #aaa;
- cursor: auto;
-}
-
-/* Navigation link styles */
-nav a {
- padding: 5px 10px;
- text-decoration: none;
- margin-top: 10px;
- display: inline-block;
- background-color: #eee;
- border-radius: 4px;
-}
-nav a:visited, a:link {
- color: #607D8B;
-}
-nav a:hover {
- color: #039be5;
- background-color: #CFD8DC;
-}
-nav a.router-link-active {
- color: #039be5;
-}
-
-/* items class */
-.items {
- margin: 0 0 2em 0;
- list-style-type: none;
- padding: 0;
- width: 24em;
-}
-.items li {
- cursor: pointer;
- position: relative;
- left: 0;
- background-color: #EEE;
- margin: .5em;
- padding: .3em 0;
- height: 1.6em;
- border-radius: 4px;
-}
-.items li:hover {
- color: #607D8B;
- background-color: #DDD;
- left: .1em;
-}
-.items li.selected:hover {
- background-color: #BBD8DC;
- color: white;
-}
-.items .text {
- position: relative;
- top: -3px;
-}
-.items {
- margin: 0 0 2em 0;
- list-style-type: none;
- padding: 0;
- width: 24em;
-}
-.items li {
- cursor: pointer;
- position: relative;
- left: 0;
- background-color: #EEE;
- margin: .5em;
- padding: .3em 0;
- height: 1.6em;
- border-radius: 4px;
-}
-.items li:hover {
- color: #607D8B;
- background-color: #DDD;
- left: .1em;
-}
-.items li.selected {
- background-color: #CFD8DC;
- color: white;
-}
-
-.items li.selected:hover {
- background-color: #BBD8DC;
-}
-.items .text {
- position: relative;
- top: -3px;
-}
-.items .badge {
- display: inline-block;
- font-size: small;
- color: white;
- padding: 0.8em 0.7em 0 0.7em;
- background-color: #607D8B;
- line-height: 1em;
- position: relative;
- left: -1px;
- top: -4px;
- height: 1.8em;
- margin-right: .8em;
- border-radius: 4px 0 0 4px;
-}
-
-/* everywhere else */
-* {
- font-family: Arial, Helvetica, sans-serif;
-}
-
-
-/*
-Copyright 2016 Google Inc. All Rights Reserved.
-Use of this source code is governed by an MIT-style license that
-can be found in the LICENSE file at http://angular.io/license
-*/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/test/java/__package__/package.html
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/test/java/__package__/package.html b/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/test/java/__package__/package.html
deleted file mode 100644
index 8bb0a631..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/app/src/test/java/__package__/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- ~
- -->
-
-<html><body>Test directory</body></html>
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/build.gradle_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/build.gradle_
deleted file mode 100644
index 37ddd9e..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/build.gradle_
+++ /dev/null
@@ -1,16 +0,0 @@
-
-dependencies {
- compile project( ":model" )
- compile project( ":rest" )
-
- compile "org.apache.polygene.core:org.apache.polygene.core.spi:$polygeneVersion"
- compile "org.apache.polygene.core:org.apache.polygene.core.bootstrap:$polygeneVersion"
-
-
- compile "org.apache.polygene.library:org.apache.polygene.library.fileconfig:$polygeneVersion"
- compile "org.apache.polygene.library:org.apache.polygene.library.restlet:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.entitystore-file:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.indexing-rdf:$polygeneVersion"
- compile "org.apache.polygene.extension:org.apache.polygene.extension.valueserialization-jackson:$polygeneVersion"
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
deleted file mode 100644
index e4bffa5..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/config/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Config layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
deleted file mode 100644
index 21dbaa9..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/connectivity/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Connectivity layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
deleted file mode 100644
index 2bdc426..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/domain/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Domain layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
deleted file mode 100644
index cf2f9b5..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/java/__package__/bootstrap/infrastructure/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>This package contains the assembly information for the Infrastructure layer.</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/resources/___placeholder___
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/resources/___placeholder___ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/main/resources/___placeholder___
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/test/java/__package__/package.html_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/test/java/__package__/package.html_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/test/java/__package__/package.html_
deleted file mode 100644
index 300838d..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/bootstrap/src/test/java/__package__/package.html_
+++ /dev/null
@@ -1 +0,0 @@
-<html><body>Tests package</body></html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/build.gradle_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/build.gradle_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/build.gradle_
deleted file mode 100644
index c5b2044..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/build.gradle_
+++ /dev/null
@@ -1,23 +0,0 @@
-
-version = 1.0
-
-rootProject.ext {
- polygeneVersion = @version@
-}
-
-allprojects() {
- apply plugin: 'java'
- apply plugin: 'maven'
-
- repositories {
- mavenLocal()
- mavenCentral()
- maven { name 'restlet-repo'; url 'http://maven.restlet.org/' }
- }
-
- dependencies {
- compile "org.apache.polygene.core:org.apache.polygene.core.api:$polygeneVersion"
- testCompile "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
- }
-}
-
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.jar_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.jar_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.jar_
deleted file mode 100644
index 0087cd3..0000000
Binary files a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.jar_ and /dev/null differ
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.properties_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.properties_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.properties_
deleted file mode 100644
index fafa8dd..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradle/wrapper/gradle-wrapper.properties_
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Jul 06 10:43:59 EEST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/ea639e83/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew.bat_
----------------------------------------------------------------------
diff --git a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew.bat_ b/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew.bat_
deleted file mode 100644
index 8a0b282..0000000
--- a/tools/shell/src/dist/etc/templates/ng2-heroes/files/gradlew.bat_
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
[06/15] polygene-java git commit: Wrong labeling in yeoman generator
Posted by ni...@apache.org.
Wrong labeling in yeoman generator
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/96d03dfe
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/96d03dfe
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/96d03dfe
Branch: refs/heads/develop
Commit: 96d03dfe85a03763b972481a508c94ee3d5edb63
Parents: 5cf3392
Author: niclas <ni...@spicter.com>
Authored: Sun Feb 12 16:40:43 2017 +0800
Committer: niclas <ni...@spicter.com>
Committed: Sun Feb 12 16:40:43 2017 +0800
----------------------------------------------------------------------
tools/generator-polygene/app/index.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/96d03dfe/tools/generator-polygene/app/index.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js
index 73f44e6..4d57562 100644
--- a/tools/generator-polygene/app/index.js
+++ b/tools/generator-polygene/app/index.js
@@ -89,7 +89,7 @@ module.exports = generators.Base.extend(
'Solr',
'SQL'
],
- message: 'Which caching system do you want to use?'
+ message: 'Which indexing system do you want to use?'
},
{
type: 'list',
@@ -99,7 +99,7 @@ module.exports = generators.Base.extend(
'memcache',
'ehcache'
],
- message: 'Which serialization system do you want to use?'
+ message: 'Which caching system do you want to use?'
},
{
type: 'list',
@@ -109,7 +109,7 @@ module.exports = generators.Base.extend(
'Stax',
'OrgJson'
],
- message: 'Which indexing system do you want to use?'
+ message: 'Which serialization system do you want to use?'
},
{
type: 'checkbox',
@@ -157,7 +157,7 @@ module.exports = generators.Base.extend(
copyEntityStore( this, polygene.entitystore );
- copyPolygeneBootstrap( this, "infrastructure", "RdfIndexingModule", hasIndexing( 'Rdf' ) );
+ copyPolygeneBootstrap( this, "infrastructure", "RDFIndexingModule", hasIndexing( 'Rdf' ) );
copyPolygeneBootstrap( this, "infrastructure", "ElasticSearchIndexingModule", hasIndexing( 'Elasticsearch' ) );
copyPolygeneBootstrap( this, "infrastructure", "SolrIndexingModule", hasIndexing( 'Solr' ) );
copyPolygeneBootstrap( this, "infrastructure", "SqlIndexingModule", hasIndexing( 'Sql' ) );
[03/15] polygene-java git commit: Merge remote-tracking branch
'origin/develop' into develop
Posted by ni...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/1ada97d0
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/1ada97d0
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/1ada97d0
Branch: refs/heads/develop
Commit: 1ada97d03640b816c20f463eaf029828f6ced0f2
Parents: 4e619fb 21c6a0b
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Thu Jan 12 21:05:48 2017 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Thu Jan 12 21:05:48 2017 +0800
----------------------------------------------------------------------
buildSrc/build.gradle | 1 +
.../apache/polygene/gradle/BasePlugin.groovy | 2 +
.../polygene/gradle/code/CodePlugin.groovy | 1 +
.../dependencies/PolygeneExtension.groovy | 12 +++
.../distributions/DistributionsPlugin.groovy | 1 +
.../internals/InternalDockerPlugin.groovy | 78 ++++++++++++++++++++
.../polygene-internal-docker.properties | 18 +++++
.../polygene/test/util/FreePortFinder.java | 2 +-
dependencies.gradle | 4 +-
extensions/cache-memcache/build.gradle | 2 +-
.../cache/memcache/MemcacheCachePoolTest.java | 17 ++---
extensions/entitystore-redis/build.gradle | 2 +-
.../redis/RedisMapEntityStoreTest.java | 20 ++---
.../redis/RedisMapEntityStoreWithCacheTest.java | 18 ++---
extensions/entitystore-riak/build.gradle | 2 +-
.../riak/RiakMapEntityStoreMixin.java | 54 +++++++-------
.../riak/RiakMapEntityStoreTest.java | 49 ++++++++----
.../riak/RiakMapEntityStoreWithCacheTest.java | 42 +++++++----
extensions/entitystore-sql/build.gradle | 2 +-
.../internal/MySQLDatabaseSQLServiceMixin.java | 2 +-
.../entitystore/sql/MySQLEntityStoreTest.java | 48 ++++++------
.../sql/PostgreSQLEntityStoreTest.java | 19 +++--
.../test/resources/mysql-datasource.properties | 2 +-
.../resources/postgresql-datasource.properties | 1 -
extensions/indexing-sql/build.gradle | 2 +-
.../postgresql/PostgreSQLComplexQueryTest.java | 16 ++--
.../postgresql/PostgreSQLDBIntegrityTest.java | 22 +++---
.../postgresql/PostgreSQLEntityFinderTest.java | 14 ++--
.../sql/postgresql/PostgreSQLQueryTest.java | 20 +++--
.../index/sql/postgresql/SQLTestHelper.java | 17 +++--
.../resources/postgres-datasource.properties | 2 +-
gradle/wrapper/gradle-wrapper.properties | 2 +-
internals/testsupport-internal/build.gradle | 27 +++++++
.../src/main/docker/memcached/Dockerfile | 16 ++++
.../src/main/docker/mysql/Dockerfile | 16 ++++
.../src/main/docker/postgres/Dockerfile | 17 +++++
.../src/main/docker/postgres/init-test-db.sh | 29 ++++++++
.../src/main/docker/redis/Dockerfile | 16 ++++
.../src/main/docker/riak/Dockerfile | 16 ++++
.../polygene/test/internal/DockerRule.java | 74 +++++++++++++++++++
.../apache/polygene/test/internal/package.html | 25 +++++++
.../src/docs/tutorials/howto-build-system.txt | 25 ++++---
settings.gradle | 2 +
43 files changed, 571 insertions(+), 186 deletions(-)
----------------------------------------------------------------------