You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/12/04 23:30:55 UTC
[5/47] ISIS-188: normalizing file endings throughout
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItem.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItem.java b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItem.java
index 73bb565..bf169bd 100644
--- a/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItem.java
+++ b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItem.java
@@ -1,295 +1,295 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.dom.items;
-
-import java.util.List;
-
-import com.google.common.base.Objects;
-
-import org.apache.isis.applib.annotation.Disabled;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.Ignore;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.annotation.RegEx;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.filter.Filter;
-import org.apache.isis.applib.filter.Filters;
-import org.apache.isis.applib.util.TitleBuffer;
-import org.apache.isis.applib.value.Date;
-
-/**
- * A todo item (task) owned by a particular user.
- */
-public class ToDoItem implements Comparable<ToDoItem> {
-
- private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
-
- // {{ Identification on the UI
- public String title() {
- final TitleBuffer buf = new TitleBuffer();
- buf.append(getDescription());
- if (isComplete()) {
- buf.append(" - Completed!");
- } else {
- if (getDueBy() != null) {
- buf.append(" due by ", getDueBy());
- }
- }
- return buf.toString();
- }
-
- // }}
-
- // {{ Description (property)
- private String description;
-
- @RegEx(validation = "\\w[@&:\\-\\,\\.\\+ \\w]*")
- // words, spaces and selected punctuation
- @MemberOrder(sequence = "1")
- // ordering within UI
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- // }}
-
- // {{ DueBy (property)
- private Date dueBy;
-
- @Optional
- // need not be set
- @MemberOrder(sequence = "2")
- public Date getDueBy() {
- return dueBy;
- }
-
- public void setDueBy(final Date dueBy) {
- this.dueBy = dueBy;
- }
-
- // proposed new value is validated before setting
- public String validateDueBy(final Date dueBy) {
- if (dueBy == null) {
- return null;
- }
- return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
- }
-
- // }}
-
- // {{ Category (property)
- private Category category;
-
- @MemberOrder(sequence = "3")
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(final Category category) {
- this.category = category;
- }
-
- // }}
-
- // {{ UserName (property)
- private String userName;
-
- @Hidden
- // not shown in the UI
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(final String userName) {
- this.userName = userName;
- }
-
- // }}
-
- // {{ Complete (property)
- private boolean complete;
-
- @Disabled
- // cannot be edited as a property
- @MemberOrder(sequence = "5")
- public boolean isComplete() {
- return complete;
- }
-
- public void setComplete(final boolean complete) {
- this.complete = complete;
- }
-
- // }}
-
- // {{ completed (action)
- @MemberOrder(sequence = "1")
- public ToDoItem completed() {
- setComplete(true);
- return this;
- }
-
- // disable action dependent on state of object
- public String disableCompleted() {
- return complete ? "Already completed" : null;
- }
-
- // }}
-
- // {{ notYetCompleted (action)
- @MemberOrder(sequence = "2")
- public ToDoItem notYetCompleted() {
- setComplete(false);
- return this;
- }
-
- // disable action dependent on state of object
- public String disableNotYetCompleted() {
- return !complete ? "Not yet completed" : null;
- }
-
- // }}
-
- // {{ clone (action)
- @Named("Clone")
- // the name of the action in the UI
- @MemberOrder(sequence = "3")
- // nb: method is not called "clone()" is inherited by java.lang.Object and
- // (a) has different semantics and (b) is in any case automatically ignored
- // by the framework
- public ToDoItem duplicate() {
- return toDoItems.newToDo(getDescription() + " - Copy", getCategory(), getDueBy());
- }
-
- // }}
-
- // {{ isDue (programmatic)
- @Ignore
- // excluded from the framework's metamodel
- public boolean isDue() {
- if (getDueBy() == null) {
- return false;
- }
- return !isMoreThanOneWeekInPast(getDueBy());
- }
-
- // }}
-
- // {{ SimilarItems (collection)
- @MemberOrder(sequence = "5")
- public List<ToDoItem> getSimilarItems() {
- return toDoItems.similarTo(this);
- }
-
- // }}
-
- // {{ compareTo (programmatic)
- /**
- * by complete flag, then due by date, then description
- */
- @Ignore
- // exclude from the framework's metamodel
- @Override
- public int compareTo(final ToDoItem other) {
- if (isComplete() && !other.isComplete()) {
- return +1;
- }
- if (!isComplete() && other.isComplete()) {
- return -1;
- }
- if (getDueBy() == null && other.getDueBy() != null) {
- return +1;
- }
- if (getDueBy() != null && other.getDueBy() == null) {
- return -1;
- }
- if (getDueBy() == null && other.getDueBy() == null || getDueBy().equals(this.getDescription())) {
- return getDescription().compareTo(other.getDescription());
- }
- return (int) (getDueBy().getMillisSinceEpoch() - other.getDueBy().getMillisSinceEpoch());
- }
-
- // }}
-
- // {{ helpers
- private static boolean isMoreThanOneWeekInPast(final Date dueBy) {
- return dueBy.getMillisSinceEpoch() < Clock.getTime() - ONE_WEEK_IN_MILLIS;
- }
-
- // }}
-
- // {{ filters (programmatic)
- public static Filter<ToDoItem> thoseDue() {
- return Filters.and(Filters.not(thoseComplete()), new Filter<ToDoItem>() {
- @Override
- public boolean accept(final ToDoItem t) {
- return t.isDue();
- }
- });
- }
-
- public static Filter<ToDoItem> thoseComplete() {
- return new Filter<ToDoItem>() {
- @Override
- public boolean accept(final ToDoItem t) {
- return t.isComplete();
- }
- };
- }
-
- public static Filter<ToDoItem> thoseOwnedBy(final String currentUser) {
- return new Filter<ToDoItem>() {
- @Override
- public boolean accept(final ToDoItem toDoItem) {
- return Objects.equal(toDoItem.getUserName(), currentUser);
- }
-
- };
- }
-
- public static Filter<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
- return new Filter<ToDoItem>() {
- @Override
- public boolean accept(final ToDoItem eachToDoItem) {
- return Objects.equal(toDoItem.getCategory(), eachToDoItem.getCategory()) &&
- Objects.equal(toDoItem.getUserName(), eachToDoItem.getUserName()) &&
- eachToDoItem != toDoItem;
- }
-
- };
- }
-
- // }}
-
- // {{ injected: ToDoItems
- private ToDoItems toDoItems;
-
- public void setToDoItems(final ToDoItems toDoItems) {
- this.toDoItems = toDoItems;
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.dom.items;
+
+import java.util.List;
+
+import com.google.common.base.Objects;
+
+import org.apache.isis.applib.annotation.Disabled;
+import org.apache.isis.applib.annotation.Hidden;
+import org.apache.isis.applib.annotation.Ignore;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.annotation.Optional;
+import org.apache.isis.applib.annotation.RegEx;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.filter.Filter;
+import org.apache.isis.applib.filter.Filters;
+import org.apache.isis.applib.util.TitleBuffer;
+import org.apache.isis.applib.value.Date;
+
+/**
+ * A todo item (task) owned by a particular user.
+ */
+public class ToDoItem implements Comparable<ToDoItem> {
+
+ private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
+
+ // {{ Identification on the UI
+ public String title() {
+ final TitleBuffer buf = new TitleBuffer();
+ buf.append(getDescription());
+ if (isComplete()) {
+ buf.append(" - Completed!");
+ } else {
+ if (getDueBy() != null) {
+ buf.append(" due by ", getDueBy());
+ }
+ }
+ return buf.toString();
+ }
+
+ // }}
+
+ // {{ Description (property)
+ private String description;
+
+ @RegEx(validation = "\\w[@&:\\-\\,\\.\\+ \\w]*")
+ // words, spaces and selected punctuation
+ @MemberOrder(sequence = "1")
+ // ordering within UI
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+
+ // }}
+
+ // {{ DueBy (property)
+ private Date dueBy;
+
+ @Optional
+ // need not be set
+ @MemberOrder(sequence = "2")
+ public Date getDueBy() {
+ return dueBy;
+ }
+
+ public void setDueBy(final Date dueBy) {
+ this.dueBy = dueBy;
+ }
+
+ // proposed new value is validated before setting
+ public String validateDueBy(final Date dueBy) {
+ if (dueBy == null) {
+ return null;
+ }
+ return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
+ }
+
+ // }}
+
+ // {{ Category (property)
+ private Category category;
+
+ @MemberOrder(sequence = "3")
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(final Category category) {
+ this.category = category;
+ }
+
+ // }}
+
+ // {{ UserName (property)
+ private String userName;
+
+ @Hidden
+ // not shown in the UI
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(final String userName) {
+ this.userName = userName;
+ }
+
+ // }}
+
+ // {{ Complete (property)
+ private boolean complete;
+
+ @Disabled
+ // cannot be edited as a property
+ @MemberOrder(sequence = "5")
+ public boolean isComplete() {
+ return complete;
+ }
+
+ public void setComplete(final boolean complete) {
+ this.complete = complete;
+ }
+
+ // }}
+
+ // {{ completed (action)
+ @MemberOrder(sequence = "1")
+ public ToDoItem completed() {
+ setComplete(true);
+ return this;
+ }
+
+ // disable action dependent on state of object
+ public String disableCompleted() {
+ return complete ? "Already completed" : null;
+ }
+
+ // }}
+
+ // {{ notYetCompleted (action)
+ @MemberOrder(sequence = "2")
+ public ToDoItem notYetCompleted() {
+ setComplete(false);
+ return this;
+ }
+
+ // disable action dependent on state of object
+ public String disableNotYetCompleted() {
+ return !complete ? "Not yet completed" : null;
+ }
+
+ // }}
+
+ // {{ clone (action)
+ @Named("Clone")
+ // the name of the action in the UI
+ @MemberOrder(sequence = "3")
+ // nb: method is not called "clone()" is inherited by java.lang.Object and
+ // (a) has different semantics and (b) is in any case automatically ignored
+ // by the framework
+ public ToDoItem duplicate() {
+ return toDoItems.newToDo(getDescription() + " - Copy", getCategory(), getDueBy());
+ }
+
+ // }}
+
+ // {{ isDue (programmatic)
+ @Ignore
+ // excluded from the framework's metamodel
+ public boolean isDue() {
+ if (getDueBy() == null) {
+ return false;
+ }
+ return !isMoreThanOneWeekInPast(getDueBy());
+ }
+
+ // }}
+
+ // {{ SimilarItems (collection)
+ @MemberOrder(sequence = "5")
+ public List<ToDoItem> getSimilarItems() {
+ return toDoItems.similarTo(this);
+ }
+
+ // }}
+
+ // {{ compareTo (programmatic)
+ /**
+ * by complete flag, then due by date, then description
+ */
+ @Ignore
+ // exclude from the framework's metamodel
+ @Override
+ public int compareTo(final ToDoItem other) {
+ if (isComplete() && !other.isComplete()) {
+ return +1;
+ }
+ if (!isComplete() && other.isComplete()) {
+ return -1;
+ }
+ if (getDueBy() == null && other.getDueBy() != null) {
+ return +1;
+ }
+ if (getDueBy() != null && other.getDueBy() == null) {
+ return -1;
+ }
+ if (getDueBy() == null && other.getDueBy() == null || getDueBy().equals(this.getDescription())) {
+ return getDescription().compareTo(other.getDescription());
+ }
+ return (int) (getDueBy().getMillisSinceEpoch() - other.getDueBy().getMillisSinceEpoch());
+ }
+
+ // }}
+
+ // {{ helpers
+ private static boolean isMoreThanOneWeekInPast(final Date dueBy) {
+ return dueBy.getMillisSinceEpoch() < Clock.getTime() - ONE_WEEK_IN_MILLIS;
+ }
+
+ // }}
+
+ // {{ filters (programmatic)
+ public static Filter<ToDoItem> thoseDue() {
+ return Filters.and(Filters.not(thoseComplete()), new Filter<ToDoItem>() {
+ @Override
+ public boolean accept(final ToDoItem t) {
+ return t.isDue();
+ }
+ });
+ }
+
+ public static Filter<ToDoItem> thoseComplete() {
+ return new Filter<ToDoItem>() {
+ @Override
+ public boolean accept(final ToDoItem t) {
+ return t.isComplete();
+ }
+ };
+ }
+
+ public static Filter<ToDoItem> thoseOwnedBy(final String currentUser) {
+ return new Filter<ToDoItem>() {
+ @Override
+ public boolean accept(final ToDoItem toDoItem) {
+ return Objects.equal(toDoItem.getUserName(), currentUser);
+ }
+
+ };
+ }
+
+ public static Filter<ToDoItem> thoseSimilarTo(final ToDoItem toDoItem) {
+ return new Filter<ToDoItem>() {
+ @Override
+ public boolean accept(final ToDoItem eachToDoItem) {
+ return Objects.equal(toDoItem.getCategory(), eachToDoItem.getCategory()) &&
+ Objects.equal(toDoItem.getUserName(), eachToDoItem.getUserName()) &&
+ eachToDoItem != toDoItem;
+ }
+
+ };
+ }
+
+ // }}
+
+ // {{ injected: ToDoItems
+ private ToDoItems toDoItems;
+
+ public void setToDoItems(final ToDoItems toDoItems) {
+ this.toDoItems = toDoItems;
+ }
+ // }}
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItems.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItems.java b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItems.java
index dc9a830..f7c14a8 100644
--- a/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItems.java
+++ b/examples/onlinedemo/dom/src/main/java/org/apache/isis/examples/onlinedemo/dom/items/ToDoItems.java
@@ -1,62 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.dom.items;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Idempotent;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.annotation.QueryOnly;
-import org.apache.isis.applib.value.Date;
-
-/**
- * A repository for {@link ToDoItem}s.
- *
- * <p>
- * The implementation depends on the configured object store.
- */
-@Named("ToDos")
-public interface ToDoItems {
-
- @QueryOnly
- // no side-effects
- @MemberOrder(sequence = "1")
- // order in the UI
- public List<ToDoItem> toDosForToday();
-
- @MemberOrder(sequence = "2")
- public ToDoItem newToDo(@Named("Description") String description, Category category, @Named("Due by") @Optional Date dueBy);
-
- @QueryOnly
- @MemberOrder(sequence = "3")
- public List<ToDoItem> allToDos();
-
- @QueryOnly
- @MemberOrder(sequence = "4")
- public List<ToDoItem> similarTo(ToDoItem toDoItem);
-
- @Idempotent
- // same post-conditions
- @MemberOrder(sequence = "5")
- public void removeCompleted();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.dom.items;
+
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Idempotent;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.annotation.Optional;
+import org.apache.isis.applib.annotation.QueryOnly;
+import org.apache.isis.applib.value.Date;
+
+/**
+ * A repository for {@link ToDoItem}s.
+ *
+ * <p>
+ * The implementation depends on the configured object store.
+ */
+@Named("ToDos")
+public interface ToDoItems {
+
+ @QueryOnly
+ // no side-effects
+ @MemberOrder(sequence = "1")
+ // order in the UI
+ public List<ToDoItem> toDosForToday();
+
+ @MemberOrder(sequence = "2")
+ public ToDoItem newToDo(@Named("Description") String description, Category category, @Named("Due by") @Optional Date dueBy);
+
+ @QueryOnly
+ @MemberOrder(sequence = "3")
+ public List<ToDoItem> allToDos();
+
+ @QueryOnly
+ @MemberOrder(sequence = "4")
+ public List<ToDoItem> similarTo(ToDoItem toDoItem);
+
+ @Idempotent
+ // same post-conditions
+ @MemberOrder(sequence = "5")
+ public void removeCompleted();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/DemoFixturesDefault.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/DemoFixturesDefault.java b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/DemoFixturesDefault.java
index 544ef84..9ee7b32 100644
--- a/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/DemoFixturesDefault.java
+++ b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/DemoFixturesDefault.java
@@ -1,80 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.fixture.items;
-
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.examples.onlinedemo.dom.demo.DemoFixtures;
-import org.apache.isis.examples.onlinedemo.dom.items.Categories;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
-
-public class DemoFixturesDefault extends AbstractFactoryAndRepository implements DemoFixtures {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "demo";
- }
-
- public String iconName() {
- return "demo";
- }
-
- // }}
-
- @Override
- public List<ToDoItem> resetFixtures() {
- final ToDoItemsFixture fixture = new ToDoItemsFixture();
- injectServicesInto(fixture);
-
- fixture.install();
-
- return toDoItems.allToDos();
- }
-
- // {{ helpers
- private void injectServicesInto(final ToDoItemsFixture fixture) {
- fixture.setCategories(categories);
- fixture.setContainer(getContainer());
- fixture.setToDoItems(toDoItems);
- }
-
- // }}
-
- // {{ injected: Categories
- private Categories categories;
-
- public void setCategories(final Categories categories) {
- this.categories = categories;
- }
-
- // }}
-
- // {{ injected: ToDoItems
- private ToDoItems toDoItems;
-
- public void setToDoItems(final ToDoItems toDoItems) {
- this.toDoItems = toDoItems;
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.fixture.items;
+
+import java.util.List;
+
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.examples.onlinedemo.dom.demo.DemoFixtures;
+import org.apache.isis.examples.onlinedemo.dom.items.Categories;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
+
+public class DemoFixturesDefault extends AbstractFactoryAndRepository implements DemoFixtures {
+
+ // {{ Id, iconName
+ @Override
+ public String getId() {
+ return "demo";
+ }
+
+ public String iconName() {
+ return "demo";
+ }
+
+ // }}
+
+ @Override
+ public List<ToDoItem> resetFixtures() {
+ final ToDoItemsFixture fixture = new ToDoItemsFixture();
+ injectServicesInto(fixture);
+
+ fixture.install();
+
+ return toDoItems.allToDos();
+ }
+
+ // {{ helpers
+ private void injectServicesInto(final ToDoItemsFixture fixture) {
+ fixture.setCategories(categories);
+ fixture.setContainer(getContainer());
+ fixture.setToDoItems(toDoItems);
+ }
+
+ // }}
+
+ // {{ injected: Categories
+ private Categories categories;
+
+ public void setCategories(final Categories categories) {
+ this.categories = categories;
+ }
+
+ // }}
+
+ // {{ injected: ToDoItems
+ private ToDoItems toDoItems;
+
+ public void setToDoItems(final ToDoItems toDoItems) {
+ this.toDoItems = toDoItems;
+ }
+ // }}
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/ToDoItemsFixture.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/ToDoItemsFixture.java b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/ToDoItemsFixture.java
index 954b0ef..7644ca2 100644
--- a/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/ToDoItemsFixture.java
+++ b/examples/onlinedemo/fixture/src/main/java/org/apache/isis/examples/onlinedemo/fixture/items/ToDoItemsFixture.java
@@ -1,95 +1,95 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.fixture.items;
-
-import java.util.List;
-
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixtures.AbstractFixture;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.examples.onlinedemo.dom.items.Categories;
-import org.apache.isis.examples.onlinedemo.dom.items.Category;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
-
-public class ToDoItemsFixture extends AbstractFixture {
-
- @Override
- public void install() {
- final Category domesticCategory = findOrCreateCategory("Domestic");
- final Category professionalCategory = findOrCreateCategory("Professional");
-
- removeAllToDosForCurrentUser();
-
- createToDoItemForCurrentUser("Buy milk", domesticCategory, daysFromToday(0));
- createToDoItemForCurrentUser("Buy stamps", domesticCategory, daysFromToday(0));
- createToDoItemForCurrentUser("Pick up laundry", domesticCategory, daysFromToday(6));
- createToDoItemForCurrentUser("Write blog post", professionalCategory, null);
- createToDoItemForCurrentUser("Organize brown bag", professionalCategory, daysFromToday(14));
-
- getContainer().flush();
- }
-
- // {{ helpers
- private Category findOrCreateCategory(final String description) {
- final Category category = categories.find(description);
- if (category != null) {
- return category;
- }
- return categories.newCategory(description);
- }
-
- private void removeAllToDosForCurrentUser() {
- final List<ToDoItem> allToDos = toDoItems.allToDos();
- for (final ToDoItem toDoItem : allToDos) {
- getContainer().remove(toDoItem);
- }
- }
-
- private ToDoItem createToDoItemForCurrentUser(final String description, final Category category, final Date dueBy) {
- return toDoItems.newToDo(description, category, dueBy);
- }
-
- private static Date daysFromToday(final int i) {
- final Date date = new Date(Clock.getTimeAsDateTime());
- date.add(0, 0, i);
- return date;
- }
-
- // }}
-
- // {{ injected: Categories
- private Categories categories;
-
- public void setCategories(final Categories categories) {
- this.categories = categories;
- }
-
- // }}
-
- // {{ injected: ToDoItems
- private ToDoItems toDoItems;
-
- public void setToDoItems(final ToDoItems toDoItems) {
- this.toDoItems = toDoItems;
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.fixture.items;
+
+import java.util.List;
+
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixtures.AbstractFixture;
+import org.apache.isis.applib.value.Date;
+import org.apache.isis.examples.onlinedemo.dom.items.Categories;
+import org.apache.isis.examples.onlinedemo.dom.items.Category;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
+
+public class ToDoItemsFixture extends AbstractFixture {
+
+ @Override
+ public void install() {
+ final Category domesticCategory = findOrCreateCategory("Domestic");
+ final Category professionalCategory = findOrCreateCategory("Professional");
+
+ removeAllToDosForCurrentUser();
+
+ createToDoItemForCurrentUser("Buy milk", domesticCategory, daysFromToday(0));
+ createToDoItemForCurrentUser("Buy stamps", domesticCategory, daysFromToday(0));
+ createToDoItemForCurrentUser("Pick up laundry", domesticCategory, daysFromToday(6));
+ createToDoItemForCurrentUser("Write blog post", professionalCategory, null);
+ createToDoItemForCurrentUser("Organize brown bag", professionalCategory, daysFromToday(14));
+
+ getContainer().flush();
+ }
+
+ // {{ helpers
+ private Category findOrCreateCategory(final String description) {
+ final Category category = categories.find(description);
+ if (category != null) {
+ return category;
+ }
+ return categories.newCategory(description);
+ }
+
+ private void removeAllToDosForCurrentUser() {
+ final List<ToDoItem> allToDos = toDoItems.allToDos();
+ for (final ToDoItem toDoItem : allToDos) {
+ getContainer().remove(toDoItem);
+ }
+ }
+
+ private ToDoItem createToDoItemForCurrentUser(final String description, final Category category, final Date dueBy) {
+ return toDoItems.newToDo(description, category, dueBy);
+ }
+
+ private static Date daysFromToday(final int i) {
+ final Date date = new Date(Clock.getTimeAsDateTime());
+ date.add(0, 0, i);
+ return date;
+ }
+
+ // }}
+
+ // {{ injected: Categories
+ private Categories categories;
+
+ public void setCategories(final Categories categories) {
+ this.categories = categories;
+ }
+
+ // }}
+
+ // {{ injected: ToDoItems
+ private ToDoItems toDoItems;
+
+ public void setToDoItems(final ToDoItems toDoItems) {
+ this.toDoItems = toDoItems;
+ }
+ // }}
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/CategoriesDefault.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/CategoriesDefault.java b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/CategoriesDefault.java
index c64f482..efa36ef 100644
--- a/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/CategoriesDefault.java
+++ b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/CategoriesDefault.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.objstore.dflt.items;
-
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.examples.onlinedemo.dom.items.Categories;
-import org.apache.isis.examples.onlinedemo.dom.items.Category;
-
-public class CategoriesDefault extends AbstractFactoryAndRepository implements Categories {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "categories";
- }
-
- public String iconName() {
- return "Category";
- }
-
- // }}
-
- @Override
- public List<Category> all() {
- return allInstances(Category.class);
- }
-
- @Override
- public Category newCategory(final String description) {
- Category category = find(description);
- if (category != null) {
- return category;
- }
- category = newTransientInstance(Category.class);
- category.setDescription(description);
- persist(category);
- return category;
- }
-
- @Override
- public Category find(final String description) {
- return firstMatch(Category.class, Category.matching(description));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.objstore.dflt.items;
+
+import java.util.List;
+
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.examples.onlinedemo.dom.items.Categories;
+import org.apache.isis.examples.onlinedemo.dom.items.Category;
+
+public class CategoriesDefault extends AbstractFactoryAndRepository implements Categories {
+
+ // {{ Id, iconName
+ @Override
+ public String getId() {
+ return "categories";
+ }
+
+ public String iconName() {
+ return "Category";
+ }
+
+ // }}
+
+ @Override
+ public List<Category> all() {
+ return allInstances(Category.class);
+ }
+
+ @Override
+ public Category newCategory(final String description) {
+ Category category = find(description);
+ if (category != null) {
+ return category;
+ }
+ category = newTransientInstance(Category.class);
+ category.setDescription(description);
+ persist(category);
+ return category;
+ }
+
+ @Override
+ public Category find(final String description) {
+ return firstMatch(Category.class, Category.matching(description));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/ToDoItemsDefault.java
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/ToDoItemsDefault.java b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/ToDoItemsDefault.java
index 56b5a19..d840ae9 100644
--- a/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/ToDoItemsDefault.java
+++ b/examples/onlinedemo/objstore-default/src/main/java/org/apache/isis/examples/onlinedemo/objstore/dflt/items/ToDoItemsDefault.java
@@ -1,108 +1,108 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.examples.onlinedemo.objstore.dflt.items;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.AbstractFactoryAndRepository;
-import org.apache.isis.applib.filter.Filters;
-import org.apache.isis.applib.value.Date;
-import org.apache.isis.examples.onlinedemo.dom.items.Category;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
-import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
-
-public class ToDoItemsDefault extends AbstractFactoryAndRepository implements ToDoItems {
-
- // {{ Id, iconName
- @Override
- public String getId() {
- return "toDoItems";
- }
-
- public String iconName() {
- return "ToDoItem";
- }
-
- // }}
-
- // {{ ToDosForToday (action)
- @Override
- public List<ToDoItem> toDosForToday() {
- return allMatches(ToDoItem.class, Filters.and(ToDoItem.thoseOwnedBy(currentUser()), ToDoItem.thoseDue()));
- }
-
- // }}
-
- // {{ NewToDo (action)
- @Override
- public ToDoItem newToDo(final String description, final Category category, final Date dueBy) {
- final ToDoItem toDoItem = newTransientInstance(ToDoItem.class);
- toDoItem.setDescription(description);
- toDoItem.setCategory(category);
- toDoItem.setDueBy(dueBy);
- toDoItem.setUserName(currentUser());
- persist(toDoItem);
- return toDoItem;
- }
-
- // }}
-
- // {{ AllToDos (action)
- @Override
- public List<ToDoItem> allToDos() {
- final String currentUser = currentUser();
- final List<ToDoItem> items = allMatches(ToDoItem.class, ToDoItem.thoseOwnedBy(currentUser));
- Collections.sort(items);
- return items;
- }
-
- // }}
-
- // {{ SimilarTo (action)
-
- @Override
- public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
- return allMatches(ToDoItem.class, ToDoItem.thoseSimilarTo(toDoItem));
- }
-
- // }}
-
- // {{ RemoveCompleted (action)
-
- @Override
- public void removeCompleted() {
- final List<ToDoItem> complete = allMatches(ToDoItem.class, ToDoItem.thoseComplete());
- for (final ToDoItem toDoItem : complete) {
- getContainer().remove(toDoItem);
- }
- final int size = complete.size();
- getContainer().informUser("" + size + " item" + (size != 1 ? "s" : "") + " removed");
- }
-
- // }}
-
- // {{ helpers
- private String currentUser() {
- return getContainer().getUser().getName();
- }
- // }}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.examples.onlinedemo.objstore.dflt.items;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.applib.AbstractFactoryAndRepository;
+import org.apache.isis.applib.filter.Filters;
+import org.apache.isis.applib.value.Date;
+import org.apache.isis.examples.onlinedemo.dom.items.Category;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItem;
+import org.apache.isis.examples.onlinedemo.dom.items.ToDoItems;
+
+public class ToDoItemsDefault extends AbstractFactoryAndRepository implements ToDoItems {
+
+ // {{ Id, iconName
+ @Override
+ public String getId() {
+ return "toDoItems";
+ }
+
+ public String iconName() {
+ return "ToDoItem";
+ }
+
+ // }}
+
+ // {{ ToDosForToday (action)
+ @Override
+ public List<ToDoItem> toDosForToday() {
+ return allMatches(ToDoItem.class, Filters.and(ToDoItem.thoseOwnedBy(currentUser()), ToDoItem.thoseDue()));
+ }
+
+ // }}
+
+ // {{ NewToDo (action)
+ @Override
+ public ToDoItem newToDo(final String description, final Category category, final Date dueBy) {
+ final ToDoItem toDoItem = newTransientInstance(ToDoItem.class);
+ toDoItem.setDescription(description);
+ toDoItem.setCategory(category);
+ toDoItem.setDueBy(dueBy);
+ toDoItem.setUserName(currentUser());
+ persist(toDoItem);
+ return toDoItem;
+ }
+
+ // }}
+
+ // {{ AllToDos (action)
+ @Override
+ public List<ToDoItem> allToDos() {
+ final String currentUser = currentUser();
+ final List<ToDoItem> items = allMatches(ToDoItem.class, ToDoItem.thoseOwnedBy(currentUser));
+ Collections.sort(items);
+ return items;
+ }
+
+ // }}
+
+ // {{ SimilarTo (action)
+
+ @Override
+ public List<ToDoItem> similarTo(final ToDoItem toDoItem) {
+ return allMatches(ToDoItem.class, ToDoItem.thoseSimilarTo(toDoItem));
+ }
+
+ // }}
+
+ // {{ RemoveCompleted (action)
+
+ @Override
+ public void removeCompleted() {
+ final List<ToDoItem> complete = allMatches(ToDoItem.class, ToDoItem.thoseComplete());
+ for (final ToDoItem toDoItem : complete) {
+ getContainer().remove(toDoItem);
+ }
+ final int size = complete.size();
+ getContainer().informUser("" + size + " item" + (size != 1 ? "s" : "") + " removed");
+ }
+
+ // }}
+
+ // {{ helpers
+ private String currentUser() {
+ return getContainer().getUser().getName();
+ }
+ // }}
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/ide/eclipse/launch/onlinedemo-webapp.launch
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/ide/eclipse/launch/onlinedemo-webapp.launch b/examples/onlinedemo/webapp/ide/eclipse/launch/onlinedemo-webapp.launch
index 5467ce1..7f8be91 100644
--- a/examples/onlinedemo/webapp/ide/eclipse/launch/onlinedemo-webapp.launch
+++ b/examples/onlinedemo/webapp/ide/eclipse/launch/onlinedemo-webapp.launch
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/onlinedemo-webapp"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
-<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
-<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="onlinedemo-webapp"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
-</launchConfiguration>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/onlinedemo-webapp"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="onlinedemo-webapp"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/isis.properties b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/isis.properties
index 6f6161f..d1b1be9 100644
--- a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -1,75 +1,75 @@
-# 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.
-
-
-# these are the services/repositories that are instantiated by the
-# framework. These are automatically injected into any domain object
-# that declares a dependency. Those that are not hidden are also
-# shown in the user interface.
-isis.services.prefix = org.apache.isis.examples.onlinedemo
-isis.services = objstore.dflt.items.ToDoItemsDefault,\
- objstore.dflt.items.CategoriesDefault,\
- fixture.items.DemoFixturesDefault
-
-
-# the online demo does not use the framework to setup fixtures;
-# instead users can install their own fixtures
-isis.fixtures.prefix= org.apache.isis.examples.onlinedemo
-//isis.fixtures= fixture.LogonAsSvenFixture,fixture.items.ToDoItemsFixture
-
-
-# related to the lazy loading feature (below); helps the framework identify the "real"
-# class that is in use. both cglib and javassist implementations are provided, or it can be switched off.
-isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.dflt.classsubstitutor.CglibClassSubstitutor
-#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.javassist.classsubstitutor.JavassistClassSubstitutor
-#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.identity.classsubstitutor.ClassSubstitutorIdentity
-
-# used to support lazy loading, both cglib and javassist implementations are provided,
-# or it can be switched off (because some object store implementations do this implicitly)
-isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.dflt.objectfactory.CglibObjectFactory
-#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.javassist.objectfactory.JavassistObjectFactory
-#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic
-
-
-# the implementation of the container to inject into every domain object.
-# this is not usually changed.
-isis.persistor.domain-object-container=org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault
-
-
-# the authentication mechanism is configurable. the onlinedemo uses its own implementation,
-# which uses an in-memory list of registered users.
-isis.authentication=org.apache.isis.examples.onlinedemo.auth.AuthenticationManagerSupportingInMemoryRegistrationInstaller
-
-
-# the framework supports authorization; the usual implementation maps roles to permissions.
-# this is switched off for the onlinedemo, however
-#isis.reflector.facets.include=org.apache.isis.runtimes.dflt.runtime.authorization.standard.AuthorizationFacetFactoryImpl
-
-
-# the default authorization mechanism can be put into "learn" mode, so that it allows all
-# requests through, and writes out the permission entries that were checked.
-#isis.authorization.learn=true
-
-
-# configure the profile store. this facility is not supported by the viewers used in
-# the onlinedemo, so is included here for completeness only
-isis.user-profile-store=in-memory
-
-
-# configure the object store. using the inmemory objectstore means that all data will
-# be lost when the app is restarted. it is commonly used for prototyping and testing
-isis.persistor=in-memory
+# 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.
+
+
+# these are the services/repositories that are instantiated by the
+# framework. These are automatically injected into any domain object
+# that declares a dependency. Those that are not hidden are also
+# shown in the user interface.
+isis.services.prefix = org.apache.isis.examples.onlinedemo
+isis.services = objstore.dflt.items.ToDoItemsDefault,\
+ objstore.dflt.items.CategoriesDefault,\
+ fixture.items.DemoFixturesDefault
+
+
+# the online demo does not use the framework to setup fixtures;
+# instead users can install their own fixtures
+isis.fixtures.prefix= org.apache.isis.examples.onlinedemo
+//isis.fixtures= fixture.LogonAsSvenFixture,fixture.items.ToDoItemsFixture
+
+
+# related to the lazy loading feature (below); helps the framework identify the "real"
+# class that is in use. both cglib and javassist implementations are provided, or it can be switched off.
+isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.dflt.classsubstitutor.CglibClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.javassist.classsubstitutor.JavassistClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.identity.classsubstitutor.ClassSubstitutorIdentity
+
+# used to support lazy loading, both cglib and javassist implementations are provided,
+# or it can be switched off (because some object store implementations do this implicitly)
+isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.dflt.objectfactory.CglibObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.javassist.objectfactory.JavassistObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic
+
+
+# the implementation of the container to inject into every domain object.
+# this is not usually changed.
+isis.persistor.domain-object-container=org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault
+
+
+# the authentication mechanism is configurable. the onlinedemo uses its own implementation,
+# which uses an in-memory list of registered users.
+isis.authentication=org.apache.isis.examples.onlinedemo.auth.AuthenticationManagerSupportingInMemoryRegistrationInstaller
+
+
+# the framework supports authorization; the usual implementation maps roles to permissions.
+# this is switched off for the onlinedemo, however
+#isis.reflector.facets.include=org.apache.isis.runtimes.dflt.runtime.authorization.standard.AuthorizationFacetFactoryImpl
+
+
+# the default authorization mechanism can be put into "learn" mode, so that it allows all
+# requests through, and writes out the permission entries that were checked.
+#isis.authorization.learn=true
+
+
+# configure the profile store. this facility is not supported by the viewers used in
+# the onlinedemo, so is included here for completeness only
+isis.user-profile-store=in-memory
+
+
+# configure the object store. using the inmemory objectstore means that all data will
+# be lost when the app is restarted. it is commonly used for prototyping and testing
+isis.persistor=in-memory
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/logging.properties b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/logging.properties
index 31a7820..a411f6d 100644
--- a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/logging.properties
+++ b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -1,32 +1,32 @@
-# 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.
-
-
-# the framework 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
+# 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.
+
+
+# the framework 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
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/security_file.passwords
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/security_file.passwords b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/security_file.passwords
index 7048902..97b228e 100644
--- a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/security_file.passwords
+++ b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/security_file.passwords
@@ -22,7 +22,7 @@
#
# list of users, and their password, and optionally roles
-sven:pass:role1|role2|role3
-dick:pass
-bob:pass
-joe:pass
+sven:pass:role1|role2|role3
+dick:pass
+bob:pass
+joe:pass
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/viewer_html.properties
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/viewer_html.properties b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/viewer_html.properties
index 4a4529a..3e5a947 100644
--- a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/viewer_html.properties
+++ b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/viewer_html.properties
@@ -1,27 +1,27 @@
-# 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 HTML viewer
-#
-
-# customization for the header and footer
-isis.viewer.html.header=<div id="site-header"><div id="site-logo"> </div></div>
-isis.viewer.html.footer=<div id="page-footer"><small>Powered by Apache Isis</small></div>
-
-# not used by the onlinedemo; deploy the WAR as usual
-isis.viewer.html.port=8080
+# 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 HTML viewer
+#
+
+# customization for the header and footer
+isis.viewer.html.header=<div id="site-header"><div id="site-logo"> </div></div>
+isis.viewer.html.footer=<div id="page-footer"><small>Powered by Apache Isis</small></div>
+
+# not used by the onlinedemo; deploy the WAR as usual
+isis.viewer.html.port=8080
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/web.xml b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/web.xml
index 48df3ce..d7ed2fd 100644
--- a/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/examples/onlinedemo/webapp/src/main/webapp/WEB-INF/web.xml
@@ -1,289 +1,289 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<web-app id="WebApp_ID" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Apache Isis Online Demo</display-name>
-
-
- <!--
- -
- -
- - config common to all viewer(s)
- -
- -
- -->
-
- <!-- bootstrap the Isis metamodel and runtime -->
- <listener>
- <listener-class>org.apache.isis.runtimes.dflt.webapp.IsisWebAppBootstrapper</listener-class>
- </listener>
-
- <!-- which (optional) configuration file(s) to load -->
- <context-param>
- <param-name>isis.viewers</param-name>
- <param-value>html,json</param-value>
- </context-param>
-
- <!-- cache static resources for 1 day -->
- <filter>
- <filter-name>ResourceCachingFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
- <init-param>
- <param-name>CacheTime</param-name>
- <param-value>86400</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.js</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.css</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.png</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.jpg</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.gif</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>ResourceCachingFilter</filter-name>
- <url-pattern>*.html</url-pattern>
- </filter-mapping>
-
- <servlet>
- <servlet-name>Resource</servlet-name>
- <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.css</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.png</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.jpg</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.gif</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.js</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource</servlet-name>
- <url-pattern>*.html</url-pattern>
- </servlet-mapping>
-
-
-
-
-
- <!--
- -
- -
- - config for demo only
- -
- -
- -->
-
- <!-- redirect to /doc/index.html if accessing "/" using web browser -->
- <filter>
- <filter-name>RedirectToDocsFilter</filter-name>
- <filter-class>org.apache.isis.core.webapp.routing.RedirectToDocsFilter</filter-class>
- <init-param>
- <param-name>redirectTo</param-name>
- <param-value>/doc/index.html</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>RedirectToDocsFilter</filter-name>
- <url-pattern>*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list>
- <!-- override Tomcat's default -->
- <welcome-file>/</welcome-file>
- </welcome-file-list>
-
-
-
-
- <!--
- -
- -
- - config specific to the html-viewer
- -
- -
- -->
- <!-- determine the format of the paths of the links etc that it generates -->
- <context-param>
- <param-name>viewer-html.suffix</param-name>
- <param-value>htmlviewer</param-value>
- </context-param>
-
- <!-- redirect requests to 'htmlviewer' to the HTML viewer's start page -->
- <filter>
- <filter-name>RedirectFilterForHtml</filter-name>
- <filter-class>org.apache.isis.core.webapp.routing.RedirectFilter</filter-class>
- <init-param>
- <param-name>redirectTo</param-name>
- <param-value>/start.htmlviewer</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>RedirectFilterForHtml</filter-name>
- <url-pattern>/htmlviewer</url-pattern>
- </filter-mapping>
-
- <!-- authenticate user, and set up an Isis Session -->
- <filter>
- <filter-name>IsisSessionFilterForHtml</filter-name>
- <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
- <init-param>
- <!-- lookup from cache, or if a logon filter was provided -->
- <param-name>authenticationSessionStrategy</param-name>
- <param-value>org.apache.isis.runtimes.dflt.webapp.auth.AuthenticationSessionStrategyDefault</param-value>
- </init-param>
- <init-param>
- <!-- what to do if no session was found; we indicate access only to a restricted list of paths -->
- <param-name>whenNoSession</param-name>
- <param-value>restricted</param-value>
- </init-param>
- <init-param>
- <!-- the list of paths that are accessible if no session was found -->
- <param-name>restricted</param-name>
- <param-value>/logon.htmlviewer,/register.htmlviewer</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>IsisSessionFilterForHtml</filter-name>
- <servlet-name>HtmlLogon</servlet-name>
- <servlet-name>HtmlRegister</servlet-name>
- <servlet-name>HtmlController</servlet-name>
- </filter-mapping>
-
- <servlet>
- <servlet-name>HtmlLogon</servlet-name>
- <servlet-class>org.apache.isis.viewer.html.servlet.LogonServlet</servlet-class>
- <init-param>
- <param-name>authenticationSessionStrategy</param-name>
- <param-value>org.apache.isis.runtimes.dflt.webapp.auth.AuthenticationSessionStrategyDefault</param-value>
- </init-param>
- <init-param>
- <param-name>startPage</param-name>
- <param-value>start.htmlviewer</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>HtmlLogon</servlet-name>
- <url-pattern>/logon.htmlviewer</url-pattern>
- </servlet-mapping>
-
- <servlet>
- <servlet-name>HtmlRegister</servlet-name>
- <servlet-class>org.apache.isis.viewer.html.servlet.RegisterServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>HtmlRegister</servlet-name>
- <url-pattern>/register.htmlviewer</url-pattern>
- </servlet-mapping>
-
- <servlet>
- <servlet-name>HtmlController</servlet-name>
- <servlet-class>org.apache.isis.viewer.html.servlet.ControllerServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>HtmlController</servlet-name>
- <url-pattern>*.htmlviewer</url-pattern>
- </servlet-mapping>
-
-
-
-
- <!--
- -
- -
- - config specific to the json-viewer
- -
- -
- -->
-
- <!-- bootstrap the RestEasy framework -->
- <listener>
- <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
- </listener>
-
- <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
- <context-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value>org.apache.isis.viewer.json.viewer.JsonApplication</param-value>
- </context-param>
-
- <!-- authenticate user, set up an Isis session -->
- <filter>
- <filter-name>IsisSessionFilterForJson</filter-name>
- <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
- <!-- authentication required for REST -->
- <init-param>
- <param-name>authenticationSessionStrategy</param-name>
- <param-value>org.apache.isis.viewer.json.viewer.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
- </init-param>
- <init-param>
- <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
- <param-name>whenNoSession</param-name>
- <param-value>basicAuthChallenge</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
- executed for the request pipeline, and if so will do nothing -->
- <filter-name>IsisSessionFilterForJson</filter-name>
- <servlet-name>JsonDispatcher</servlet-name>
- </filter-mapping>
-
- <servlet>
- <servlet-name>JsonDispatcher</servlet-name>
- <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>JsonDispatcher</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
-
-
-</web-app>
-
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<web-app id="WebApp_ID" version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Apache Isis Online Demo</display-name>
+
+
+ <!--
+ -
+ -
+ - config common to all viewer(s)
+ -
+ -
+ -->
+
+ <!-- bootstrap the Isis metamodel and runtime -->
+ <listener>
+ <listener-class>org.apache.isis.runtimes.dflt.webapp.IsisWebAppBootstrapper</listener-class>
+ </listener>
+
+ <!-- which (optional) configuration file(s) to load -->
+ <context-param>
+ <param-name>isis.viewers</param-name>
+ <param-value>html,json</param-value>
+ </context-param>
+
+ <!-- cache static resources for 1 day -->
+ <filter>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.content.ResourceCachingFilter</filter-class>
+ <init-param>
+ <param-name>CacheTime</param-name>
+ <param-value>86400</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.jpg</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ResourceCachingFilter</filter-name>
+ <url-pattern>*.html</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Resource</servlet-name>
+ <servlet-class>org.apache.isis.core.webapp.content.ResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.css</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.png</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.jpg</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.gif</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.js</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource</servlet-name>
+ <url-pattern>*.html</url-pattern>
+ </servlet-mapping>
+
+
+
+
+
+ <!--
+ -
+ -
+ - config for demo only
+ -
+ -
+ -->
+
+ <!-- redirect to /doc/index.html if accessing "/" using web browser -->
+ <filter>
+ <filter-name>RedirectToDocsFilter</filter-name>
+ <filter-class>org.apache.isis.core.webapp.routing.RedirectToDocsFilter</filter-class>
+ <init-param>
+ <param-name>redirectTo</param-name>
+ <param-value>/doc/index.html</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>RedirectToDocsFilter</filter-name>
+ <url-pattern>*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list>
+ <!-- override Tomcat's default -->
+ <welcome-file>/</welcome-file>
+ </welcome-file-list>
+
+
+
+
+ <!--
+ -
+ -
+ - config specific to the html-viewer
+ -
+ -
+ -->
+ <!-- determine the format of the paths of the links etc that it generates -->
+ <context-param>
+ <param-name>viewer-html.suffix</param-name>
+ <param-value>htmlviewer</param-value>
+ </context-param>
+
+ <!-- redirect requests to 'htmlviewer' to the HTML viewer's start page -->
+ <filter>
+ <filter-name>RedirectFilterForHtml</filter-name>
+ <filter-class>org.apache.isis.core.webapp.routing.RedirectFilter</filter-class>
+ <init-param>
+ <param-name>redirectTo</param-name>
+ <param-value>/start.htmlviewer</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>RedirectFilterForHtml</filter-name>
+ <url-pattern>/htmlviewer</url-pattern>
+ </filter-mapping>
+
+ <!-- authenticate user, and set up an Isis Session -->
+ <filter>
+ <filter-name>IsisSessionFilterForHtml</filter-name>
+ <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
+ <init-param>
+ <!-- lookup from cache, or if a logon filter was provided -->
+ <param-name>authenticationSessionStrategy</param-name>
+ <param-value>org.apache.isis.runtimes.dflt.webapp.auth.AuthenticationSessionStrategyDefault</param-value>
+ </init-param>
+ <init-param>
+ <!-- what to do if no session was found; we indicate access only to a restricted list of paths -->
+ <param-name>whenNoSession</param-name>
+ <param-value>restricted</param-value>
+ </init-param>
+ <init-param>
+ <!-- the list of paths that are accessible if no session was found -->
+ <param-name>restricted</param-name>
+ <param-value>/logon.htmlviewer,/register.htmlviewer</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>IsisSessionFilterForHtml</filter-name>
+ <servlet-name>HtmlLogon</servlet-name>
+ <servlet-name>HtmlRegister</servlet-name>
+ <servlet-name>HtmlController</servlet-name>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>HtmlLogon</servlet-name>
+ <servlet-class>org.apache.isis.viewer.html.servlet.LogonServlet</servlet-class>
+ <init-param>
+ <param-name>authenticationSessionStrategy</param-name>
+ <param-value>org.apache.isis.runtimes.dflt.webapp.auth.AuthenticationSessionStrategyDefault</param-value>
+ </init-param>
+ <init-param>
+ <param-name>startPage</param-name>
+ <param-value>start.htmlviewer</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HtmlLogon</servlet-name>
+ <url-pattern>/logon.htmlviewer</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>HtmlRegister</servlet-name>
+ <servlet-class>org.apache.isis.viewer.html.servlet.RegisterServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HtmlRegister</servlet-name>
+ <url-pattern>/register.htmlviewer</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>HtmlController</servlet-name>
+ <servlet-class>org.apache.isis.viewer.html.servlet.ControllerServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HtmlController</servlet-name>
+ <url-pattern>*.htmlviewer</url-pattern>
+ </servlet-mapping>
+
+
+
+
+ <!--
+ -
+ -
+ - config specific to the json-viewer
+ -
+ -
+ -->
+
+ <!-- bootstrap the RestEasy framework -->
+ <listener>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+ </listener>
+
+ <!-- used by RestEasy to determine the JAX-RS resources and other related configuration -->
+ <context-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.isis.viewer.json.viewer.JsonApplication</param-value>
+ </context-param>
+
+ <!-- authenticate user, set up an Isis session -->
+ <filter>
+ <filter-name>IsisSessionFilterForJson</filter-name>
+ <filter-class>org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter</filter-class>
+ <!-- authentication required for REST -->
+ <init-param>
+ <param-name>authenticationSessionStrategy</param-name>
+ <param-value>org.apache.isis.viewer.json.viewer.authentication.AuthenticationSessionStrategyBasicAuth</param-value>
+ </init-param>
+ <init-param>
+ <!-- what to do if no session was found; we indicate to issue a 401 basic authentication challenge -->
+ <param-name>whenNoSession</param-name>
+ <param-value>basicAuthChallenge</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <!-- this is mapped to the entire app; however the IsisSessionFilter will "notice" if the session filter has already been
+ executed for the request pipeline, and if so will do nothing -->
+ <filter-name>IsisSessionFilterForJson</filter-name>
+ <servlet-name>JsonDispatcher</servlet-name>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>JsonDispatcher</servlet-name>
+ <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>JsonDispatcher</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
+
+
+