diff --git a/.gitignore b/.gitignore index bd55eaca..5d2cd77e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ target .idea *.iml *.swp - +datanucleus.log \ No newline at end of file diff --git a/naked-objects/.gitattributes b/naked-objects/.gitattributes new file mode 100644 index 00000000..b1eafb69 --- /dev/null +++ b/naked-objects/.gitattributes @@ -0,0 +1,51 @@ +# +# +# text files are normalized (convert crlf => lf) +# binary files are not normalized (binary is a macro for -text -diff) +# +# + + +# Unless otherwise stated, assume text + +* text=auto + + +*.java text diff=java +*.html text diff=html +*.xhtml text diff=html +*.xml text +*.txt text + + +*.jar binary +*.so binary +*.dll binary + +# images +*.jpg binary +*.jpeg binary +*.png binary +*.pdn binary +*.pdn binary + + +*.cs text diff=csharp + +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + diff --git a/naked-objects/.gitignore b/naked-objects/.gitignore new file mode 100644 index 00000000..0558e54a --- /dev/null +++ b/naked-objects/.gitignore @@ -0,0 +1,42 @@ +*~ +*.swp +*.class +bin/ +target/ +target-ide/ +logs/ +.settings/ +.project +.classpath +.idea +*.iml + +JArchitectOut/ +*.jdproj + +neo4j_DB/ + +# log files +datanucleus.log +isis.log +i18n-po.log +hs_err_pid*.log + +# Package Files # +*.jar +*.war +*.ear + +dependency-reduced-pom.xml +pom.xml.tag +pom.xml.next +pom.xml.releaseBackup +pom.xml.versionsBackup + +.clover/ +*.jdproj +JArchitectOut/ + + +rebel.xml +/translations.pot diff --git a/naked-objects/dom/log4j.properties b/naked-objects/dom/log4j.properties new file mode 100644 index 00000000..ca165acc --- /dev/null +++ b/naked-objects/dom/log4j.properties @@ -0,0 +1,41 @@ +# 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. + +# LOG4J Configuration +# =================== + +# Basic logging goes to "datanucleus.log" +log4j.appender.A1=org.apache.log4j.FileAppender +log4j.appender.A1.File=datanucleus.log +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n +#log4j.appender.A1.Threshold=INFO + +# Categories +# Each category can be set to a "level", and to direct to an appender + +# Default to DEBUG level for all DataNucleus categories +log4j.logger.DataNucleus = DEBUG, A1 + +log4j.category.com.mchange.v2.c3p0=INFO, A1 +log4j.category.com.mchange.v2.resourcepool=INFO, A1 +log4j.category.org.logicalcobwebs.proxool=INFO,A1 + + +# Hbase libs logging +log4j.category.org.apache.hadoop=INFO,A1 +log4j.category.org.apache.zookeeper=INFO,A1 \ No newline at end of file diff --git a/naked-objects/dom/pom.xml b/naked-objects/dom/pom.xml new file mode 100644 index 00000000..8d3d866c --- /dev/null +++ b/naked-objects/dom/pom.xml @@ -0,0 +1,194 @@ + + + 4.0.0 + + + com.iluwatar + naked-objects + 1.0-SNAPSHOT + + + naked-objects-dom + Simple App DOM + + + + + src/main/resources + + + src/main/java + + ** + + + **/*.java + + + + + + + + org.apache.isis.core + isis-core-applib + + + + org.apache.isis.core + isis-core-unittestsupport + test + + + + + org.objenesis + objenesis + test + + + + org.assertj + assertj-core + test + + + + + + + enhance + + true + + + 4.0.0-release + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.datanucleus + datanucleus-maven-plugin + [${datanucleus-maven-plugin.version},) + + enhance + + + + + + + + + + + + + + + org.datanucleus + datanucleus-maven-plugin + ${datanucleus-maven-plugin.version} + + false + ${basedir}/log4j.properties + true + ${basedir}/datanucleus.properties + + + + process-classes + + enhance + + + + + + + + + org.datanucleus + datanucleus-core + + + org.datanucleus + datanucleus-jodatime + + + org.datanucleus + datanucleus-api-jdo + + + + + isis-validate + + + + + + org.apache.isis.tool + isis-maven-plugin + 1.9.0-SNAPSHOT + + ../webapp/src/main/webapp/WEB-INF + + + + org.apache.isis.example.application + simpleapp-dom + 1.9.0-SNAPSHOT + + + + com.google.guava + guava + 16.0.1 + + + + + test + + validate + + + + + + + + + + diff --git a/naked-objects/dom/src/main/java/META-INF/persistence.xml b/naked-objects/dom/src/main/java/META-INF/persistence.xml new file mode 100644 index 00000000..8824aa1a --- /dev/null +++ b/naked-objects/dom/src/main/java/META-INF/persistence.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java new file mode 100644 index 00000000..641c39ae --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageService.java @@ -0,0 +1,51 @@ +/* + * 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 domainapp.dom.app.homepage; + +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.applib.annotation.Action; +import org.apache.isis.applib.annotation.DomainService; +import org.apache.isis.applib.annotation.HomePage; +import org.apache.isis.applib.annotation.NatureOfService; +import org.apache.isis.applib.annotation.SemanticsOf; + +@DomainService( + nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY // trick to suppress the actions from the top-level menu +) +public class HomePageService { + + //region > homePage (action) + + @Action( + semantics = SemanticsOf.SAFE + ) + @HomePage + public HomePageViewModel homePage() { + return container.injectServicesInto(new HomePageViewModel()); + } + + //endregion + + //region > injected services + + @javax.inject.Inject + DomainObjectContainer container; + + //endregion +} diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.java new file mode 100644 index 00000000..83015d05 --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.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 domainapp.dom.app.homepage; + +import java.util.List; + +import org.apache.isis.applib.annotation.ViewModel; + +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.dom.modules.simple.SimpleObjects; + +@ViewModel +public class HomePageViewModel { + + //region > title + public String title() { + return getObjects().size() + " objects"; + } + //endregion + + //region > object (collection) + @org.apache.isis.applib.annotation.HomePage + public List getObjects() { + return simpleObjects.listAll(); + } + //endregion + + //region > injected services + + @javax.inject.Inject + SimpleObjects simpleObjects; + + //endregion +} diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json new file mode 100644 index 00000000..34f78e0c --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.layout.json @@ -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. + */ +{ + "columns": [ + { + "span": 0, + "memberGroups": {} + }, + { + "span": 0, + "memberGroups": {} + }, + { + "span": 0, + "memberGroups": {} + }, + { + "span": 12, + "collections": { + "objects": { + "collectionLayout": { + "render": "EAGERLY" + } + } + } + } + ], + "actions": {} +} \ No newline at end of file diff --git a/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png new file mode 100644 index 00000000..cb03785f Binary files /dev/null and b/naked-objects/dom/src/main/java/domainapp/dom/app/homepage/HomePageViewModel.png differ diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java new file mode 100644 index 00000000..a4fba6dd --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.java @@ -0,0 +1,149 @@ +/* + * 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 domainapp.dom.modules.simple; + +import javax.jdo.JDOHelper; +import javax.jdo.annotations.IdentityType; +import javax.jdo.annotations.VersionStrategy; + +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.applib.Identifier; +import org.apache.isis.applib.annotation.Action; +import org.apache.isis.applib.annotation.BookmarkPolicy; +import org.apache.isis.applib.annotation.DomainObject; +import org.apache.isis.applib.annotation.DomainObjectLayout; +import org.apache.isis.applib.annotation.Editing; +import org.apache.isis.applib.annotation.Parameter; +import org.apache.isis.applib.annotation.ParameterLayout; +import org.apache.isis.applib.annotation.Property; +import org.apache.isis.applib.annotation.Title; +import org.apache.isis.applib.services.eventbus.ActionDomainEvent; +import org.apache.isis.applib.services.i18n.TranslatableString; +import org.apache.isis.applib.util.ObjectContracts; + +@javax.jdo.annotations.PersistenceCapable( + identityType=IdentityType.DATASTORE, + schema = "simple", + table = "SimpleObject" +) +@javax.jdo.annotations.DatastoreIdentity( + strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY, + column="id") +@javax.jdo.annotations.Version( + strategy=VersionStrategy.VERSION_NUMBER, + column="version") +@javax.jdo.annotations.Queries({ + @javax.jdo.annotations.Query( + name = "find", language = "JDOQL", + value = "SELECT " + + "FROM domainapp.dom.modules.simple.SimpleObject "), + @javax.jdo.annotations.Query( + name = "findByName", language = "JDOQL", + value = "SELECT " + + "FROM domainapp.dom.modules.simple.SimpleObject " + + "WHERE name.indexOf(:name) >= 0 ") +}) +@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"}) +@DomainObject +@DomainObjectLayout( + bookmarking = BookmarkPolicy.AS_ROOT, + cssClassFa = "fa-flag" +) +public class SimpleObject implements Comparable { + + + //region > identificatiom + public TranslatableString title() { + return TranslatableString.tr("Object: {name}", "name", getName()); + } + //endregion + + //region > name (property) + + private String name; + + @javax.jdo.annotations.Column(allowsNull="false", length = 40) + @Title(sequence="1") + @Property( + editing = Editing.DISABLED + ) + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + // endregion + + //region > updateName (action) + + public static class UpdateNameDomainEvent extends ActionDomainEvent { + public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier, final Object... arguments) { + super(source, identifier, arguments); + } + } + + @Action( + domainEvent = UpdateNameDomainEvent.class + ) + public SimpleObject updateName( + @Parameter(maxLength = 40) + @ParameterLayout(named = "New name") + final String name) { + setName(name); + return this; + } + + public String default0UpdateName() { + return getName(); + } + + public TranslatableString validateUpdateName(final String name) { + return name.contains("!")? TranslatableString.tr("Exclamation mark is not allowed"): null; + } + + //endregion + + //region > version (derived property) + public Long getVersionSequence() { + return (Long) JDOHelper.getVersion(this); + } + //endregion + + //region > compareTo + + @Override + public int compareTo(final SimpleObject other) { + return ObjectContracts.compare(this, other, "name"); + } + + //endregion + + //region > injected services + + @javax.inject.Inject + @SuppressWarnings("unused") + private DomainObjectContainer container; + + //endregion + + +} diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json new file mode 100644 index 00000000..3d5e23f7 --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.layout.json @@ -0,0 +1,56 @@ +/** + * 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. + */ +{ + "columns": [ + { + "span": 6, + "memberGroups": { + "General": { + "members": { + "name": { + "actions": { + "updateName": { + "actionLayout": { + "position": "BOTTOM" + } + } + } + }, + "versionSequence": { + "propertyLayout": { + "name": "version" + } + } + } + } + } + }, + { + "span": 0, + "memberGroups": {} + }, + { + "span": 0, + "memberGroups": {} + }, + { + "span": 6, + "collections": {} + } + ], + "actions": {} +} \ No newline at end of file diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png new file mode 100644 index 00000000..0bd6f575 Binary files /dev/null and b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObject.png differ diff --git a/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java new file mode 100644 index 00000000..0634dd16 --- /dev/null +++ b/naked-objects/dom/src/main/java/domainapp/dom/modules/simple/SimpleObjects.java @@ -0,0 +1,107 @@ +/* + * 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 domainapp.dom.modules.simple; + +import java.util.List; + +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.applib.Identifier; +import org.apache.isis.applib.annotation.Action; +import org.apache.isis.applib.annotation.ActionLayout; +import org.apache.isis.applib.annotation.BookmarkPolicy; +import org.apache.isis.applib.annotation.DomainService; +import org.apache.isis.applib.annotation.DomainServiceLayout; +import org.apache.isis.applib.annotation.MemberOrder; +import org.apache.isis.applib.annotation.ParameterLayout; +import org.apache.isis.applib.annotation.SemanticsOf; +import org.apache.isis.applib.query.QueryDefault; +import org.apache.isis.applib.services.eventbus.ActionDomainEvent; +import org.apache.isis.applib.services.i18n.TranslatableString; + +@DomainService(repositoryFor = SimpleObject.class) +@DomainServiceLayout(menuOrder = "10") +public class SimpleObjects { + + //region > title + public TranslatableString title() { + return TranslatableString.tr("Simple Objects"); + } + //endregion + + //region > listAll (action) + @Action( + semantics = SemanticsOf.SAFE + ) + @ActionLayout( + bookmarking = BookmarkPolicy.AS_ROOT + ) + @MemberOrder(sequence = "1") + public List listAll() { + return container.allInstances(SimpleObject.class); + } + //endregion + + //region > findByName (action) + @Action( + semantics = SemanticsOf.SAFE + ) + @ActionLayout( + bookmarking = BookmarkPolicy.AS_ROOT + ) + @MemberOrder(sequence = "2") + public List findByName( + @ParameterLayout(named="Name") + final String name + ) { + return container.allMatches( + new QueryDefault<>( + SimpleObject.class, + "findByName", + "name", name)); + } + //endregion + + //region > create (action) + public static class CreateDomainEvent extends ActionDomainEvent { + public CreateDomainEvent(final SimpleObjects source, final Identifier identifier, final Object... arguments) { + super(source, identifier, arguments); + } + } + + @Action( + domainEvent = CreateDomainEvent.class + ) + @MemberOrder(sequence = "3") + public SimpleObject create( + final @ParameterLayout(named="Name") String name) { + final SimpleObject obj = container.newTransientInstance(SimpleObject.class); + obj.setName(name); + container.persistIfNotAlready(obj); + return obj; + } + + //endregion + + //region > injected services + + @javax.inject.Inject + DomainObjectContainer container; + + //endregion +} diff --git a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java new file mode 100644 index 00000000..e29b3f24 --- /dev/null +++ b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectTest.java @@ -0,0 +1,49 @@ +/** + * 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 domainapp.dom.modules.simple; + +import org.junit.Before; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SimpleObjectTest { + + SimpleObject simpleObject; + + @Before + public void setUp() throws Exception { + simpleObject = new SimpleObject(); + } + + public static class Name extends SimpleObjectTest { + + @Test + public void happyCase() throws Exception { + // given + String name = "Foobar"; + assertThat(simpleObject.getName()).isNull(); + + // when + simpleObject.setName(name); + + // then + assertThat(simpleObject.getName()).isEqualTo(name); + } + } + +} diff --git a/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java new file mode 100644 index 00000000..a41d25ad --- /dev/null +++ b/naked-objects/dom/src/test/java/domainapp/dom/modules/simple/SimpleObjectsTest.java @@ -0,0 +1,104 @@ +/** + * 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 domainapp.dom.modules.simple; + +import java.util.List; + +import com.google.common.collect.Lists; + +import org.jmock.Expectations; +import org.jmock.Sequence; +import org.jmock.auto.Mock; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2; +import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode; + +import static org.assertj.core.api.Assertions.assertThat; + +public class SimpleObjectsTest { + + @Rule + public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES); + + @Mock + DomainObjectContainer mockContainer; + + SimpleObjects simpleObjects; + + @Before + public void setUp() throws Exception { + simpleObjects = new SimpleObjects(); + simpleObjects.container = mockContainer; + } + + public static class Create extends SimpleObjectsTest { + + @Test + public void happyCase() throws Exception { + + // given + final SimpleObject simpleObject = new SimpleObject(); + + final Sequence seq = context.sequence("create"); + context.checking(new Expectations() { + { + oneOf(mockContainer).newTransientInstance(SimpleObject.class); + inSequence(seq); + will(returnValue(simpleObject)); + + oneOf(mockContainer).persistIfNotAlready(simpleObject); + inSequence(seq); + } + }); + + // when + final SimpleObject obj = simpleObjects.create("Foobar"); + + // then + assertThat(obj).isEqualTo(simpleObject); + assertThat(obj.getName()).isEqualTo("Foobar"); + } + + } + + public static class ListAll extends SimpleObjectsTest { + + @Test + public void happyCase() throws Exception { + + // given + final List all = Lists.newArrayList(); + + context.checking(new Expectations() { + { + oneOf(mockContainer).allInstances(SimpleObject.class); + will(returnValue(all)); + } + }); + + // when + final List list = simpleObjects.listAll(); + + // then + assertThat(list).isEqualTo(all); + } + } +} diff --git a/naked-objects/fixture/pom.xml b/naked-objects/fixture/pom.xml new file mode 100644 index 00000000..63ee62d1 --- /dev/null +++ b/naked-objects/fixture/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + com.iluwatar + naked-objects + 1.0-SNAPSHOT + + + naked-objects-fixture + Simple App Fixtures + + + + ${project.groupId} + naked-objects-dom + + + + diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java b/naked-objects/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java new file mode 100644 index 00000000..751bad31 --- /dev/null +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/DomainAppFixturesService.java @@ -0,0 +1,76 @@ +/* + * 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 domainapp.fixture; + +import java.util.List; + +import org.apache.isis.applib.annotation.Action; +import org.apache.isis.applib.annotation.ActionLayout; +import org.apache.isis.applib.annotation.DomainService; +import org.apache.isis.applib.annotation.DomainServiceLayout; +import org.apache.isis.applib.annotation.MemberOrder; +import org.apache.isis.applib.annotation.RestrictTo; +import org.apache.isis.applib.fixturescripts.FixtureResult; +import org.apache.isis.applib.fixturescripts.FixtureScript; +import org.apache.isis.applib.fixturescripts.FixtureScripts; + +import domainapp.fixture.scenarios.RecreateSimpleObjects; + +/** + * Enables fixtures to be installed from the application. + */ +@DomainService +@DomainServiceLayout( + named="Prototyping", + menuBar = DomainServiceLayout.MenuBar.SECONDARY, + menuOrder = "500" +) +public class DomainAppFixturesService extends FixtureScripts { + + public DomainAppFixturesService() { + super(DomainAppFixturesService.class.getPackage().getName(), MultipleExecutionStrategy.EXECUTE); + } + + @Override + public FixtureScript default0RunFixtureScript() { + return findFixtureScriptFor(RecreateSimpleObjects.class); + } + + @Override + public List choices0RunFixtureScript() { + return super.choices0RunFixtureScript(); + } + + + // ////////////////////////////////////// + + @Action( + restrictTo = RestrictTo.PROTOTYPING + ) + @ActionLayout( + cssClassFa="fa fa-refresh" + ) + @MemberOrder(sequence="20") + public Object recreateObjectsAndReturnFirst() { + final List run = findFixtureScriptFor(RecreateSimpleObjects.class).run(null); + return run.get(0).getObject(); + } + + +} diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java new file mode 100644 index 00000000..926217d0 --- /dev/null +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectCreate.java @@ -0,0 +1,71 @@ +/* + * 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 domainapp.fixture.modules.simple; + +import org.apache.isis.applib.fixturescripts.FixtureScript; + +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.dom.modules.simple.SimpleObjects; + +public class SimpleObjectCreate extends FixtureScript { + + //region > name (input) + private String name; + /** + * Name of the object (required) + */ + public String getName() { + return name; + } + + public SimpleObjectCreate setName(final String name) { + this.name = name; + return this; + } + //endregion + + + //region > simpleObject (output) + private SimpleObject simpleObject; + + /** + * The created simple object (output). + * @return + */ + public SimpleObject getSimpleObject() { + return simpleObject; + } + //endregion + + @Override + protected void execute(final ExecutionContext ec) { + + String name = checkParam("name", ec, String.class); + + this.simpleObject = wrap(simpleObjects).create(name); + + // also make available to UI + ec.addResult(this, simpleObject); + } + + @javax.inject.Inject + private SimpleObjects simpleObjects; + +} diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java new file mode 100644 index 00000000..8767b6fb --- /dev/null +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/modules/simple/SimpleObjectsTearDown.java @@ -0,0 +1,36 @@ +/* + * 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 domainapp.fixture.modules.simple; + +import org.apache.isis.applib.fixturescripts.FixtureScript; +import org.apache.isis.applib.services.jdosupport.IsisJdoSupport; + +public class SimpleObjectsTearDown extends FixtureScript { + + @Override + protected void execute(ExecutionContext executionContext) { + isisJdoSupport.executeUpdate("delete from simple.\"SimpleObject\""); + } + + + @javax.inject.Inject + private IsisJdoSupport isisJdoSupport; + +} diff --git a/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java b/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java new file mode 100644 index 00000000..072769e2 --- /dev/null +++ b/naked-objects/fixture/src/main/java/domainapp/fixture/scenarios/RecreateSimpleObjects.java @@ -0,0 +1,92 @@ +/* + * 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 domainapp.fixture.scenarios; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import com.google.common.collect.Lists; + +import org.apache.isis.applib.fixturescripts.FixtureScript; + +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.fixture.modules.simple.SimpleObjectCreate; +import domainapp.fixture.modules.simple.SimpleObjectsTearDown; + +public class RecreateSimpleObjects extends FixtureScript { + + public final List NAMES = Collections.unmodifiableList(Arrays.asList( + "Foo", "Bar", "Baz", "Frodo", "Froyo", "Fizz", "Bip", "Bop", "Bang", "Boo")); + + public RecreateSimpleObjects() { + withDiscoverability(Discoverability.DISCOVERABLE); + } + + //region > number (optional input) + private Integer number; + + /** + * The number of objects to create, up to 10; optional, defaults to 3. + */ + public Integer getNumber() { + return number; + } + + public RecreateSimpleObjects setNumber(final Integer number) { + this.number = number; + return this; + } + //endregion + + //region > simpleObjects (output) + private final List simpleObjects = Lists.newArrayList(); + + /** + * The simpleobjects created by this fixture (output). + */ + public List getSimpleObjects() { + return simpleObjects; + } + //endregion + + @Override + protected void execute(final ExecutionContext ec) { + + // defaults + final int number = defaultParam("number", ec, 3); + + // validate + if(number < 0 || number > NAMES.size()) { + throw new IllegalArgumentException(String.format("number must be in range [0,%d)", NAMES.size())); + } + + // + // execute + // + ec.executeChild(this, new SimpleObjectsTearDown()); + + for (int i = 0; i < number; i++) { + final SimpleObjectCreate fs = new SimpleObjectCreate().setName(NAMES.get(i)); + ec.executeChild(this, fs.getName(), fs); + simpleObjects.add(fs.getSimpleObject()); + } + } +} diff --git a/naked-objects/integtests/.gitignore b/naked-objects/integtests/.gitignore new file mode 100644 index 00000000..88dfbbca --- /dev/null +++ b/naked-objects/integtests/.gitignore @@ -0,0 +1 @@ +/translations.pot diff --git a/naked-objects/integtests/logging.properties b/naked-objects/integtests/logging.properties new file mode 100644 index 00000000..b5524956 --- /dev/null +++ b/naked-objects/integtests/logging.properties @@ -0,0 +1,111 @@ +# 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. + + +# +# Isis uses log4j is used to provide system logging +# +log4j.rootCategory=INFO, Console + +# The console appender +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.target=System.out +log4j.appender.Console.layout=org.apache.log4j.PatternLayout +log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n + +log4j.appender.File=org.apache.log4j.RollingFileAppender +log4j.appender.File.file=isis.log +log4j.appender.File.append=false +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n + +log4j.appender.translations-po=org.apache.log4j.FileAppender +log4j.appender.translations-po.File=./translations.pot +log4j.appender.translations-po.Append=false +log4j.appender.translations-po.layout=org.apache.log4j.PatternLayout +log4j.appender.translations-po.layout.ConversionPattern=%m%n + +! turn on the internal log4j debugging flag so we can see what it is doing +#log4j.debug=true + + +# DataNucleus +# the first two log the DML and DDL (if set to DEBUG) +log4j.logger.DataNucleus.Datastore.Native=WARN, Console +log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console +# the remainder can probably be left to WARN +log4j.logger.DataNucleus.Persistence=WARN, Console +log4j.logger.DataNucleus.Transaction=WARN, Console +log4j.logger.DataNucleus.Connection=WARN, Console +log4j.logger.DataNucleus.Query=WARN, Console +log4j.logger.DataNucleus.Cache=WARN, Console +log4j.logger.DataNucleus.MetaData=WARN, Console +log4j.logger.DataNucleus.Datastore=WARN, Console +log4j.logger.DataNucleus.Datastore.Persist=WARN, Console +log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console +log4j.logger.DataNucleus.General=WARN, Console +log4j.logger.DataNucleus.Lifecycle=WARN, Console +log4j.logger.DataNucleus.ValueGeneration=WARN, Console +log4j.logger.DataNucleus.Enhancer=WARN, Console +log4j.logger.DataNucleus.SchemaTool=ERROR, Console +log4j.logger.DataNucleus.JDO=WARN, Console +log4j.logger.DataNucleus.JPA=ERROR, Console +log4j.logger.DataNucleus.JCA=WARN, Console +log4j.logger.DataNucleus.IDE=ERROR, Console + +log4j.additivity.DataNucleus.Datastore.Native=false +log4j.additivity.DataNucleus.Datastore.Schema=false +log4j.additivity.DataNucleus.Datastore.Persistence=false +log4j.additivity.DataNucleus.Datastore.Transaction=false +log4j.additivity.DataNucleus.Datastore.Connection=false +log4j.additivity.DataNucleus.Datastore.Query=false +log4j.additivity.DataNucleus.Datastore.Cache=false +log4j.additivity.DataNucleus.Datastore.MetaData=false +log4j.additivity.DataNucleus.Datastore.Datastore=false +log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false +log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false +log4j.additivity.DataNucleus.Datastore.General=false +log4j.additivity.DataNucleus.Datastore.Lifecycle=false +log4j.additivity.DataNucleus.Datastore.ValueGeneration=false +log4j.additivity.DataNucleus.Datastore.Enhancer=false +log4j.additivity.DataNucleus.Datastore.SchemaTool=false +log4j.additivity.DataNucleus.Datastore.JDO=false +log4j.additivity.DataNucleus.Datastore.JPA=false +log4j.additivity.DataNucleus.Datastore.JCA=false +log4j.additivity.DataNucleus.Datastore.IDE=false + + + + +# if using log4jdbc-remix as JDBC driver +#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console +#log4j.additivity.jdbc.sqlonly=false +#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console +#log4j.additivity.jdbc.resultsettable=false + +#log4j.logger.jdbc.audit=WARN,jdbc, Console +#log4j.additivity.jdbc.audit=false +#log4j.logger.jdbc.resultset=WARN,jdbc +#log4j.additivity.jdbc.resultset=false +#log4j.logger.jdbc.sqltiming=WARN,sqltiming +#log4j.additivity.jdbc.sqltiming=false +#log4j.logger.jdbc.connection=FATAL,connection +#log4j.additivity.jdbc.connection=false + + +log4j.logger.org.apache.isis.core.runtime.services.i18n.po.PoWriter=INFO,translations-po +log4j.additivity.org.apache.isis.core.runtime.services.i18n.po.PotWriter=false diff --git a/naked-objects/integtests/pom.xml b/naked-objects/integtests/pom.xml new file mode 100644 index 00000000..e627a017 --- /dev/null +++ b/naked-objects/integtests/pom.xml @@ -0,0 +1,128 @@ + + + 4.0.0 + + + com.iluwatar + naked-objects + 1.0-SNAPSHOT + + + naked-objects-integtests + Simple App Integration Tests + + + + + src/test/resources + + + src/test/java + + ** + + + **/*.java + + + + + + + + + ${project.groupId} + naked-objects-fixture + + + + org.apache.isis.core + isis-core-unittestsupport + + + + org.apache.isis.core + isis-core-integtestsupport + + + org.apache.isis.core + isis-core-specsupport + + + + org.hamcrest + hamcrest-library + + + + org.apache.isis.core + isis-core-wrapper + + + org.apache.isis.core + isis-core-runtime + + + + org.assertj + assertj-core + test + + + + org.hsqldb + hsqldb + + + + + + + + + diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java b/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java new file mode 100644 index 00000000..28e9d378 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/bootstrap/SimpleAppSystemInitializer.java @@ -0,0 +1,54 @@ +/* + * 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 domainapp.integtests.bootstrap; + +import org.apache.isis.core.commons.config.IsisConfiguration; +import org.apache.isis.core.integtestsupport.IsisSystemForTest; +import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller; +import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests; + +public class SimpleAppSystemInitializer { + + public static void initIsft() { + IsisSystemForTest isft = IsisSystemForTest.getElseNull(); + if(isft == null) { + isft = new SimpleAppSystemBuilder().build().setUpSystem(); + IsisSystemForTest.set(isft); + } + } + + private static class SimpleAppSystemBuilder extends IsisSystemForTest.Builder { + + public SimpleAppSystemBuilder() { + withLoggingAt(org.apache.log4j.Level.INFO); + with(testConfiguration()); + with(new DataNucleusPersistenceMechanismInstaller()); + + // services annotated with @DomainService + withServicesIn( "domainapp" ); + } + + private static IsisConfiguration testConfiguration() { + final IsisConfigurationForJdoIntegTests testConfiguration = new IsisConfigurationForJdoIntegTests(); + + testConfiguration.addRegisterEntitiesPackagePrefix("domainapp.dom.modules"); + return testConfiguration; + } + } +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java new file mode 100644 index 00000000..b175d474 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/BootstrappingGlue.java @@ -0,0 +1,41 @@ +/** +O * 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 domainapp.integtests.specglue; + +import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope; +import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; + +import cucumber.api.java.After; +import cucumber.api.java.Before; +import domainapp.integtests.bootstrap.SimpleAppSystemInitializer; + +public class BootstrappingGlue extends CukeGlueAbstract { + + @Before(value={"@integration"}, order=100) + public void beforeScenarioIntegrationScope() { + org.apache.log4j.PropertyConfigurator.configure("logging.properties"); + SimpleAppSystemInitializer.initIsft(); + + before(ScenarioExecutionScope.INTEGRATION); + } + + @After + public void afterScenario(cucumber.api.Scenario sc) { + assertMocksSatisfied(); + after(sc); + } +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java new file mode 100644 index 00000000..a2d5c898 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/CatalogOfFixturesGlue.java @@ -0,0 +1,31 @@ +/** + * 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 domainapp.integtests.specglue; + +import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; + +import cucumber.api.java.Before; +import domainapp.fixture.scenarios.RecreateSimpleObjects; + +public class CatalogOfFixturesGlue extends CukeGlueAbstract { + + @Before(value={"@integration", "@SimpleObjectsFixture"}, order=20000) + public void integrationFixtures() throws Throwable { + scenarioExecution().install(new RecreateSimpleObjects()); + } + +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.java new file mode 100644 index 00000000..63d96bd5 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specglue/modules/simple/SimpleObjectGlue.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 domainapp.integtests.specglue.modules.simple; + +import java.util.List; +import java.util.UUID; + +import org.apache.isis.core.specsupport.specs.CukeGlueAbstract; + +import cucumber.api.java.en.Given; +import cucumber.api.java.en.When; +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.dom.modules.simple.SimpleObjects; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +public class SimpleObjectGlue extends CukeGlueAbstract { + + @Given("^there are.* (\\d+) simple objects$") + public void there_are_N_simple_objects(int n) throws Throwable { + try { + final List findAll = service(SimpleObjects.class).listAll(); + assertThat(findAll.size(), is(n)); + putVar("list", "all", findAll); + + } finally { + assertMocksSatisfied(); + } + } + + @When("^I create a new simple object$") + public void I_create_a_new_simple_object() throws Throwable { + service(SimpleObjects.class).create(UUID.randomUUID().toString()); + } + +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specs/RunSpecs.java b/naked-objects/integtests/src/test/java/domainapp/integtests/specs/RunSpecs.java new file mode 100644 index 00000000..910b5a82 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specs/RunSpecs.java @@ -0,0 +1,39 @@ +/** + * 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 domainapp.integtests.specs; + +import org.junit.runner.RunWith; + +import cucumber.api.CucumberOptions; +import cucumber.api.junit.Cucumber; + + +/** + * Runs scenarios in all .feature files (this package and any subpackages). + */ +@RunWith(Cucumber.class) +@CucumberOptions( + format = { + "html:target/cucumber-html-report" + ,"json:target/cucumber.json" + }, + glue={"classpath:domainapp.integtests.specglue"}, + strict = true, + tags = { "~@backlog", "~@ignore" }) +public class RunSpecs { + // intentionally empty +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/specs/modules/simple/SimpleObjectSpec_listAllAndCreate.feature b/naked-objects/integtests/src/test/java/domainapp/integtests/specs/modules/simple/SimpleObjectSpec_listAllAndCreate.feature new file mode 100644 index 00000000..346aa256 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/specs/modules/simple/SimpleObjectSpec_listAllAndCreate.feature @@ -0,0 +1,26 @@ +# +# 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. +# +@SimpleObjectsFixture +Feature: List and Create New Simple Objects + + @integration + Scenario: Existing simple objects can be listed and new ones created + Given there are initially 3 simple objects + When I create a new simple object + Then there are 4 simple objects + + \ No newline at end of file diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java new file mode 100644 index 00000000..3ceef4e6 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/SimpleAppIntegTest.java @@ -0,0 +1,39 @@ +/* + * 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 domainapp.integtests.tests; + +import org.junit.BeforeClass; + +import org.apache.isis.core.integtestsupport.IntegrationTestAbstract; +import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration; + +import domainapp.integtests.bootstrap.SimpleAppSystemInitializer; + +public abstract class SimpleAppIntegTest extends IntegrationTestAbstract { + + @BeforeClass + public static void initClass() { + org.apache.log4j.PropertyConfigurator.configure("logging.properties"); + SimpleAppSystemInitializer.initIsft(); + + // instantiating will install onto ThreadLocal + new ScenarioExecutionForIntegration(); + } + +} diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java new file mode 100644 index 00000000..610136bb --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectIntegTest.java @@ -0,0 +1,121 @@ +/* + * 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 domainapp.integtests.tests.modules.simple; + +import javax.inject.Inject; + +import org.junit.Before; +import org.junit.Test; + +import org.apache.isis.applib.DomainObjectContainer; +import org.apache.isis.applib.fixturescripts.FixtureScripts; +import org.apache.isis.applib.services.wrapper.DisabledException; +import org.apache.isis.applib.services.wrapper.InvalidException; + +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.fixture.scenarios.RecreateSimpleObjects; +import domainapp.integtests.tests.SimpleAppIntegTest; +import static org.assertj.core.api.Assertions.assertThat; + +public class SimpleObjectIntegTest extends SimpleAppIntegTest { + + @Inject + FixtureScripts fixtureScripts; + + RecreateSimpleObjects fs; + SimpleObject simpleObjectPojo; + SimpleObject simpleObjectWrapped; + + @Before + public void setUp() throws Exception { + // given + fs = new RecreateSimpleObjects().setNumber(1); + fixtureScripts.runFixtureScript(fs, null); + + simpleObjectPojo = fs.getSimpleObjects().get(0); + + assertThat(simpleObjectPojo).isNotNull(); + simpleObjectWrapped = wrap(simpleObjectPojo); + } + + public static class Name extends SimpleObjectIntegTest { + + @Test + public void accessible() throws Exception { + // when + final String name = simpleObjectWrapped.getName(); + // then + assertThat(name).isEqualTo(fs.NAMES.get(0)); + } + + @Test + public void cannotBeUpdatedDirectly() throws Exception { + + // expect + expectedExceptions.expect(DisabledException.class); + + // when + simpleObjectWrapped.setName("new name"); + } + } + + public static class UpdateName extends SimpleObjectIntegTest { + + @Test + public void happyCase() throws Exception { + + // when + simpleObjectWrapped.updateName("new name"); + + // then + assertThat(simpleObjectWrapped.getName()).isEqualTo("new name"); + } + + @Test + public void failsValidation() throws Exception { + + // expect + expectedExceptions.expect(InvalidException.class); + expectedExceptions.expectMessage("Exclamation mark is not allowed"); + + // when + simpleObjectWrapped.updateName("new name!"); + } + } + + + public static class Title extends SimpleObjectIntegTest { + + @Inject + DomainObjectContainer container; + + @Test + public void interpolatesName() throws Exception { + + // given + final String name = simpleObjectWrapped.getName(); + + // when + final String title = container.titleOf(simpleObjectWrapped); + + // then + assertThat(title).isEqualTo("Object: " + name); + } + } +} \ No newline at end of file diff --git a/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java new file mode 100644 index 00000000..fd3b0ff4 --- /dev/null +++ b/naked-objects/integtests/src/test/java/domainapp/integtests/tests/modules/simple/SimpleObjectsIntegTest.java @@ -0,0 +1,143 @@ +/* + * 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 domainapp.integtests.tests.modules.simple; + +import java.sql.SQLIntegrityConstraintViolationException; +import java.util.List; + +import javax.inject.Inject; + +import com.google.common.base.Throwables; + +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; +import org.junit.Test; + +import org.apache.isis.applib.fixturescripts.FixtureScript; +import org.apache.isis.applib.fixturescripts.FixtureScripts; + +import domainapp.dom.modules.simple.SimpleObject; +import domainapp.dom.modules.simple.SimpleObjects; +import domainapp.fixture.modules.simple.SimpleObjectsTearDown; +import domainapp.fixture.scenarios.RecreateSimpleObjects; +import domainapp.integtests.tests.SimpleAppIntegTest; +import static org.assertj.core.api.Assertions.assertThat; + +public class SimpleObjectsIntegTest extends SimpleAppIntegTest { + + @Inject + FixtureScripts fixtureScripts; + @Inject + SimpleObjects simpleObjects; + + public static class ListAll extends SimpleObjectsIntegTest { + + @Test + public void happyCase() throws Exception { + + // given + RecreateSimpleObjects fs = new RecreateSimpleObjects(); + fixtureScripts.runFixtureScript(fs, null); + nextTransaction(); + + // when + final List all = wrap(simpleObjects).listAll(); + + // then + assertThat(all).hasSize(fs.getSimpleObjects().size()); + + SimpleObject simpleObject = wrap(all.get(0)); + assertThat(simpleObject.getName()).isEqualTo(fs.getSimpleObjects().get(0).getName()); + } + + @Test + public void whenNone() throws Exception { + + // given + FixtureScript fs = new SimpleObjectsTearDown(); + fixtureScripts.runFixtureScript(fs, null); + nextTransaction(); + + // when + final List all = wrap(simpleObjects).listAll(); + + // then + assertThat(all).hasSize(0); + } + } + + public static class Create extends SimpleObjectsIntegTest { + + @Test + public void happyCase() throws Exception { + + // given + FixtureScript fs = new SimpleObjectsTearDown(); + fixtureScripts.runFixtureScript(fs, null); + nextTransaction(); + + // when + wrap(simpleObjects).create("Faz"); + + // then + final List all = wrap(simpleObjects).listAll(); + assertThat(all).hasSize(1); + } + + @Test + public void whenAlreadyExists() throws Exception { + + // given + FixtureScript fs = new SimpleObjectsTearDown(); + fixtureScripts.runFixtureScript(fs, null); + nextTransaction(); + wrap(simpleObjects).create("Faz"); + nextTransaction(); + + // then + expectedExceptions.expectCause(causalChainContains(SQLIntegrityConstraintViolationException.class)); + + // when + wrap(simpleObjects).create("Faz"); + nextTransaction(); + } + + private static Matcher causalChainContains(final Class cls) { + return new TypeSafeMatcher() { + @Override + protected boolean matchesSafely(Throwable item) { + final List causalChain = Throwables.getCausalChain(item); + for (Throwable throwable : causalChain) { + if(cls.isAssignableFrom(throwable.getClass())){ + return true; + } + } + return false; + } + + @Override + public void describeTo(Description description) { + description.appendText("exception with causal chain containing " + cls.getSimpleName()); + } + }; + } + } + +} \ No newline at end of file diff --git a/naked-objects/pom.xml b/naked-objects/pom.xml new file mode 100644 index 00000000..700d487e --- /dev/null +++ b/naked-objects/pom.xml @@ -0,0 +1,400 @@ + + + 4.0.0 + + java-design-patterns + com.iluwatar + 1.1.0 + + + com.iluwatar + naked-objects + 1.0-SNAPSHOT + + Simple App + + pom + + + 3.0.4 + + + + 1.9.0-SNAPSHOT + + UTF-8 + UTF-8 + 2.0.0 + + + + + apache.snapshots + Apache Snapshots + https://repository.apache.org/content/repositories/snapshots/ + + false + + + + + + Cloudbees snapshots + http://repository-estatio.forge.cloudbees.com/snapshot/ + + + + false + + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.3.1 + + + + [3.2.1,) + + + [1.8.0,) + + + All plugin versions must be + defined! + true + true + + + + + + + validate-enforce + validate + + enforce + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + -parameters + + + + source + compile + + + test + test-compile + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + + **/*Test.java + **/*Test$*.java + **/*Test_*.java + **/*Spec*.java + + + **/Test*.java + **/*ForTesting.java + **/*Abstract*.java + + true + true + ${project.build.directory}/surefire-reports + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.16 + + false + + + + test + + + + + + maven-clean-plugin + 2.5 + + + maven-resources-plugin + 2.6 + + + maven-jar-plugin + 2.4 + + + maven-install-plugin + 2.5.1 + + + maven-deploy-plugin + 2.8.1 + + + maven-site-plugin + 3.3 + + + maven-war-plugin + 2.4 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.26 + + + + org.apache.maven.plugins + maven-shade-plugin + 2.2 + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + + run + + + + + + + org.simplericity.jettyconsole + jetty-console-maven-plugin + 1.56 + + + + + org.apache.rat + apache-rat-plugin + 0.10 + + true + true + + **/target/** + **/target-ide/** + + **/*.project + **/.classpath + **/.settings/** + **/*.launch + **/ide/eclipse/launch/** + **/ide/intellij/launch/** + src/site/resources/ide/eclipse/** + + **/rebel.xml + **/*.gitignore + **/*.log + **/*.pdn + **/*.svg + **/*.json + **/*.min.js + **/*.js + + **/translations.pot + **/translations*.po + + + + AL2 + Apache License 2.0 + + + Licensed to the Apache Software Foundation (ASF) under one + + + + JQRY + MIT + + + Dual licensed under the MIT or GPL Version 2 licenses. + + + + JMOCK + JMock + + + Copyright (c) 2000-2007, jMock.org + + + + DOCBK + DocBook 4.5 + + + Permission to copy in any form is granted for use + Permission to use, copy, modify and distribute the DocBook DTD + is hereby granted in perpetuity, provided that the above copyright + This is the catalog data file for DocBook XML V4.5. It is provided as + XML Catalog data for DocBook XML V4.5 + DocBook additional general entities V4.5 + XML EXCHANGE TABLE MODEL DECLARATION MODULE + + + + W3C + XHTML + + + Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), + + + + + + Apache License 2.0 + + + MIT + + + JMock + + + DocBook 4.5 + + + XHTML + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-surefire-report-plugin + + + + + + + + + org.apache.isis.core + isis + ${isis.version} + pom + import + + + + org.apache.isis.viewer + isis-viewer-wicket + ${isis.version} + pom + import + + + + org.assertj + assertj-core + ${assertj-core.version} + + + + + + ${project.groupId} + naked-objects-dom + 1.0-SNAPSHOT + + + ${project.groupId} + naked-objects-fixture + 1.0-SNAPSHOT + + + ${project.groupId} + naked-objects-webapp + 1.0-SNAPSHOT + + + + + + + + + m2e + + + m2e.version + + + + target-ide + + + + + + dom + fixture + integtests + webapp + + \ No newline at end of file diff --git a/naked-objects/webapp/ide/eclipse/launch/.gitignore b/naked-objects/webapp/ide/eclipse/launch/.gitignore new file mode 100644 index 00000000..3d973454 --- /dev/null +++ b/naked-objects/webapp/ide/eclipse/launch/.gitignore @@ -0,0 +1,8 @@ +/SimpleApp-PROTOTYPE-jrebel.launch +/SimpleApp-PROTOTYPE-no-fixtures.launch +/SimpleApp-PROTOTYPE-with-fixtures.launch +/SimpleApp-SERVER-no-fixtures.launch +/SimpleApp-PROTOTYPE-jrebel.launch +/SimpleApp-PROTOTYPE-no-fixtures.launch +/SimpleApp-PROTOTYPE-with-fixtures.launch +/SimpleApp-SERVER-no-fixtures.launch diff --git a/naked-objects/webapp/ide/intellij/launch/README.txt b/naked-objects/webapp/ide/intellij/launch/README.txt new file mode 100644 index 00000000..5f8e5ab8 --- /dev/null +++ b/naked-objects/webapp/ide/intellij/launch/README.txt @@ -0,0 +1,2 @@ +Copy into workspace\.idea\runConfigurations directory, and adjust file paths for Maven tasks. + diff --git a/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml b/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml new file mode 100644 index 00000000..918ea354 --- /dev/null +++ b/naked-objects/webapp/ide/intellij/launch/SimpleApp_PROTOTYPE.xml @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/naked-objects/webapp/ide/intellij/launch/SimpleApp__enhance_only_.xml b/naked-objects/webapp/ide/intellij/launch/SimpleApp__enhance_only_.xml new file mode 100644 index 00000000..31993b50 --- /dev/null +++ b/naked-objects/webapp/ide/intellij/launch/SimpleApp__enhance_only_.xml @@ -0,0 +1,22 @@ + +s + + + \ No newline at end of file diff --git a/naked-objects/webapp/lib/.gitignore b/naked-objects/webapp/lib/.gitignore new file mode 100644 index 00000000..70eee7e4 --- /dev/null +++ b/naked-objects/webapp/lib/.gitignore @@ -0,0 +1,5 @@ +# +# explicitly ignoring Microsoft JDBC4 jar +# (cannot redistribute, licensing) +# +sqljdbc4.jar diff --git a/naked-objects/webapp/pom.xml b/naked-objects/webapp/pom.xml new file mode 100644 index 00000000..1d2aa322 --- /dev/null +++ b/naked-objects/webapp/pom.xml @@ -0,0 +1,352 @@ + + + 4.0.0 + + + com.iluwatar + naked-objects + 1.0-SNAPSHOT + + + naked-objects-webapp + Simple App Webapp + + This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store. + + war + + + .. + + + + + + org.mortbay.jetty + maven-jetty-plugin + + + + + org.simplericity.jettyconsole + jetty-console-maven-plugin + + + + createconsole + + + ${basedir}/src/main/jettyconsole/isis-banner.png + ${project.build.directory}/${project.build.finalName}-jetty-console.jar + + package + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.8 + + + validate + + maven-version + + + + + + + maven-war-plugin + + simpleapp + + + false + + + ${maven.build.timestamp} + ${agent.name} + ${user.name} + Maven ${maven.version} + ${java.version} + ${os.name} + ${project.version} + + + WEB-INF/lib/isis-core-webserver*.jar, + WEB-INF/lib/javax.servlet-api-*.jar, + WEB-INF/lib/javax.websocket-api-*.jar, + WEB-INF/lib/jetty-all-*.jar + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + build-helper-maven-plugin + [1.5,) + + maven-version + + + + + + + + + + + + + + + + + + + ${project.groupId} + naked-objects-dom + + + + org.datanucleus + datanucleus-enhancer + + + + + ${project.groupId} + naked-objects-fixture + + + + org.datanucleus + datanucleus-enhancer + + + + + + + org.apache.isis.viewer + isis-viewer-wicket-impl + + + org.apache.isis.core + isis-core-viewer-restfulobjects-server + + + org.apache.isis.core + isis-core-security-shiro + + + + + + org.apache.isis.core + isis-core-runtime + + + org.apache.isis.core + isis-core-wrapper + + + org.apache.isis.core + isis-core-security + + + + + + org.apache.isis.core + isis-core-webserver + runtime + true + + + + + org.apache.geronimo.specs + geronimo-servlet_3.0_spec + + + + + org.hsqldb + hsqldb + + + + + + + + + org.lazyluke + log4jdbc-remix + + + org.slf4j + slf4j-api + + + + + + + + + self-host + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + + + + + + + + + + + intellij + + + idea.version + + + + + org.apache.geronimo.specs + geronimo-servlet_3.0_spec + + compile + + + + + jrebel + + + target + dom.simple,org.apache.isis.objectstore.jdo.applib + warn + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/naked-objects/webapp/src/main/java/domainapp/webapp/SimpleApplication.java b/naked-objects/webapp/src/main/java/domainapp/webapp/SimpleApplication.java new file mode 100644 index 00000000..57d1e0ba --- /dev/null +++ b/naked-objects/webapp/src/main/java/domainapp/webapp/SimpleApplication.java @@ -0,0 +1,153 @@ +/* + * 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 domainapp.webapp; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import com.google.common.base.Joiner; +import com.google.common.io.Resources; +import com.google.inject.AbstractModule; +import com.google.inject.Module; +import com.google.inject.name.Names; +import com.google.inject.util.Modules; +import com.google.inject.util.Providers; + +import org.apache.wicket.Session; +import org.apache.wicket.request.IRequestParameters; +import org.apache.wicket.request.Request; +import org.apache.wicket.request.Response; +import org.apache.wicket.request.http.WebRequest; + +import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication; +import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis; + +import de.agilecoders.wicket.core.Bootstrap; +import de.agilecoders.wicket.core.settings.IBootstrapSettings; +import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme; +import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchThemeProvider; + + +/** + * As specified in web.xml. + * + *

