You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/12/06 18:42:17 UTC
[24/52] [partial] ISIS-188: moving framework/ subdirs up to parent
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java b/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
new file mode 100644
index 0000000..791ffd3
--- /dev/null
+++ b/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
@@ -0,0 +1,152 @@
+/*
+ * 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.isis.runtimes.dflt.profilestores.xml.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.runtime.authentication.AuthenticationManager;
+import org.apache.isis.core.runtime.authorization.AuthorizationManager;
+import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
+import org.apache.isis.core.runtime.userprofile.Options;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
+import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContextStatic;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
+import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSessionFactoryDefault;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jmock.auto.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class UserProfileDataHandlerTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ private TemplateImageLoader mockTemplateImageLoader;
+ @Mock
+ private SpecificationLoaderSpi mockSpecificationLoader;
+ @Mock
+ private AuthenticationManager mockAuthenticationManager;
+ @Mock
+ private AuthorizationManager mockAuthorizationManager;
+ @Mock
+ private UserProfileLoader mockUserProfileLoader;
+ @Mock
+ private PersistenceSessionFactory mockPersistenceSessionFactory;
+
+ private TestServiceObject1 service;
+ private UserProfile profile;
+
+
+ @Before
+ public void setup() throws Exception {
+ Logger.getRootLogger().setLevel(Level.OFF);
+ service = new TestServiceObject1();
+ final IsisSessionFactory executionContextFactory = new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(), mockTemplateImageLoader, mockSpecificationLoader, mockAuthenticationManager,
+ mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, Arrays.<Object>asList(service), new OidMarshaller());
+
+ IsisContextStatic.createRelaxedInstance(executionContextFactory);
+
+ final XMLReader parser = XMLReaderFactory.createXMLReader();
+ final UserProfileDataHandler handler = new UserProfileDataHandler();
+ parser.setContentHandler(handler);
+ parser.parse(new InputSource(new InputStreamReader(new FileInputStream("test.xml"))));
+
+ profile = handler.getUserProfile();
+ }
+
+ @Test
+ public void stringOption() throws Exception {
+ assertEquals("on", profile.getOptions().getString("power"));
+ }
+
+ @Test
+ public void unknownOptionReturnsNull() throws Exception {
+ assertEquals(null, profile.getOptions().getString("device"));
+ }
+
+ @Test
+ public void integerOption() throws Exception {
+ assertEquals(50, profile.getOptions().getInteger("height", 10));
+ }
+
+ @Test
+ public void unknownIntegerReturnsDefault() throws Exception {
+ assertEquals(30, profile.getOptions().getInteger("width", 30));
+ }
+
+ @Test
+ public void unknownOptionsCreated() throws Exception {
+ final Options options = profile.getOptions().getOptions("");
+ assertNotNull(options);
+ assertEquals(false, options.names().hasNext());
+ }
+
+ @Test
+ public void containedOptions() throws Exception {
+ final Options options = profile.getOptions().getOptions("opts");
+ assertNotNull(options);
+ assertEquals("value1", options.getString("option1"));
+ assertEquals("value2", options.getString("option2"));
+ }
+
+ @Test
+ public void recursiveOptions() throws Exception {
+ Options options = profile.getOptions().getOptions("opts");
+ options = options.getOptions("options3");
+ assertEquals("value4", options.getString("option4"));
+ assertEquals("value5", options.getString("option5"));
+ }
+
+ @Test
+ public void profileNames() throws Exception {
+ final List<String> list = profile.list();
+ assertEquals(2, list.size());
+ assertEquals("Library", list.get(0));
+ assertEquals("Admin", list.get(1));
+ }
+
+ @Test
+ public void perspective() throws Exception {
+ assertEquals("Admin", profile.getPerspective().getName());
+ assertEquals(1, profile.getPerspective().getServices().size());
+ assertEquals(service, profile.getPerspective().getServices().get(0));
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/profilestore/xml/test.xml
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/test.xml b/component/profilestore/xml/test.xml
new file mode 100644
index 0000000..12fcca4
--- /dev/null
+++ b/component/profilestore/xml/test.xml
@@ -0,0 +1,53 @@
+<?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.
+-->
+
+<profile>
+ <options>
+ <option id="power">on</option>
+ <option id="height">50</option>
+ <options id="opts">
+ <option id="option1">value1</option>
+ <options id="options3">
+ <option id="option4">value4</option>
+ <option id="option5">value5</option>
+ </options>
+ <option id="option2">value2</option>
+ </options>
+ </options>
+ <perspectives>
+ <perspective name="Library">
+ <services>
+ <service id="Service one"/>
+ <service id="Service two"/>
+ <service id="Service three"/>
+ </services>
+ <objects>
+ </objects>
+ </perspective>
+ <perspective name="Admin">
+ <services>
+ <service id="repository#org.apache.isis.xmlpersistence.profilestore.TestServiceObject"/>
+ <service id="test service"/>
+ </services>
+ <objects>
+ </objects>
+ </perspective>
+ </perspectives>
+</profile>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/NOTICE
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/NOTICE b/component/progmodel/groovy/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/component/progmodel/groovy/NOTICE
@@ -0,0 +1,7 @@
+Apache Isis
+Copyright 2010-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/NOTICE
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/NOTICE b/component/progmodel/groovy/applib/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/component/progmodel/groovy/applib/NOTICE
@@ -0,0 +1,7 @@
+Apache Isis
+Copyright 2010-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/pom.xml
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/pom.xml b/component/progmodel/groovy/applib/pom.xml
new file mode 100644
index 0000000..a1fd534
--- /dev/null
+++ b/component/progmodel/groovy/applib/pom.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>groovy-applib</artifactId>
+ <name>Groovy ProgModel AppLib</name>
+
+ <properties>
+ <siteBaseDir>..</siteBaseDir>
+ <relativeUrl>applib/</relativeUrl>
+ </properties>
+
+ <!-- used in Site generation for relative references. -->
+ <url>http://incubator.apache.org/isis/${relativeUrl}</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis</groupId>
+ <artifactId>applib</artifactId>
+ </dependency>
+
+ <!-- is marked as optional in parent, so not exported as a transitive dependency -->
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/src/main/java/org/apache/isis/progmodel/groovy/applib/DomainObjectBuilder.java
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/src/main/java/org/apache/isis/progmodel/groovy/applib/DomainObjectBuilder.java b/component/progmodel/groovy/applib/src/main/java/org/apache/isis/progmodel/groovy/applib/DomainObjectBuilder.java
new file mode 100644
index 0000000..f5698d6
--- /dev/null
+++ b/component/progmodel/groovy/applib/src/main/java/org/apache/isis/progmodel/groovy/applib/DomainObjectBuilder.java
@@ -0,0 +1,72 @@
+/*
+ * 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.isis.progmodel.groovy.applib;
+
+import groovy.util.ObjectGraphBuilder;
+
+import java.util.Map;
+
+import org.apache.isis.applib.DomainObjectContainer;
+
+public class DomainObjectBuilder<T> extends ObjectGraphBuilder {
+
+ private final DomainObjectContainer container;
+
+ public DomainObjectBuilder(final DomainObjectContainer container, final Class<?>... classes) {
+ this.container = container;
+ final ClassNameResolver classNameResolver = new ClassNameResolver() {
+ @Override
+ public String resolveClassname(final String classname) {
+ for (final Class<?> cls : classes) {
+ final String packageName = cls.getPackage().getName();
+ final String fqcn = packageName + "." + upperFirst(classname);
+ try {
+ Thread.currentThread().getContextClassLoader().loadClass(fqcn);
+ return fqcn;
+ } catch (final ClassNotFoundException ex) {
+ // continue
+ }
+ }
+ throw new RuntimeException("could not resolve " + classname + "'");
+ }
+
+ };
+ this.setClassNameResolver(classNameResolver);
+ final NewInstanceResolver instanceResolver = new DefaultNewInstanceResolver() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object newInstance(final Class cls, final Map attributes) throws InstantiationException, IllegalAccessException {
+ return container.newTransientInstance(cls);
+ }
+ };
+ this.setNewInstanceResolver(instanceResolver);
+ }
+
+ private static String upperFirst(final String name) {
+ return name.substring(0, 1).toUpperCase() + name.substring(1);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Object createNode(final Object arg0, final Map arg1, final Object arg2) {
+ final Object domainObject = super.createNode(arg0, arg1, arg2);
+ container.persistIfNotAlready(domainObject);
+ return domainObject;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/src/site/apt/index.apt b/component/progmodel/groovy/applib/src/site/apt/index.apt
new file mode 100644
index 0000000..31ab5b9
--- /dev/null
+++ b/component/progmodel/groovy/applib/src/site/apt/index.apt
@@ -0,0 +1,29 @@
+~~ 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.
+
+Documentation
+
+ The <Groovy Objects> applib defines:
+
+ * helper classes for writing fixtures
+
+ * a transitive dependency to the <Isis> applib
+
+ []
+
+ See the {{{../../docbkx/html/guide/isis-progmodels.html}Isis Programming Model user guide}} for more information.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/src/site/apt/jottings.apt
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/src/site/apt/jottings.apt b/component/progmodel/groovy/applib/src/site/apt/jottings.apt
new file mode 100644
index 0000000..c5d1200
--- /dev/null
+++ b/component/progmodel/groovy/applib/src/site/apt/jottings.apt
@@ -0,0 +1,24 @@
+~~ 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.
+
+
+
+Jottings
+
+ This page is to capture any random jottings relating to this module prior
+ to being moved into formal documentation.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/applib/src/site/site.xml
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/applib/src/site/site.xml b/component/progmodel/groovy/applib/src/site/site.xml
new file mode 100644
index 0000000..725e8ca
--- /dev/null
+++ b/component/progmodel/groovy/applib/src/site/site.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.
+-->
+<project name="${project.name}">
+ <body>
+ <breadcrumbs>
+ <item name="Applib" href="index.html"/>
+ </breadcrumbs>
+
+ <menu name="Groovy Applib">
+ <item name="About" href="index.html" />
+ <item name="Jottings" href="jottings.html" />
+ </menu>
+
+ <menu name="Groovy Modules">
+ <item name="Applib" href="../groovy-applib/index.html" />
+ <item name="Metamodel" href="../groovy-metamodel/index.html" />
+ </menu>
+
+ <menu name="Maven Reports" ref="reports" />
+ </body>
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/NOTICE
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/NOTICE b/component/progmodel/groovy/metamodel/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/NOTICE
@@ -0,0 +1,7 @@
+Apache Isis
+Copyright 2010-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/pom.xml b/component/progmodel/groovy/metamodel/pom.xml
new file mode 100644
index 0000000..01765f0
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/pom.xml
@@ -0,0 +1,59 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>groovy-metamodel</artifactId>
+ <name>Groovy ProgModel MetaModel</name>
+
+ <properties>
+ <siteBaseDir>..</siteBaseDir>
+ <relativeUrl>metamodel/</relativeUrl>
+ </properties>
+
+ <!-- used in Site generation for relative references. -->
+ <url>http://incubator.apache.org/isis/${relativeUrl}</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy-applib</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-metamodel</artifactId>
+ </dependency>
+
+ <!-- is marked as optional in parent, so not exported as a transitive dependency -->
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/src/main/java/org/apache/isis/progmodel/groovy/metamodel/RemoveGroovyMethodsFacetFactory.java
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/src/main/java/org/apache/isis/progmodel/groovy/metamodel/RemoveGroovyMethodsFacetFactory.java b/component/progmodel/groovy/metamodel/src/main/java/org/apache/isis/progmodel/groovy/metamodel/RemoveGroovyMethodsFacetFactory.java
new file mode 100644
index 0000000..c2346af
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/src/main/java/org/apache/isis/progmodel/groovy/metamodel/RemoveGroovyMethodsFacetFactory.java
@@ -0,0 +1,115 @@
+/*
+ * 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.isis.progmodel.groovy.metamodel;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationAware;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+
+public class RemoveGroovyMethodsFacetFactory extends FacetFactoryAbstract implements IsisConfigurationAware {
+
+ private static final String DEPTH_KEY = "isis.groovy.depth";
+ private static final int DEPTH_DEFAULT = 5;
+
+ private IsisConfiguration configuration;
+
+ public RemoveGroovyMethodsFacetFactory() {
+ super(FeatureType.OBJECTS_ONLY);
+ }
+
+ static class MethodSpec {
+ static class Builder {
+
+ private final MethodSpec methodSpec = new MethodSpec();
+
+ public Builder param(final Class<?>... paramTypes) {
+ methodSpec.parameterTypes = paramTypes;
+ return this;
+ }
+
+ public Builder ret(final Class<?> returnType) {
+ methodSpec.returnType = returnType;
+ return this;
+ }
+
+ public MethodSpec build() {
+ return methodSpec;
+ }
+
+ public void remove(final MethodRemover remover) {
+ build().removeMethod(remover);
+ }
+ }
+
+ static Builder specFor(final String methodName) {
+ final Builder builder = new Builder();
+ builder.methodSpec.methodName = methodName;
+ return builder;
+ }
+
+ static Builder specFor(final String formatStr, final Object... args) {
+ return specFor(String.format(formatStr, args));
+ }
+
+ private String methodName;
+ private Class<?> returnType = void.class;
+ private Class<?>[] parameterTypes = new Class[0];
+
+ void removeMethod(final MethodRemover methodRemover) {
+ methodRemover.removeMethod(MethodScope.OBJECT, methodName, returnType, parameterTypes);
+ }
+ }
+
+ @Override
+ public void process(final ProcessClassContext processClassContext) {
+ MethodSpec.specFor("invokeMethod").param(String.class, Object.class).ret(Object.class).remove(processClassContext);
+ MethodSpec.specFor("getMetaClass").ret(groovy.lang.MetaClass.class).remove(processClassContext);
+ MethodSpec.specFor("setMetaClass").param(groovy.lang.MetaClass.class).remove(processClassContext);
+ MethodSpec.specFor("getProperty").param(String.class).ret(Object.class).remove(processClassContext);
+
+ final int depth = determineDepth();
+ for (int i = 1; i < depth; i++) {
+ MethodSpec.specFor("this$dist$invoke$%d", i).param(String.class, Object.class).ret(Object.class).remove(processClassContext);
+ MethodSpec.specFor("this$dist$set$%d", i).param(String.class, Object.class).remove(processClassContext);
+ MethodSpec.specFor("this$dist$get$%d", i).param(String.class).ret(Object.class).remove(processClassContext);
+ }
+ final Method[] methods = processClassContext.getCls().getMethods();
+ for (final Method method : methods) {
+ if (method.getName().startsWith("super$")) {
+ processClassContext.removeMethod(method);
+ }
+ }
+ }
+
+ private int determineDepth() {
+ final int depth = configuration.getInteger(DEPTH_KEY, DEPTH_DEFAULT);
+ return depth;
+ }
+
+ @Override
+ public void setConfiguration(final IsisConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/src/site/apt/index.apt b/component/progmodel/groovy/metamodel/src/site/apt/index.apt
new file mode 100644
index 0000000..2887427
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/src/site/apt/index.apt
@@ -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.
+
+Documentation
+
+ The <Groovy Objects> metamodel provides the customization required for <Isis> so that it can build the metamodel from
+ domain objects written in Groovy.
+
+ []
+
+ See the {{{../../docbkx/html/guide/isis-progmodels.html}Isis Programming Model user guide}} for more information.
+
+~~ See the {{{../gdocumentation}user guide}} for more information as to how this is configured.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/src/site/apt/jottings.apt
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/src/site/apt/jottings.apt b/component/progmodel/groovy/metamodel/src/site/apt/jottings.apt
new file mode 100644
index 0000000..c5d1200
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/src/site/apt/jottings.apt
@@ -0,0 +1,24 @@
+~~ 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.
+
+
+
+Jottings
+
+ This page is to capture any random jottings relating to this module prior
+ to being moved into formal documentation.
+
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/metamodel/src/site/site.xml
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/metamodel/src/site/site.xml b/component/progmodel/groovy/metamodel/src/site/site.xml
new file mode 100644
index 0000000..64831c1
--- /dev/null
+++ b/component/progmodel/groovy/metamodel/src/site/site.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.
+-->
+<project name="${project.name}">
+ <body>
+ <breadcrumbs>
+ <item name="MetaModel" href="index.html"/>
+ </breadcrumbs>
+
+ <menu name="Groovy MetaModel">
+ <item name="About" href="index.html" />
+ <item name="Jottings" href="jottings.html" />
+ </menu>
+
+ <menu name="Groovy Modules">
+ <item name="Applib" href="../groovy-applib/index.html" />
+ <item name="Metamodel" href="../groovy-metamodel/index.html" />
+ </menu>
+
+ <menu name="Maven Reports" ref="reports" />
+ </body>
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/pom.xml
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/pom.xml b/component/progmodel/groovy/pom.xml
new file mode 100644
index 0000000..445224e
--- /dev/null
+++ b/component/progmodel/groovy/pom.xml
@@ -0,0 +1,93 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.isis</groupId>
+ <artifactId>isis-parent</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ <relativePath>../../../isis-parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy</artifactId>
+
+ <name>Groovy ProgModel</name>
+
+ <packaging>pom</packaging>
+
+ <properties>
+ <siteBaseDir>.</siteBaseDir>
+ <relativeUrl/>
+
+ <groovy.version>2.0.5</groovy.version>
+ </properties>
+
+ <!-- used in Site generation for relative references. -->
+ <url>http://incubator.apache.org/isis/${relativeUrl}</url>
+
+ <modules>
+ <module>applib</module>
+ <module>metamodel</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <!-- Groovy Support -->
+ <dependency>
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy-applib</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.progmodels</groupId>
+ <artifactId>groovy-metamodel</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Apache Isis -->
+ <dependency>
+ <groupId>org.apache.isis</groupId>
+ <artifactId>applib</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-metamodel</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Groovy -->
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>${groovy.version}</version>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/ConvertToGroovy.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/ConvertToGroovy.png b/component/progmodel/groovy/src/docbkx/guide/images/ConvertToGroovy.png
new file mode 100644
index 0000000..11c0907
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/ConvertToGroovy.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/RemoveGroovyLibraryFromClasspath.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/RemoveGroovyLibraryFromClasspath.png b/component/progmodel/groovy/src/docbkx/guide/images/RemoveGroovyLibraryFromClasspath.png
new file mode 100644
index 0000000..37c0307
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/RemoveGroovyLibraryFromClasspath.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-bunch-of-projects.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-bunch-of-projects.png b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-bunch-of-projects.png
new file mode 100644
index 0000000..d22c320
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-bunch-of-projects.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-file-import.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-file-import.png b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-file-import.png
new file mode 100644
index 0000000..ac85fca
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-file-import.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-root-directory.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-root-directory.png b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-root-directory.png
new file mode 100644
index 0000000..4de753a
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/m2eclipse-root-directory.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/255ef514/component/progmodel/groovy/src/docbkx/guide/images/title.png
----------------------------------------------------------------------
diff --git a/component/progmodel/groovy/src/docbkx/guide/images/title.png b/component/progmodel/groovy/src/docbkx/guide/images/title.png
new file mode 100644
index 0000000..0e2b779
Binary files /dev/null and b/component/progmodel/groovy/src/docbkx/guide/images/title.png differ