+ * See: + *

+ * <filter>
+ *   <filter-name>wicket</filter-name>
+ *    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ *    <init-param>
+ *      <param-name>applicationClassName</param-name>
+ *      <param-value>webapp.SimpleApplication</param-value>
+ *    </init-param>
+ * </filter>
+ * 
+ * + */ +public class SimpleApplication extends IsisWicketApplication { + + private static final long serialVersionUID = 1L; + + /** + * uncomment for a (slightly hacky) way of allowing logins using query args, eg: + * + * ?user=sven&pass=pass + * + *

+ * for demos only, obvious. + */ + private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false; + + + @Override + protected void init() { + super.init(); + + IBootstrapSettings settings = Bootstrap.getSettings(); + settings.setThemeProvider(new BootswatchThemeProvider(BootswatchTheme.Flatly)); + } + + @Override + public Session newSession(final Request request, final Response response) { + if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) { + return super.newSession(request, response); + } + + // else demo mode + final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response); + IRequestParameters requestParameters = request.getRequestParameters(); + final org.apache.wicket.util.string.StringValue user = requestParameters.getParameterValue("user"); + final org.apache.wicket.util.string.StringValue password = requestParameters.getParameterValue("pass"); + s.signIn(user.toString(), password.toString()); + return s; + } + + @Override + public WebRequest newWebRequest(HttpServletRequest servletRequest, String filterPath) { + if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) { + return super.newWebRequest(servletRequest, filterPath); + } + + // else demo mode + try { + String uname = servletRequest.getParameter("user"); + if (uname != null) { + servletRequest.getSession().invalidate(); + } + } catch (Exception e) { + } + WebRequest request = super.newWebRequest(servletRequest, filterPath); + return request; + } + + @Override + protected Module newIsisWicketModule() { + final Module isisDefaults = super.newIsisWicketModule(); + + final Module overrides = new AbstractModule() { + @Override + protected void configure() { + bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("Simple App"); + bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css"); + bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js"); + bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines(getClass(), "welcome.html")); + bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("Simple App"); + bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF"))); + } + }; + + return Modules.override(isisDefaults).with(overrides); + } + + private static String readLines(final Class contextClass, final String resourceName) { + try { + List readLines = Resources.readLines(Resources.getResource(contextClass, resourceName), Charset.defaultCharset()); + final String aboutText = Joiner.on("\n").join(readLines); + return aboutText; + } catch (IOException e) { + return "This is a simple app"; + } + } + +} diff --git a/naked-objects/webapp/src/main/jettyconsole/isis-banner.pdn b/naked-objects/webapp/src/main/jettyconsole/isis-banner.pdn new file mode 100644 index 00000000..37543c93 Binary files /dev/null and b/naked-objects/webapp/src/main/jettyconsole/isis-banner.pdn differ diff --git a/naked-objects/webapp/src/main/jettyconsole/isis-banner.png b/naked-objects/webapp/src/main/jettyconsole/isis-banner.png new file mode 100644 index 00000000..cd9ecfe0 Binary files /dev/null and b/naked-objects/webapp/src/main/jettyconsole/isis-banner.png differ diff --git a/naked-objects/webapp/src/main/resources/domainapp/webapp/welcome.html b/naked-objects/webapp/src/main/resources/domainapp/webapp/welcome.html new file mode 100644 index 00000000..a87d6738 --- /dev/null +++ b/naked-objects/webapp/src/main/resources/domainapp/webapp/welcome.html @@ -0,0 +1,35 @@ + + +

+ Apache Isis™ is a platform to let you rapidly develop + domain-driven apps in Java. +
+
+ This app has been generated using Apache Isis' + SimpleApp archetype, + to create a purposefully minimal application that nevertheless includes fixture data, integration tests and BDD specs. +
+
+ The app itself consists of a single domain class, SimpleObject, + along with an equally simple (factory/repository) domain service, SimpleObjects. +
+
+ For more details, see the Apache Isis website. +

diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/isis.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/isis.properties new file mode 100644 index 00000000..929d1775 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/isis.properties @@ -0,0 +1,300 @@ +# 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. + + +################################################################################# +# +# specify system components. +# +# The values correspond to the named components in the installer-registry.properties file +# in the org.apache.isis.core:isis-core-runtime JAR (in the org.apache.isis.core.runtime package) +# +# Although all configuration could reside in isis.properties, the recommendation is +# to split out into component specific files: +# +# xxx_yyy.properties files +# +# where +# * xxx is the component type, and +# * yyy is the component name. +# +# For example, viewer_wicket.properties holds configuration information specific to the Wicket viewer. +# +################################################################################# + + +# +# configure the persistor (object store) to use +# + +# JDO/DataNucleus objectstore +isis.persistor=datanucleus + + + +# +# configure authentication mechanism to use (to logon to the system) +# + +#isis.authentication=bypass +isis.authentication=shiro + + +# +# configure authorization mechanism to use +# + +#isis.authorization=bypass +isis.authorization=shiro + + + + + +################################################################################# +# +# MetaModel +# +# The metamodel typically does not require additional configuration, although +# the system components (defined above) may refine the metamodel for their needs. +# +################################################################################# + + +# +# Additional programming model facet factories, or remove standard facet factories. +# Comma separated list of fully qualified class names. +# +#isis.reflector.facets.include= +#isis.reflector.facets.exclude= + + +# +# Metamodel validation (in addition to that automatically performed by the programming model facet factories) +# Default implementation does nothing. +# +# Use a custom implementation to enforce additional constraints specific to your app/project/company. +# +#isis.reflector.validator=org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidatorDefault + + + +# +# Whether to allow deprecated annotations/method prefixes (otherwise raise metamodel validation errors). +# If not specified, default is to allow. +# +isis.reflector.validator.allowDeprecated=false + + + +# +# Implementation to use for reading dynamic layout. Default implementation reads Xxx.layout.json files from classpath. +# +#isis.reflector.layoutMetadataReaders=org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFromJson + + + +# +# patterns for applying CssClassFa facet (font-awesome icons), matching on action names +# +isis.reflector.facet.cssClassFa.patterns=\ + new.*:fa-plus,\ + add.*:fa-plus-square,\ + create.*:fa-plus,\ + update.*:fa-edit,\ + change.*:fa-edit,\ + remove.*:fa-minus-square,\ + move.*:fa-exchange,\ + first.*:fa-star,\ + find.*:fa-search,\ + lookup.*:fa-search,\ + clear.*:fa-remove,\ + previous.*:fa-step-backward,\ + next.*:fa-step-forward,\ + list.*:fa-list, \ + all.*:fa-list, \ + download.*:fa-download, \ + upload.*:fa-upload, \ + execute.*:fa-bolt, \ + run.*:fa-bolt, \ + calculate.*:fa-calculator, \ + verify.*:fa-check-circle, \ + refresh.*:fa-refresh, \ + install.*:fa-wrench + + +# +# patterns for applying CssClass facet (CSS styles), matching on member names +# +isis.reflector.facet.cssClass.patterns=\ + delete.*:btn-warning + + +################################################################################# +# +# Value facet defaults +# +# (see also viewer-specific config files, eg viewer_wicket.properties) +# +################################################################################# + +# as used by @Title of a date +isis.value.format.date=dd-MM-yyyy + + + +################################################################################# +# +# Application Services and fixtures +# +################################################################################# + +# +# Specify the domain services. +# +# These are the most important configuration properties in the system, as they define +# the set of the classes for Isis to instantiate as domain service singletons. +# From these domain service instances the rest of the metamodel is discovered, while the +# end-user gains access to other domain objects by invoking the actions of the domain services. +# +isis.services-installer=configuration-and-annotation +isis.services.ServicesInstallerFromAnnotation.packagePrefix=domainapp + +# additional services/overriding default (@DomainService) implementations +isis.services = + + + +# Specify the (optional) test fixtures +# +# Fixtures are used to seed the object store with an initial set of data. For the +# in-memory object store, the fixtures are installed on every run. For other +# object stores, they are used only when the object store is first initialized. +# +isis.fixtures=domainapp.fixture.scenarios.RecreateSimpleObjects + + +# +# required by EmailServiceDefault +# +#isis.service.email.sender.address=some.valid@email.address +#isis.service.email.sender.password=the.password.for-isis.notification.email.sender.address + + + +# +# whether ExceptionRecognizers should also log any recognized exceptions +# (default false; enable for diagnostics/debugging) +# +#isis.services.exceprecog.logRecognizedExceptions=true + + +# +# disable to (automatically registered) ExceptionRecognizerCompositeForJdoObjectStore service +# almost all of this service should be registered. Since all exception recognizer implementations +# are consulted in the event of an exception, it's not sufficient to override the implementation +# (in isis.services); instead this configuration property disables this particular implementation. +# +#isis.services.ExceptionRecognizerCompositeForJdoObjectStore.disable=true + + +################################################################################ +# +# Auditing, Publishing, Command +# +################################################################################ + +# +# Whether changes to objects should be audited; if not set, defaults to "none" +# - if not set or set to "none", can explicitly enable using @DomainObject(auditing=Auditing.ENABLED) +# - if set to "all", can explicitly disable using @Object(auditing=Auditing.DISABLED) +# +#isis.services.audit.objects=all|none + +# +# Whether changes to objects should be published; if not set, defaults to "none" +# - if not set or set to "none", can explicitly enable using @DomainObject(publishing=Publishing.ENABLED) +# - if set to "all", can explicitly disable using @Object(publishing=Publishing.DISABLED) +# +#isis.services.publish.objects=all|none + +# +# Whether all (or all non-query only) actions should be published; if not set, defaults to "none" +# - if not set or set to "none", can explicitly enable using @Action(publishing=Publishing.ENABLED) +# - if set to "all", can explicitly disable using @Action(publishing=Publishing.DISABLED) +# +#isis.services.publish.actions=all|none|ignoreQueryOnly + + +# +# Whether all (or all non-query only) actions should be reified as commands; if not set, defaults to "none" +# - if not set or set to "none", can explicitly enable using @Action(command=CommandReification.ENABLED) +# - if set to "all", can explicitly disable using @Action(command=CommandReification.DISABLED) +# +#isis.services.command.actions=all|none|ignoreQueryOnly + + + + + +################################################################################ +# +# Policies +# +################################################################################# + +# +# Whether editing of object properties is allowed; if not set, defaults to "true" +# - if not set or set to "true", can explicitly disable using @DomainObject(editing=Editing.DISABLED) +# - if set to "false", can explicitly enable using @DomainObject(editing=Editing.ENABLED) +# +#isis.objects.editing=true|false + + + + + +################################################################################ +# +# i18n +# +################################################################################# + +# +# force read translations, even if running in prototype mode +# +#isis.services.translation.po.mode=read + + + + + +################################################################################ +# +# Viewer defaults +# +################################################################################# + +# +# Specify viewer defaults +# +#isis.viewers.paged.standalone=30 +#isis.viewers.paged.parented=10 + + +#isis.viewers.propertyLayout.labelPosition=LEFT +#isis.viewers.parameterLayout.labelPosition=LEFT diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/logging.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/logging.properties new file mode 100644 index 00000000..62fd8ea5 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/logging.properties @@ -0,0 +1,187 @@ +# 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. + + +# +# Isis uses log4j is used to provide system logging +# +log4j.rootCategory=INFO, Console +#log4j.rootCategory=DEBUG, Console + + +# The console appender +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.target=System.out +log4j.appender.Console.layout=org.apache.log4j.PatternLayout +log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n + + +# The stderr appender +log4j.appender.Stderr=org.apache.log4j.ConsoleAppender +log4j.appender.Stderr.target=System.err +log4j.appender.Stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.Stderr.layout.ConversionPattern=%d{ABSOLUTE} [%-20c{1} %-10t %-5p] %m%n + + +# other appenders +log4j.appender.File=org.apache.log4j.RollingFileAppender +log4j.appender.File.file=isis.log +log4j.appender.File.append=false +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n + +log4j.appender.sql=org.apache.log4j.FileAppender +log4j.appender.sql.File=./logs/sql.log +log4j.appender.sql.Append=false +log4j.appender.sql.layout=org.apache.log4j.PatternLayout +log4j.appender.sql.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n + +log4j.appender.sqltiming=org.apache.log4j.FileAppender +log4j.appender.sqltiming.File=./logs/sqltiming.log +log4j.appender.sqltiming.Append=false +log4j.appender.sqltiming.layout=org.apache.log4j.PatternLayout +log4j.appender.sqltiming.layout.ConversionPattern=-----> %d{yyyy-MM-dd HH:mm:ss.SSS} %m%n%n + +log4j.appender.jdbc=org.apache.log4j.FileAppender +log4j.appender.jdbc.File=./logs/jdbc.log +log4j.appender.jdbc.Append=false +log4j.appender.jdbc.layout=org.apache.log4j.PatternLayout +log4j.appender.jdbc.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n + +log4j.appender.connection=org.apache.log4j.FileAppender +log4j.appender.connection.File=./logs/connection.log +log4j.appender.connection.Append=false +log4j.appender.connection.layout=org.apache.log4j.PatternLayout +log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n + + + + +! turn on the internal log4j debugging flag so we can see what it is doing +#log4j.debug=true + + +# DataNucleus +# the first two log the DML and DDL (if set to DEBUG) +log4j.logger.DataNucleus.Datastore.Native=WARN, Console +log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console +# the remainder can probably be left to WARN +log4j.logger.DataNucleus.Persistence=WARN, Console +log4j.logger.DataNucleus.Transaction=WARN, Console +log4j.logger.DataNucleus.Connection=WARN, Console +log4j.logger.DataNucleus.Query=WARN, Console +log4j.logger.DataNucleus.Cache=WARN, Console +log4j.logger.DataNucleus.MetaData=WARN, Console +log4j.logger.DataNucleus.Datastore=WARN, Console +log4j.logger.DataNucleus.Datastore.Persist=WARN, Console +log4j.logger.DataNucleus.Datastore.Retrieve=WARN, Console +log4j.logger.DataNucleus.General=WARN, Console +log4j.logger.DataNucleus.Lifecycle=WARN, Console +log4j.logger.DataNucleus.ValueGeneration=WARN, Console +log4j.logger.DataNucleus.Enhancer=WARN, Console +log4j.logger.DataNucleus.SchemaTool=ERROR, Console +log4j.logger.DataNucleus.JDO=WARN, Console +log4j.logger.DataNucleus.JPA=ERROR, Console +log4j.logger.DataNucleus.JCA=WARN, Console +log4j.logger.DataNucleus.IDE=ERROR, Console + +log4j.additivity.DataNucleus.Datastore.Native=false +log4j.additivity.DataNucleus.Datastore.Schema=false +log4j.additivity.DataNucleus.Datastore.Persistence=false +log4j.additivity.DataNucleus.Datastore.Transaction=false +log4j.additivity.DataNucleus.Datastore.Connection=false +log4j.additivity.DataNucleus.Datastore.Query=false +log4j.additivity.DataNucleus.Datastore.Cache=false +log4j.additivity.DataNucleus.Datastore.MetaData=false +log4j.additivity.DataNucleus.Datastore.Datastore=false +log4j.additivity.DataNucleus.Datastore.Datastore.Persist=false +log4j.additivity.DataNucleus.Datastore.Datastore.Retrieve=false +log4j.additivity.DataNucleus.Datastore.General=false +log4j.additivity.DataNucleus.Datastore.Lifecycle=false +log4j.additivity.DataNucleus.Datastore.ValueGeneration=false +log4j.additivity.DataNucleus.Datastore.Enhancer=false +log4j.additivity.DataNucleus.Datastore.SchemaTool=false +log4j.additivity.DataNucleus.Datastore.JDO=false +log4j.additivity.DataNucleus.Datastore.JPA=false +log4j.additivity.DataNucleus.Datastore.JCA=false +log4j.additivity.DataNucleus.Datastore.IDE=false + + +# if using log4jdbc-remix as JDBC driver +#log4j.logger.jdbc.sqlonly=DEBUG, sql, Console +#log4j.additivity.jdbc.sqlonly=false +#log4j.logger.jdbc.resultsettable=DEBUG, jdbc, Console +#log4j.additivity.jdbc.resultsettable=false + +#log4j.logger.jdbc.audit=WARN,jdbc, Console +#log4j.additivity.jdbc.audit=false +#log4j.logger.jdbc.resultset=WARN,jdbc +#log4j.additivity.jdbc.resultset=false +#log4j.logger.jdbc.sqltiming=WARN,sqltiming +#log4j.additivity.jdbc.sqltiming=false +#log4j.logger.jdbc.connection=FATAL,connection +#log4j.additivity.jdbc.connection=false + + + +# track Isis/JDO lifecycle integration + +#log4j.logger.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=DEBUG, Console +#log4j.additivity.org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.persistence.FrameworkSynchronizer=false + +#log4j.logger.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=DEBUG,Console +#log4j.additivity.org.apache.isis.objectstore.jdo.datanucleus.persistence.IsisLifecycleListener=false + + + + +# track Isis/Wicket lifecycle integration + +#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=DEBUG, Console +#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis=false + +#log4j.logger.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=INFO,Console +#log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration.isis.IsisContextForWicket=false + + + + +# quieten some of the noisier classes in Isis' bootstrapping +log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console +log4j.additivity.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=false + +log4j.logger.org.apache.isis.core.metamodel.specloader.ServiceInitializer=WARN,Console +log4j.additivity.org.apache.isis.core.metamodel.specloader.ServiceInitializer=false + +log4j.logger.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=WARN,Console +log4j.additivity.org.apache.isis.core.runtime.services.ServicesInstallerFromConfiguration=false + +log4j.logger.org.apache.isis.core.commons.config.IsisConfigurationDefault=WARN,Console +log4j.additivity.org.apache.isis.core.commons.config.IsisConfigurationDefault=false + +log4j.logger.org.apache.isis.core.runtime.installers.InstallerLookupDefault=WARN,Console +log4j.additivity.org.apache.isis.core.runtime.installers.InstallerLookupDefault=false + + +# quieten Shiro +log4j.logger.org.apache.shiro.realm.AuthorizingRealm=WARN,Console +log4j.additivity.log4j.logger.org.apache.shiro.realm.AuthorizingRealm=false + + +# Application-specific logging +log4j.logger.dom.simple.SimpleObject=DEBUG, Stderr +log4j.additivity.dom.simple.SimpleObject=false \ No newline at end of file diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/persistor.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/persistor.properties new file mode 100644 index 00000000..c73af73c --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/persistor.properties @@ -0,0 +1,128 @@ +# 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. + + + +################################################################################# +# +# Persistor +# +################################################################################# + + + +# generally speaking this should not be enabled +isis.persistor.disableConcurrencyChecking=false + + + + +################################################################################# +# +# JDBC configuration +# +################################################################################# + +# +# configuration file holding the JDO objectstore's JDBC configuration +# (this is a bit of a hack... just exploiting fact that Isis also loads this file) +# + + +# +# JDBC connection details +# (also update the pom.xml to reference the appropriate JDBC driver) +# + +# +# HSQLDB in-memory +# +isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver +isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test +isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa +isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword= + +# +# HSQLDB in-memory (using log4jdbc-remix) +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword= + + + +# +# HSQLDB to file +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:file:/tmp/isis-simple-app/hsql-db;hsqldb.write_delay=false;shutdown=true +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword= + +# +# HSQLDB to file (using log4jdbc-remix) +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:file:/tmp/isis-simple-app/hsql-db;hsqldb.write_delay=false;shutdown=true +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword= + + + +# +# PostgreSQL Server +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.postgresql.Driver +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:postgresql://localhost:5432/isis +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis + +# +# PostgreSQL Server (using log4jdbc-remix) +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:postgresql://localhost:5432/isis +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis + + + +# +# MS SQL Server +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=simple +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=p4ssword + +# +# MS SQL Server (using log4jdbc-remix) +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=SQLEXPRESS;databaseName=jdo +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=jdo +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=jdopass + + + +# +# neo4j +# (experimental; run with -P neo4j profile in webapp project) +# +#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=neo4j:neo4j_DB + diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties new file mode 100644 index 00000000..675ced3b --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties @@ -0,0 +1,93 @@ +# 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. + +# +# configuration file for the JDO/DataNucleus objectstore +# + +# identifies @PersistenceCapable entities to be eagerly registered +# if move class to other package (eg com.mycompany.myapp.dom) then update +isis.persistor.datanucleus.RegisterEntities.packagePrefix=domainapp.dom.modules + +# +# hook to perform additional initialization when JDO class metadata is loaded +# default implementation will attempt to run 'create schema' for the specified schema. +# +#isis.persistor.datanucleus.classMetadataLoadedListener=org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaFromClassMetadata + + +# whether to persist the event data as a "clob" or as a "zipped" byte[] +# default is "zipped" +#isis.persistor.datanucleus.PublishingService.serializedForm=zipped + + +##################################################################### +# +# DataNucleus' configuration +# +# The 'isis.persistor.datanucleus.impl' prefix is stripped off, +# remainder is passed through to DataNucleus +# +##################################################################### + +isis.persistor.datanucleus.impl.datanucleus.schema.autoCreateAll=true +isis.persistor.datanucleus.impl.datanucleus.schema.validateTables=true +isis.persistor.datanucleus.impl.datanucleus.schema.validateConstraints=true + + +# +# Require explicit persistence (since entities are Comparable and using ObjectContracts#compareTo). +# see http://www.datanucleus.org/products/accessplatform_3_0/jdo/transaction_types.html +# +isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false + + +# +# How column names are identified +# (http://www.datanucleus.org/products/datanucleus/jdo/orm/datastore_identifiers.html) +# +isis.persistor.datanucleus.impl.datanucleus.identifier.case=MixedCase + +# +# L2 cache +# off except if explicitly marked as cacheable +# http://www.datanucleus.org/products/datanucleus/jdo/cache.html +# +isis.persistor.datanucleus.impl.datanucleus.cache.level2.type=none +isis.persistor.datanucleus.impl.datanucleus.cache.level2.mode=ENABLE_SELECTIVE + + + +# +# uncomment to use JNDI rather than direct JDBC +# +#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart + +# +# uncomment to use JTA resource +# +#isis.persistor.datanucleus.impl.datanucleus.ConnectionFactory2Name=java:comp/env/jdbc/quickstart-nontx +#isis.persistor.datanucleus.impl.javax.jdo.option.TransactionType=JTA + + + +# +# +# JDBC connection details +# ... are in persistor.properties +# +# diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/shiro.ini b/naked-objects/webapp/src/main/webapp/WEB-INF/shiro.ini new file mode 100644 index 00000000..971ae697 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/shiro.ini @@ -0,0 +1,93 @@ +# +# 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. +# + +[main] + +contextFactory = org.apache.isis.security.shiro.IsisLdapContextFactory +contextFactory.url = ldap://localhost:10389 +contextFactory.authenticationMechanism = CRAM-MD5 +contextFactory.systemAuthenticationMechanism = simple +contextFactory.systemUsername = uid=admin,ou=system +contextFactory.systemPassword = secret + +ldapRealm = org.apache.isis.security.shiro.IsisLdapRealm +ldapRealm.contextFactory = $contextFactory + +ldapRealm.searchBase = ou=groups,o=mojo +ldapRealm.groupObjectClass = groupOfUniqueNames +ldapRealm.uniqueMemberAttribute = uniqueMember +ldapRealm.uniqueMemberAttributeValueTemplate = uid={0} + +# optional mapping from physical groups to logical application roles +#ldapRealm.rolesByGroup = \ +# LDN_USERS: user_role,\ +# NYK_USERS: user_role,\ +# HKG_USERS: user_role,\ +# GLOBAL_ADMIN: admin_role,\ +# DEMOS: self-install_role + +ldapRealm.permissionsByRole=\ + user_role = *:ToDoItemsJdo:*:*,\ + *:ToDoItem:*:*; \ + self-install_role = *:ToDoItemsFixturesService:install:* ; \ + admin_role = * + +# to use ldap... +# (see docs for details of how to setup users/groups in Apache Directory Studio). +#securityManager.realms = $ldapRealm + +# to use .ini file +securityManager.realms = $iniRealm + + + +# ----------------------------------------------------------------------------- +# Users and their assigned roles +# +# Each line conforms to the format defined in the +# org.apache.shiro.realm.text.TextConfigurationRealm#setUserDefinitions JavaDoc +# ----------------------------------------------------------------------------- + +[users] +# user = password, role1, role2, role3, ... + + +sven = pass, admin_role +dick = pass, user_role, self-install_role +bob = pass, user_role, self-install_role +joe = pass, user_role, self-install_role +guest = guest, user_role + + + +# ----------------------------------------------------------------------------- +# Roles with assigned permissions +# +# Each line conforms to the format defined in the +# org.apache.shiro.realm.text.TextConfigurationRealm#setRoleDefinitions JavaDoc +# ----------------------------------------------------------------------------- + +[roles] +# role = perm1, perm2, perm3, ... +# perm in format: packageName:className:memberName:r,w + +user_role = *:SimpleObjects:*:*,\ + *:SimpleObject:*:* +self-install_role = *:DomainAppFixtureService:*:* +admin_role = * diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/translations-en.po b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-en.po new file mode 100644 index 00000000..47b82d11 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-en.po @@ -0,0 +1,213 @@ +############################################################################## +# +# .pot file +# +# Translate this file to each required language and place in WEB-INF, eg: +# +# /WEB-INF/translations-en_US.po +# /WEB-INF/translations-en.po +# /WEB-INF/translations-fr_FR.po +# /WEB-INF/translations-fr.po +# /WEB-INF/translations.po +# +# If the app uses TranslatableString (eg for internationalized validation +# messages), or if the app calls the TranslationService directly, then ensure +# that all text to be translated has been captured by running a full +# integration test suite that exercises all relevant behaviour +# +############################################################################## + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations(java.lang.String) +msgid ".pot file name" +msgstr ".pot file name" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#resetTranslationCache() +msgid "Clear translation cache" +msgstr "Clear translation cache" + + +#: domainapp.dom.modules.simple.SimpleObjects#create() +msgid "Create" +msgstr "Create" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#discoverable +msgid "Discoverable" +msgstr "Discoverable" + + +#: org.apache.isis.applib.fixtures.FixtureType#DOMAIN_OBJECTS +msgid "Domain Objects" +msgstr "Domain Objects" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations() +msgid "Download Translations" +msgstr "Download Translations" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Exclamation mark is not allowed" +msgstr "Exclamation mark is not allowed" + + +#: domainapp.dom.modules.simple.SimpleObjects#findByName() +msgid "Find By Name" +msgstr "Find By Name" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#fixtureScriptClassName +msgid "Fixture script" +msgstr "Fixture script" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#friendlyName +msgid "Friendly Name" +msgstr "Friendly Name" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "General" +msgstr "General" + + +#: domainapp.dom.app.homepage.HomePageService#homePage() +msgid "Home Page" +msgstr "Home Page" + + +#: domainapp.dom.modules.simple.SimpleObjects#listAll() +msgid "List All" +msgstr "List All" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#localName +msgid "Local Name" +msgstr "Local Name" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#lookup() +#: org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions#lookup() +msgid "Lookup" +msgstr "Lookup" + + +#: domainapp.dom.modules.simple.SimpleObject#name +#: domainapp.dom.modules.simple.SimpleObjects#create(java.lang.String) +#: domainapp.dom.modules.simple.SimpleObjects#findByName(java.lang.String) +msgid "Name" +msgstr "Name" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName(java.lang.String) +msgid "New name" +msgstr "New name" + + +#: org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object() +msgid "Object" +msgstr "Object" + + +#: domainapp.dom.modules.simple.SimpleObject#title() +msgid "Object: {name}" +msgstr "Object: {name}" + + +#: domainapp.dom.app.homepage.HomePageViewModel#objects +msgid "Objects" +msgstr "Objects" + + +#: org.apache.isis.applib.fixtures.FixtureType#OTHER +msgid "Other" +msgstr "Other" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Parameters" +msgstr "Parameters" + + +#: domainapp.fixture.DomainAppFixturesService +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu +msgid "Prototyping" +msgstr "Prototyping" + + +#: domainapp.fixture.DomainAppFixturesService#recreateObjectsAndReturnFirst() +msgid "Recreate Objects And Return First" +msgstr "Recreate Objects And Return First" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#object +msgid "Result" +msgstr "Result" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#className +msgid "Result class" +msgstr "Result class" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#key +msgid "Result key" +msgstr "Result key" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript() +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript() +msgid "Run Fixture Script" +msgstr "Run Fixture Script" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript +msgid "Script" +msgstr "Script" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Script-specific parameters (if any). The format depends on the script implementation (eg key=value, CSV, JSON, XML etc)" +msgstr "Script-specific parameters (if any). The format depends on the script implementation (eg key=value, CSV, JSON, XML etc)" + + +#: domainapp.dom.modules.simple.SimpleObjects#title() +msgid "Simple Objects" +msgstr "Simple Objects" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToReadingTranslations() +msgid "Switch To Reading Translations" +msgstr "Switch To Reading Translations" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToWritingTranslations() +msgid "Switch To Writing Translations" +msgstr "Switch To Writing Translations" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#type +msgid "Type" +msgstr "Type" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Update Name" +msgstr "Update Name" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "name" +msgstr "" + + + + + +############################################################################## +# end of .pot file +############################################################################## + diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/translations-es.po b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-es.po new file mode 100644 index 00000000..8b4c2d7b --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-es.po @@ -0,0 +1,208 @@ +############################################################################## +# +# .pot file +# +# Translate this file to each required language and place in WEB-INF, eg: +# +# /WEB-INF/translations-en_US.po +# /WEB-INF/translations-en.po +# /WEB-INF/translations-fr_FR.po +# /WEB-INF/translations-fr.po +# /WEB-INF/translations.po +# +# If the app uses TranslatableString (eg for internationalized validation +# messages), or if the app calls the TranslationService directly, then ensure +# that all text to be translated has been captured by running a full +# integration test suite that exercises all relevant behaviour +# +############################################################################## + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations(java.lang.String) +msgid ".pot file name" +msgstr "fichero .pot" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#resetTranslationCache() +msgid "Clear translation cache" +msgstr "Limpiar la caché de traducciones" + + +#: domainapp.dom.modules.simple.SimpleObjects#create() +msgid "Create" +msgstr "Crear" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#discoverable +msgid "Discoverable" +msgstr "Descubrible" + + +#: org.apache.isis.applib.fixtures.FixtureType#DOMAIN_OBJECTS +msgid "Domain Objects" +msgstr "Domain Objects" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations() +msgid "Download Translations" +msgstr "Descargar traducciones" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Exclamation mark is not allowed" +msgstr "No se admite el signo de exclamación" + + +#: domainapp.dom.modules.simple.SimpleObjects#findByName() +msgid "Find By Name" +msgstr "Buscar por Nombre" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#fixtureScriptClassName +msgid "Fixture script" +msgstr "Script de Instalación" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#friendlyName +msgid "Friendly Name" +msgstr "Nombre común" + + +#: domainapp.dom.app.homepage.HomePageService#homePage() +msgid "Home Page" +msgstr "Página de Inicio" + + +#: domainapp.dom.modules.simple.SimpleObjects#listAll() +msgid "List All" +msgstr "Listar Todos" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#localName +msgid "Local Name" +msgstr "Nombre Local" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#lookup() +#: org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions#lookup() +msgid "Lookup" +msgstr "Buscar" + + +#: domainapp.dom.modules.simple.SimpleObject#name +#: domainapp.dom.modules.simple.SimpleObjects#create(java.lang.String) +#: domainapp.dom.modules.simple.SimpleObjects#findByName(java.lang.String) +msgid "Name" +msgstr "Nombre" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName(java.lang.String) +msgid "New name" +msgstr "Nuevo nombre" + + +#: org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object() +msgid "Object" +msgstr "Objeto" + + +#: domainapp.dom.modules.simple.SimpleObject#title() +msgid "Object: {name}" +msgstr "Objeto: {name}" + + +#: domainapp.dom.app.homepage.HomePageViewModel#objects +msgid "Objects" +msgstr "Objetos" + + +#: org.apache.isis.applib.fixtures.FixtureType#OTHER +msgid "Other" +msgstr "Other" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Parameters" +msgstr "Parámetros" + + +#: domainapp.fixture.DomainAppFixturesService +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu +msgid "Prototyping" +msgstr "Prototipo" + + +#: domainapp.fixture.DomainAppFixturesService#recreateObjectsAndReturnFirst() +msgid "Recreate Objects And Return First" +msgstr "Recrear Objetos y Devolver el Primero" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#object +msgid "Result" +msgstr "Resultado" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#className +msgid "Result class" +msgstr "Clase del resultado" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#key +msgid "Result key" +msgstr "Clave del Resultado" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript() +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript() +msgid "Run Fixture Script" +msgstr "Ejecutar Script de Instalación" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript +msgid "Script" +msgstr "Script" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Script-specific parameters (if any). The format depends on the script implementation (eg key=value, CSV, JSON, XML etc)" +msgstr "Parámetros específicos del Script (si hay alguno). El formato depende de la implementación del script (por ejemplo, clave=valor, CSV, JSON, XML, etc.)" + + +#: domainapp.dom.modules.simple.SimpleObjects#title() +msgid "Simple Objects" +msgstr "Objetos básicos" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToReadingTranslations() +msgid "Switch To Reading Translations" +msgstr "Cambiar a Lectura de Traducciones" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToWritingTranslations() +msgid "Switch To Writing Translations" +msgstr "Cambiar a Escritura de Traducciones" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#type +msgid "Type" +msgstr "Tipo" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Update Name" +msgstr "Nombre de la Actualización" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "name" +msgstr "" + + + + + +############################################################################## +# end of .pot file +############################################################################## + diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/translations-nl.po b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-nl.po new file mode 100644 index 00000000..4e35a228 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/translations-nl.po @@ -0,0 +1,208 @@ +############################################################################## +# +# .pot file +# +# Translate this file to each required language and place in WEB-INF, eg: +# +# /WEB-INF/translations-en_US.po +# /WEB-INF/translations-en.po +# /WEB-INF/translations-fr_FR.po +# /WEB-INF/translations-fr.po +# /WEB-INF/translations.po +# +# If the app uses TranslatableString (eg for internationalized validation +# messages), or if the app calls the TranslationService directly, then ensure +# that all text to be translated has been captured by running a full +# integration test suite that exercises all relevant behaviour +# +############################################################################## + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations(java.lang.String) +msgid ".pot file name" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#resetTranslationCache() +msgid "Clear translation cache" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#create() +msgid "Create" +msgstr "Creëren" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#discoverable +msgid "Discoverable" +msgstr "Discoverable" + + +#: org.apache.isis.applib.fixtures.FixtureType#DOMAIN_OBJECTS +msgid "Domain Objects" +msgstr "Domain Objects" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations() +msgid "Download Translations" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Exclamation mark is not allowed" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#findByName() +msgid "Find By Name" +msgstr "Zoek op Naam" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#fixtureScriptClassName +msgid "Fixture script" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#friendlyName +msgid "Friendly Name" +msgstr "" + + +#: domainapp.dom.app.homepage.HomePageService#homePage() +msgid "Home Page" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#listAll() +msgid "List All" +msgstr "Lijst Alle" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#localName +msgid "Local Name" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#lookup() +#: org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions#lookup() +msgid "Lookup" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#name +#: domainapp.dom.modules.simple.SimpleObjects#create(java.lang.String) +#: domainapp.dom.modules.simple.SimpleObjects#findByName(java.lang.String) +msgid "Name" +msgstr "Naam" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName(java.lang.String) +msgid "New name" +msgstr "Nieuwe naam" + + +#: org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object() +msgid "Object" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#title() +msgid "Object: {name}" +msgstr "" + + +#: domainapp.dom.app.homepage.HomePageViewModel#objects +msgid "Objects" +msgstr "Objects" + + +#: org.apache.isis.applib.fixtures.FixtureType#OTHER +msgid "Other" +msgstr "Other" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Parameters" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu +msgid "Prototyping" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#recreateObjectsAndReturnFirst() +msgid "Recreate Objects And Return First" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#object +msgid "Result" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#className +msgid "Result class" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#key +msgid "Result key" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript() +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript() +msgid "Run Fixture Script" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript +msgid "Script" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Script-specific parameters (if any). The format depends on the script implementation (eg key=value, CSV, JSON, XML etc)" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#title() +msgid "Simple Objects" +msgstr "Eenvoudige Objecten" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToReadingTranslations() +msgid "Switch To Reading Translations" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToWritingTranslations() +msgid "Switch To Writing Translations" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#type +msgid "Type" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Update Name" +msgstr "Updaten Naam" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "name" +msgstr "" + + + + + +############################################################################## +# end of .pot file +############################################################################## + diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/translations.po b/naked-objects/webapp/src/main/webapp/WEB-INF/translations.po new file mode 100644 index 00000000..3644a288 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/translations.po @@ -0,0 +1,213 @@ +############################################################################## +# +# .pot file +# +# Translate this file to each required language and place in WEB-INF, eg: +# +# /WEB-INF/translations-en_US.po +# /WEB-INF/translations-en.po +# /WEB-INF/translations-fr_FR.po +# /WEB-INF/translations-fr.po +# /WEB-INF/translations.po +# +# If the app uses TranslatableString (eg for internationalized validation +# messages), or if the app calls the TranslationService directly, then ensure +# that all text to be translated has been captured by running a full +# integration test suite that exercises all relevant behaviour +# +############################################################################## + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations(java.lang.String) +msgid ".pot file name" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#resetTranslationCache() +msgid "Clear translation cache" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#create() +msgid "Create" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#discoverable +msgid "Discoverable" +msgstr "" + + +#: org.apache.isis.applib.fixtures.FixtureType#DOMAIN_OBJECTS +msgid "Domain Objects" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#downloadTranslations() +msgid "Download Translations" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Exclamation mark is not allowed" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#findByName() +msgid "Find By Name" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#fixtureScriptClassName +msgid "Fixture script" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#friendlyName +msgid "Friendly Name" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "General" +msgstr "Common" + + +#: domainapp.dom.app.homepage.HomePageService#homePage() +msgid "Home Page" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#listAll() +msgid "List All" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#localName +msgid "Local Name" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#lookup() +#: org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions#lookup() +msgid "Lookup" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#name +#: domainapp.dom.modules.simple.SimpleObjects#create(java.lang.String) +#: domainapp.dom.modules.simple.SimpleObjects#findByName(java.lang.String) +msgid "Name" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName(java.lang.String) +msgid "New name" +msgstr "" + + +#: org.apache.isis.applib.services.bookmark.BookmarkHolderAssociationContributions#object() +msgid "Object" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#title() +msgid "Object: {name}" +msgstr "" + + +#: domainapp.dom.app.homepage.HomePageViewModel#objects +msgid "Objects" +msgstr "" + + +#: org.apache.isis.applib.fixtures.FixtureType#OTHER +msgid "Other" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Parameters" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu +msgid "Prototyping" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#recreateObjectsAndReturnFirst() +msgid "Recreate Objects And Return First" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#object +msgid "Result" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#className +msgid "Result class" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureResult#key +msgid "Result key" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript() +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript() +msgid "Run Fixture Script" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript +msgid "Script" +msgstr "" + + +#: domainapp.fixture.DomainAppFixturesService#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +#: org.apache.isis.applib.fixturescripts.FixtureScripts#runFixtureScript(org.apache.isis.applib.fixturescripts.FixtureScript,java.lang.String) +msgid "Script-specific parameters (if any). The format depends on the script implementation (eg key=value, CSV, JSON, XML etc)" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObjects#title() +msgid "Simple Objects" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToReadingTranslations() +msgid "Switch To Reading Translations" +msgstr "" + + +#: org.apache.isis.core.runtime.services.i18n.po.TranslationServicePoMenu#switchToWritingTranslations() +msgid "Switch To Writing Translations" +msgstr "" + + +#: org.apache.isis.applib.fixturescripts.FixtureScript#type +msgid "Type" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject#updateName() +msgid "Update Name" +msgstr "" + + +#: domainapp.dom.modules.simple.SimpleObject +msgid "name" +msgstr "" + + + + + +############################################################################## +# end of .pot file +############################################################################## + diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties new file mode 100644 index 00000000..0a85fb68 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_restfulobjects.properties @@ -0,0 +1,66 @@ +# 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. + +# +# configuration file for the Restful Objects viewer +# + +# the baseUrl for hrefs in the events generated by the RO EventSerializer +isis.viewer.restfulobjects.RestfulObjectsSpecEventSerializer.baseUrl=http://localhost:8080/restful/ + +# renders param details in the (incorrect) form that they were for GSOC2013 viewers +# isis.viewer.restfulobjects.gsoc2013.legacyParamDetails=true + +# whether to honor UI hints, in particular Render(EAGERLY). Defaults to false. +#isis.viewer.restfulobjects.honorUiHints=false + + + +############################################################################### +# Non-standard configuration settings. +# +# If enabled of the following are enabled then the viewer is deviating from the +# RO spec standard; compatibility may be compromised with RO clients. +############################################################################### + +# whether to show only object properties for object members +# (on the object representation only) +# Takes precedence over the other 'suppress' below. +#isis.viewer.restfulobjects.objectPropertyValuesOnly=true + +# whether to suppress "describedby" links. Defaults to false. +#isis.viewer.restfulobjects.suppressDescribedByLinks=true + +# whether to suppress "update" links. Defaults to false. +#isis.viewer.restfulobjects.suppressUpdateLink=true + +# whether to suppress "id" json-prop for object members. Defaults to false. +#isis.viewer.restfulobjects.suppressMemberId=true + +# whether to suppress "links" json-prop for object members +# (on the object representation only). Defaults to false. +#isis.viewer.restfulobjects.suppressMemberLinks=true + +# whether to suppress "extensions" json-prop for object members +# (on the object representation only). Defaults to false. +#isis.viewer.restfulobjects.suppressMemberExtensions=true + +# whether to suppress "disabledReason" json-prop for object members +# (on the object representation only). Defaults to false. +#isis.viewer.restfulobjects.suppressMemberDisabledReason=true + +############################################################################### diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties b/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties new file mode 100644 index 00000000..ba9eaaff --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/viewer_wicket.properties @@ -0,0 +1,91 @@ +# 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. + +# +# configuration file for the Wicket viewer +# + +# +# The maximum length of titles to display in standalone or parented tables. +# Titles longer than this length will be truncated with trailing ellipses (...) +# +# For example, if set to 12, the title +# "Buy milk on 15-Feb-13" will be truncated to "Buy milk ..." +# +# If set to 0, then only the icon will be shown. +# +isis.viewer.wicket.maxTitleLengthInStandaloneTables=0 +isis.viewer.wicket.maxTitleLengthInParentedTables=0 + + +#isis.viewer.wicket.datePattern=dd-MM-yyyy +#isis.viewer.wicket.dateTimePattern=dd-MM-yyyy HH:mm +#isis.viewer.wicket.datePickerPattern=DD-MM-YYYY + +#isis.viewer.wicket.datePattern=dd/MM/yy +#isis.viewer.wicket.dateTimePattern=dd/MM/yy HH:mm +#isis.viewer.wicket.datePickerPattern=DD/MM/YY + + +# +# whether to strip wicket tags from markup (default is true, as they may break some CSS rules) +# +#isis.viewer.wicket.stripWicketTags=false + + +# +# whether to suppress the 'rememberMe' checkbox on the login page (default is false) +# +#isis.viewer.wicket.suppressRememberMe=false + +# +# if user attempts to access a protected URL before signing in, then as a convenience the viewer will continue +# through to that destination after successful login. If you consider this to be a security risk then this flag +# disables that behaviour (default is false). +# +#isis.viewer.wicket.clearOriginalDestination=true + + +# +# whether to show action dialogs on their own page rather than as a modal dialog (default is false) +# +#isis.viewer.wicket.disableModalDialogs=false + + +# +# the maximum number of pages to list in bookmark (default is 15) +# +#isis.viewer.wicket.bookmarkedPages.maxSize=15 + + +# +# whether to show the bootstrap theme chooser (defaults false) +# +#isis.viewer.wicket.themes.showChooser=false +isis.viewer.wicket.themes.showChooser=true + +# +# comma-separated list of themes to choose from (default is to show all themes from bootswatch.com). +# +#isis.viewer.wicket.themes.enabled=bootstrap-theme,Cosmo,Flatly,Darkly,Sandstone,United + + + +# +# whether to automatically select dependent choice when the choice it depends upon changes. +# +#isis.viewer.wicket.disableDependentChoiceAutoSelection=false \ No newline at end of file diff --git a/naked-objects/webapp/src/main/webapp/WEB-INF/web.xml b/naked-objects/webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..bb6098f0 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,309 @@ + + + + + Simple app + + + about/index.html + + + + + org.apache.shiro.web.env.EnvironmentLoaderListener + + + + ShiroFilter + org.apache.shiro.web.servlet.ShiroFilter + + + + ShiroFilter + /* + + + + + + + + + + + isis.viewers + wicket,restfulobjects + + + + + + + IsisLogOnExceptionFilter + org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter + + + IsisLogOnExceptionFilter + /wicket/* + + + IsisLogOnExceptionFilter + /restful/* + + + + + + + ResourceCachingFilter + org.apache.isis.core.webapp.content.ResourceCachingFilter + + CacheTime + 86400 + + + + ResourceCachingFilter + *.js + + + ResourceCachingFilter + *.css + + + ResourceCachingFilter + *.png + + + ResourceCachingFilter + *.jpg + + + ResourceCachingFilter + *.gif + + + ResourceCachingFilter + *.html + + + ResourceCachingFilter + *.swf + + + + Resource + org.apache.isis.core.webapp.content.ResourceServlet + + + Resource + *.css + + + Resource + *.png + + + Resource + *.jpg + + + Resource + *.gif + + + Resource + *.js + + + Resource + *.html + + + Resource + *.swf + + + + + + + WicketFilter + org.apache.wicket.protocol.http.WicketFilter + + applicationClassName + domainapp.webapp.SimpleApplication + + + + WicketFilter + /wicket/* + + + + + configuration + + development + + + + + + + + + + org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap + + + + + javax.ws.rs.Application + org.apache.isis.viewer.restfulobjects.server.RestfulObjectsApplication + + + + resteasy.servlet.mapping.prefix + /restful/ + + + + + + IsisSessionFilterForRestfulObjects + org.apache.isis.core.webapp.IsisSessionFilter + + + authenticationSessionStrategy + org.apache.isis.viewer.restfulobjects.server.authentication.AuthenticationSessionStrategyBasicAuth + + + + whenNoSession + basicAuthChallenge + + + + + IsisSessionFilterForRestfulObjects + RestfulObjectsRestEasyDispatcher + + + + IsisTransactionFilterForRestfulObjects + org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects + + + IsisTransactionFilterForRestfulObjects + RestfulObjectsRestEasyDispatcher + + + + + RestfulObjectsRestEasyDispatcher + org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher + + + RestfulObjectsRestEasyDispatcher + /restful/* + + + + + + + + + + diff --git a/naked-objects/webapp/src/main/webapp/about/images/isis-logo.png b/naked-objects/webapp/src/main/webapp/about/images/isis-logo.png new file mode 100644 index 00000000..5284fe73 Binary files /dev/null and b/naked-objects/webapp/src/main/webapp/about/images/isis-logo.png differ diff --git a/naked-objects/webapp/src/main/webapp/about/index.html b/naked-objects/webapp/src/main/webapp/about/index.html new file mode 100644 index 00000000..070651ac --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/about/index.html @@ -0,0 +1,102 @@ + + + + + + Apache Isis™ SimpleApp + + + + +
+ Isis Logo + +

+ This app has been generated using Apache Isis' + SimpleApp archetype, + to create a purposefully minimal application that nevertheless includes fixture data, integration tests and BDD specs. +
+
+ The app itself consists of a single domain class, SimpleObject, + along with an equally simple (factory/repository) domain service, SimpleObjects. +

+ +

To access the app:

+
    +
  • +

    + wicket/ +

    +

    + provides accesses to a generic UI for end-users, + Isis' Wicket Viewer. + As its name suggests, this viewer is built on top of Apache Wicket™. +

    +
  • +
  • +

    + + restful/ + +

    +

    + provides access to a RESTful API conformant with the + Restful Objects spec. This is part of Apache Isis Core. The + implementation technology is JBoss RestEasy. +

    +
  • +
+ +

+ The default user/password is sven/pass (as configured in the + shiro.ini file). +

+ +
+ + diff --git a/naked-objects/webapp/src/main/webapp/css/application.css b/naked-objects/webapp/src/main/webapp/css/application.css new file mode 100644 index 00000000..9f1612af --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/css/application.css @@ -0,0 +1,19 @@ +/* + * 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. + */ + diff --git a/naked-objects/webapp/src/main/webapp/images/spinning-icon.gif b/naked-objects/webapp/src/main/webapp/images/spinning-icon.gif new file mode 100644 index 00000000..75e3b1e5 Binary files /dev/null and b/naked-objects/webapp/src/main/webapp/images/spinning-icon.gif differ diff --git a/naked-objects/webapp/src/main/webapp/scripts/application.js b/naked-objects/webapp/src/main/webapp/scripts/application.js new file mode 100644 index 00000000..d8cf6fe8 --- /dev/null +++ b/naked-objects/webapp/src/main/webapp/scripts/application.js @@ -0,0 +1,3 @@ +$(document).ready(function() { + /// here... +}); \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3d5dbfc9..1336bc6d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,5 @@ - + 4.0.0 com.iluwatar @@ -66,7 +65,8 @@ private-class-data object-pool dependency-injection - + naked-objects + @@ -119,7 +119,7 @@ - + @@ -164,4 +164,4 @@ - + \ No newline at end of file