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 2015/02/19 17:59:17 UTC
[45/51] [partial] isis git commit: ISIS-1049: moving viewer-wicket
into core.
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ServiceActionsModel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ServiceActionsModel.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ServiceActionsModel.java
deleted file mode 100644
index d0bcc36..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ServiceActionsModel.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.isis.applib.annotation.DomainServiceLayout;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.object.domainservicelayout.DomainServiceLayoutFacet;
-
-/**
- * Backing model for actions of application services menu bar (typically, as
- * displayed along the top or side of the page).
- */
-public class ServiceActionsModel extends ModelAbstract<List<ObjectAdapter>> {
-
- private static final long serialVersionUID = 1L;
-
- private final DomainServiceLayout.MenuBar menuBar;
-
- /**
- * @param menuBar - may be null in special case of rendering the tertiary menu on the error page.
- */
- public ServiceActionsModel(final DomainServiceLayout.MenuBar menuBar) {
- this.menuBar = menuBar;
- }
-
- /**
- * The menu bar being rendered; may be null in special case of rendering the tertiary menu on the error page.
- */
- public DomainServiceLayout.MenuBar getMenuBar() {
- return menuBar;
- }
-
- protected List<ObjectAdapter> load() {
- return Lists.newArrayList(Iterables.filter(getServiceAdapters(), with(menuBar)));
- }
-
- private static Predicate<ObjectAdapter> with(final DomainServiceLayout.MenuBar menuBar) {
- return new Predicate<ObjectAdapter>() {
- @Override
- public boolean apply(ObjectAdapter input) {
- final DomainServiceLayoutFacet facet = input.getSpecification().getFacet
- (DomainServiceLayoutFacet.class);
- return facet != null && facet.getMenuBar() == menuBar;
- }
- };
- }
-
- protected List<ObjectAdapter> getServiceAdapters() {
- return getPersistenceSession().getServices();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ValueModel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ValueModel.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ValueModel.java
deleted file mode 100644
index 9ddd054..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/ValueModel.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
-
-/**
- * Represents a standalone value.
- */
-public class ValueModel extends ModelAbstract<ObjectAdapter> {
-
- private static final long serialVersionUID = 1L;
-
- private final ObjectAdapterMemento adapterMemento;
-
- public ValueModel(final ObjectAdapter adapter) {
- adapterMemento = ObjectAdapterMemento.createOrNull(adapter);
- }
-
- @Override
- protected ObjectAdapter load() {
- return adapterMemento.getObjectAdapter(ConcurrencyChecking.NO_CHECK);
- }
-
- // //////////////////////////////////////
-
- private ActionModel actionModelHint;
- /**
- * The {@link ActionModel model} of the {@link ObjectAction action}
- * that generated this {@link ValueModel}.
- *
- * @see #setActionHint(ActionModel)
- */
- public ActionModel getActionModelHint() {
- return actionModelHint;
- }
- /**
- * Called by action.
- *
- * @see #getActionModelHint()
- */
- public void setActionHint(ActionModel actionModelHint) {
- this.actionModelHint = actionModelHint;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/VoidModel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/VoidModel.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/VoidModel.java
deleted file mode 100644
index c0437d3..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/VoidModel.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-
-
-/**
- * Represents the result of invoking a <tt>void</tt> action.
- */
-public class VoidModel extends ModelAbstract<Void> {
-
- private static final long serialVersionUID = 1L;
-
- public VoidModel() {
- }
-
- @Override
- protected Void load() {
- return null;
- }
-
-
- // //////////////////////////////////////
-
- private ActionModel actionModelHint;
- /**
- * The {@link ActionModel model} of the {@link ObjectAction action}
- * that generated this {@link VoidModel}.
- *
- * @see #setActionHint(ActionModel)
- */
- public ActionModel getActionModelHint() {
- return actionModelHint;
- }
- /**
- * Called by action.
- *
- * @see #getActionModelHint()
- */
- public void setActionHint(ActionModel actionModelHint) {
- this.actionModelHint = actionModelHint;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WelcomeModel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WelcomeModel.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WelcomeModel.java
deleted file mode 100644
index 8e43887..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WelcomeModel.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-/**
- * Model providing welcome text.
- */
-public class WelcomeModel extends ModelAbstract<String> {
-
- private static final long serialVersionUID = 1L;
-
- public WelcomeModel(final String message) {
- setObject(message);
- }
-
- @Override
- protected String load() {
- return getObject();
- }
-
- @Override
- public void setObject(final String message) {
- if(message == null) {
- return;
- }
- super.setObject(message);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WicketComponentUtils.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WicketComponentUtils.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WicketComponentUtils.java
deleted file mode 100644
index 1fba4ed..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/WicketComponentUtils.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.isis.viewer.wicket.model.models;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.Page;
-import org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor;
-import org.apache.wicket.util.visit.IVisit;
-
-public class WicketComponentUtils {
-
- public WicketComponentUtils(){}
-
- /**
- * Locates a component implementing the required class on the same page as the supplied component.
- */
- public static <T> T getFrom(Component component, final Class<T> cls) {
- return getFrom(component.getPage(), cls);
- }
-
- /**
- * Locates a component implementing the required class on the supplied page.
- */
- public static <T> T getFrom(Page page, final Class<T> cls) {
- final Object[] pComponent = new Object[1];
- page.visitChildren(new DeepChildFirstVisitor() {
- @Override
- public void component(Component component, IVisit<Void> visit) {
- if(cls.isAssignableFrom(component.getClass())) {
- pComponent[0] = component;
- visit.stop();
- }
- }
- @Override
- public boolean preCheck(Component component) {
- return false;
- }
- });
-
- return (T) pComponent[0];
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/MementoFunctions.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/MementoFunctions.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/MementoFunctions.java
deleted file mode 100644
index 45cfd33..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/MementoFunctions.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.util;
-
-import com.google.common.base.Function;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
-import org.apache.isis.viewer.wicket.model.mementos.ActionParameterMemento;
-import org.apache.isis.viewer.wicket.model.mementos.CollectionMemento;
-import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
-import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
-
-/**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
-@Deprecated
-public final class MementoFunctions {
-
- private MementoFunctions() {
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectSpecification, ObjectSpecId> fromSpec() {
- return ObjectAdapterMemento.Functions.fromSpec();
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<OneToOneAssociation, PropertyMemento> fromProperty() {
- return ObjectAdapterMemento.Functions.fromProperty();
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<OneToManyAssociation, CollectionMemento> fromCollection() {
- return ObjectAdapterMemento.Functions.fromCollection();
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectAction, ActionMemento> fromAction() {
- return ObjectAdapterMemento.Functions.fromAction();
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectActionParameter, ActionParameterMemento> fromActionParameter() {
- return ObjectAdapterMemento.Functions.fromActionParameter();
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<Object, ObjectAdapterMemento> fromPojo(final AdapterManager adapterManager) {
- return ObjectAdapterMemento.Functions.fromPojo(adapterManager);
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectAdapter, ObjectAdapterMemento> fromAdapter() {
- return ObjectAdapterMemento.Functions.fromAdapter();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/ObjectAdapterFunctions.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/ObjectAdapterFunctions.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/ObjectAdapterFunctions.java
deleted file mode 100644
index 7700e04..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/ObjectAdapterFunctions.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.util;
-
-import com.google.common.base.Function;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
-import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
-
-/**
- * @deprecated - use {@link ObjectAdapter.Functions} or {@link ObjectAdapterMemento.Functions}
- */
-@Deprecated
-public final class ObjectAdapterFunctions {
-
- private ObjectAdapterFunctions() {
- }
-
- /**
- * @deprecated - use {@link ObjectAdapter.Functions}
- */
- @Deprecated
- public static Function<Object, ObjectAdapter> fromPojo(final AdapterManager adapterManager) {
- return ObjectAdapter.Functions.adapterForUsing(adapterManager);
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectAdapterMemento, ObjectAdapter> fromMemento(final ConcurrencyChecking concurrencyChecking) {
- return ObjectAdapterMemento.Functions.fromMemento(concurrencyChecking);
- }
-
- /**
- * @deprecated - use {@link ObjectAdapterMemento.Functions}
- */
- @Deprecated
- public static Function<ObjectAdapter, ObjectAdapterMemento> toMemento() {
- return ObjectAdapterMemento.Functions.toMemento();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/OidMatchers.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/OidMatchers.java b/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/OidMatchers.java
deleted file mode 100644
index 7904a35..0000000
--- a/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/util/OidMatchers.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.util;
-
-import org.hamcrest.Matcher;
-
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
-
-/**
- * @deprecated - use {@link Oid.Matchers}
- */
-@Deprecated
-public final class OidMatchers {
-
- private OidMatchers() {
- }
-
- /**
- * @deprecated - use {@link Oid.Matchers}
- */
- @Deprecated
- public static Matcher<Oid> isTransient() {
- return Oid.Matchers.isTransient();
- }
-
- /**
- * @deprecated - use {@link Oid.Matchers}
- */
- @Deprecated
- public static Matcher<Oid> isPersistent() {
- return Oid.Matchers.isPersistent();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ActionModelTest.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ActionModelTest.java b/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ActionModelTest.java
deleted file mode 100644
index f7b5baa..0000000
--- a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ActionModelTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class ActionModelTest {
-
- @Test
- public void whenParseThenParses() throws Exception {
- final Map.Entry<Integer, String> parsed = ActionModel.parse("3=OBJECT_OID:123");
- assertThat(parsed, is(not(nullValue())));
- assertThat(parsed.getKey(), is(3));
- assertThat(parsed.getValue(), is("OBJECT_OID:123"));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java b/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
deleted file mode 100644
index 08205b2..0000000
--- a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.model.models;
-
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.junit.Test;
-
-import org.apache.isis.core.commons.lang.IterableExtensions;
-import org.apache.isis.core.commons.matchers.IsisMatchers;
-
-public class LowestCommonSuperclassClosureTest {
-
- static class Animal {}
- static class Mineral {}
- static class Vegetable {}
- static class Mammal extends Animal {}
- static class Lion extends Mammal {}
-
- @Test
- public void nothingInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Animal.class, Mineral.class, Vegetable.class), Object.class);
- }
-
- @Test
- public void superclassInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Animal.class, Mammal.class), Animal.class);
- }
-
- @Test
- public void subclassInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Lion.class, Lion.class), Lion.class);
- }
-
- private static void assertLowestCommonOfListIs(List<Class<? extends Object>> list, Class<?> expected) {
- EntityCollectionModel.LowestCommonSuperclassClosure closure = new EntityCollectionModel.LowestCommonSuperclassClosure();
- IterableExtensions.fold(list, closure);
- assertThat(closure.getLowestCommonSuperclass(), IsisMatchers.classEqualTo(expected));
- }
-
- private static List<Class<? extends Object>> listOf(Class<?>... classes) {
- return Lists.newArrayList(classes);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ModelAbstractTest.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ModelAbstractTest.java b/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ModelAbstractTest.java
deleted file mode 100644
index 4655239..0000000
--- a/component/viewer/wicket/model/src/test/java/org/apache/isis/viewer/wicket/model/models/ModelAbstractTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.isis.viewer.wicket.model.models;
-
-import java.util.Map;
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.model.IModel;
-import org.jmock.Expectations;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.viewer.wicket.model.hints.UiHintPathSignificant;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class ModelAbstractTest {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(JUnitRuleMockery2.Mode.INTERFACES_AND_CLASSES);
-
- ModelAbstract<String> target;
-
- static class UiHintPathSignificantComponent extends Component implements UiHintPathSignificant {
- public UiHintPathSignificantComponent(String id) {
- super(id);
- }
-
- public UiHintPathSignificantComponent(String id, IModel<?> model) {
- super(id, model);
- }
-
- @Override
- protected void onRender() {
- }
- }
-
- static class UiHintPathSignificantMarkupContainer extends MarkupContainer implements UiHintPathSignificant {
- public UiHintPathSignificantMarkupContainer(String id) {
- super(id);
- }
-
- public UiHintPathSignificantMarkupContainer(String id, IModel<?> model) {
- super(id, model);
- }
-
- @Override
- protected void onRender() {
- }
- }
-
- MarkupContainer mockParent;
- Component mockComponent1;
- Component mockComponent2;
-
- @Before
- public void setUp() throws Exception {
- target = new ModelAbstract<String>("foo"){
- @Override
- protected String load() {
- return null;
- }
- };
-
- mockParent = context.mock(UiHintPathSignificantMarkupContainer.class, "parent");
- mockComponent1 = context.mock(UiHintPathSignificantComponent.class, "component1");
- mockComponent2 = context.mock(UiHintPathSignificantComponent.class, "component2");
-
- context.checking(new Expectations() {{
- allowing(mockParent).getId();
- will(returnValue("parent"));
-
- allowing(mockComponent1).getId();
- will(returnValue("id1"));
-
- allowing(mockComponent2).getId();
- will(returnValue("id2"));
-
- ignoring(mockComponent1);
- ignoring(mockComponent2);
-
- }});
-
- mockComponent1.setParent(mockParent);
- mockComponent2.setParent(mockParent);
- }
-
- public static class Hints extends ModelAbstractTest {
-
- @Test
- public void empty() throws Exception {
- assertThat(target.getHint(mockComponent1, "key1"), is(nullValue()));
- }
-
- @Test
- public void single() throws Exception {
- target.setHint(mockComponent1, "key1", "value1");
- assertThat(target.getHint(mockComponent1, "key1"), is("value1"));
- }
-
- @Test
- public void clear() throws Exception {
- target.setHint(mockComponent1, "key1", "value1");
- assertThat(target.getHint(mockComponent1, "key1"), is("value1"));
- target.clearHint(mockComponent1, "key1");
- assertThat(target.getHint(mockComponent1, "key1"), is(nullValue()));
- }
-
- @Test
- public void setToNull() throws Exception {
- target.setHint(mockComponent1, "key1", "value1");
- assertThat(target.getHint(mockComponent1, "key1"), is("value1"));
- target.setHint(mockComponent1, "key1", null);
- assertThat(target.getHint(mockComponent1, "key1"), is(nullValue()));
- }
-
- @Test
- public void multipleKeys() throws Exception {
- target.setHint(mockComponent1, "key1", "value1");
- target.setHint(mockComponent1, "key2", "value2");
- assertThat(target.getHint(mockComponent1, "key1"), is("value1"));
- assertThat(target.getHint(mockComponent1, "key2"), is("value2"));
- }
-
- @Test
- public void multipleComponents() throws Exception {
- target.setHint(mockComponent1, "key", "valueA");
- target.setHint(mockComponent2, "key", "valueB");
- assertThat(target.getHint(mockComponent1, "key"), is("valueA"));
- assertThat(target.getHint(mockComponent2, "key"), is("valueB"));
- }
-
- @Test
- public void smoke() throws Exception {
- target.setHint(mockComponent1, "X", "1.X");
- target.setHint(mockComponent1, "A", "1.A");
- target.setHint(mockComponent1, "B", "1.B");
- target.setHint(mockComponent1, "C", "1.C");
- target.setHint(mockComponent2, "X", "2.X");
- target.setHint(mockComponent2, "P", "2.P");
- target.setHint(mockComponent2, "Q", "2.Q");
- target.setHint(mockComponent2, "R", "2.R");
-
- final Map<String, String> hints = target.getHints();
- assertThat(hints.size(), is(8));
- assertThat(hints.get("id1-X"), is("1.X"));
- assertThat(hints.get("id2-X"), is("2.X"));
- assertThat(hints.get("id1-B"), is("1.B"));
- assertThat(hints.get("id2-R"), is("2.R"));
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/pom.xml b/component/viewer/wicket/pom.xml
deleted file mode 100644
index 777d518..0000000
--- a/component/viewer/wicket/pom.xml
+++ /dev/null
@@ -1,430 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <relativePath>../../../core/pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket</artifactId>
- <version>1.8.0-SNAPSHOT</version>
-
- <name>Isis Wicket Viewer</name>
-
- <packaging>pom</packaging>
-
- <properties>
- <siteBaseDir>.</siteBaseDir>
- <relativeUrl />
-
- <wicket.version>6.17.0</wicket.version>
- <wicketstuff.version>6.17.0</wicketstuff.version>
-
- <wicket-webjars.version>0.4.3</wicket-webjars.version>
- <wicket-bootstrap.version>0.9.7</wicket-bootstrap.version>
- <wicket-source.version>6.0.0.8</wicket-source.version>
-
- <wicket-select2.version>2.2.3</wicket-select2.version>
- <select2.version>3.5.1</select2.version>
- <jquery-ui.version>1.10.4</jquery-ui.version>
- </properties>
-
- <!-- used in Site generation for relative references. -->
- <url>http://isis.apache.org/${relativeUrl}</url>
-
- <modules>
- <module>applib</module>
- <module>model</module>
- <module>ui</module>
- <module>impl</module>
- </modules>
-
- <build>
- <pluginManagement>
- <plugins>
- <!-- Apache Release Audit Tool -->
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.10</version>
- <configuration>
- <excludes>
- <!--
- overriding inherited excludes from oia.core:isis
- with a more specific set for this component
- -->
- <exclude>**/target/**</exclude>
- <exclude>**/target-ide/**</exclude>
-
- <exclude>**/*.project</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.settings/**</exclude>
- <exclude>**/*.pdn</exclude>
- <exclude>**/jquery.zclip.js</exclude>
-
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>net.alchim31.maven</groupId>
- <artifactId>yuicompressor-maven-plugin</artifactId>
- <version>1.5.0</version>
- <configuration>
- <statistics>true</statistics>
- <jswarn>false</jswarn>
- <suffix>.min</suffix>
- <excludes>
- <exclude>**/moment.js</exclude>
- <exclude>**/moment.min.js</exclude>
- <exclude>**/bootstrap-datetimepicker.js</exclude>
- <exclude>**/bootstrap-datetimepicker.min.js</exclude>
- <exclude>**/bootstrap-growl.js</exclude>
- <exclude>**/bootstrap-growl.min.js</exclude>
- </excludes>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>compress</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencyManagement>
- <dependencies>
-
- <!-- also for benefit of application developers, using scope=import -->
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-applib</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <scope>test</scope>
- <type>test-jar</type>
- </dependency>
-
-
- <!-- Wicket -->
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket</artifactId>
- <version>${wicket.version}</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-util</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-datetime</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-auth-roles</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-guice</artifactId>
- <version>${wicket.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <!-- for Java7 compatibility (we don't use the proxying capability of this component) -->
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Wicket-Select2 -->
- <dependency>
- <groupId>com.vaynberg.wicket.select2</groupId>
- <artifactId>wicket-select2</artifactId>
- <version>${wicket-select2.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>select2</artifactId>
- <version>${select2.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery-ui</artifactId>
- <version>${jquery-ui.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Webjars -->
- <dependency>
- <groupId>de.agilecoders.wicket.webjars</groupId>
- <artifactId>wicket-webjars</artifactId>
- <version>${wicket-webjars.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-core</artifactId>
- <version>${wicket-bootstrap.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-extensions</artifactId>
- <version>${wicket-bootstrap.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-request</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>jquery</artifactId>
- </exclusion>
- <!-- exclude unused extensions -->
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>jquerypp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>jquery-ui</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>typeaheadjs</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>x-editable-bootstrap</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.webjars</groupId>
- <artifactId>spin-js</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.javascript</groupId>
- <artifactId>closure-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-themes</artifactId>
- <version>${wicket-bootstrap.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-
- <dependency>
- <groupId>net.ftlines.wicket-source</groupId>
- <artifactId>wicket-source</artifactId>
- <version>${wicket-source.version}</version>
- <exclusions>
- <exclusion>
- <!-- for dependency convergence -->
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
- </dependencyManagement>
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/src/main/appended-resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/src/main/appended-resources/supplemental-models.xml b/component/viewer/wicket/src/main/appended-resources/supplemental-models.xml
deleted file mode 100644
index b839240..0000000
--- a/component/viewer/wicket/src/main/appended-resources/supplemental-models.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
- license agreements. See the NOTICE file distributed with this work for additional
- information regarding copyright ownership. The ASF licenses this file to
- you under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of
- the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License. -->
-<supplementalDataModels xmlns="http://maven.apache.org/supplemental-model/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/supplemental-model/1.0.0 http://maven.apache.org/xsd/supplemental-model-1.0.0.xsd">
-
- <supplement>
- <project>
- <groupId>aopalliance</groupId>
- <artifactId>aopalliance</artifactId>
- <version>1.0</version>
- <licenses>
- <license>
- <name>Public Domain</name>
- </license>
- </licenses>
- </project>
- </supplement>
-
- <supplement>
- <project>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1</version>
- <licenses>
- <license>
- <name>BSD License</name>
- <url>http://dom4j.sourceforge.net/dom4j-1.6.1/license.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- </project>
- </supplement>
-
-
- <supplement>
- <project>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-jdo-query</artifactId>
- <version>3.0.2</version>
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- </license>
- </licenses>
- </project>
- </supplement>
-
- <supplement>
- <project>
- <groupId>javax.transaction</groupId>
- <artifactId>transaction-api</artifactId>
- <version>1.1</version>
- <name>Java Transaction API (JTA)</name>
- <organization>
- <name>Oracle Corp</name>
- <url>http://www.oracle.com/</url>
- </organization>
- <licenses>
- <license>
- <name>Common Development and Distribution License (CDDL) v1.0</name>
- <url>https://glassfish.java.net/public/CDDLv1.0.html</url>
- </license>
- </licenses>
- </project>
- </supplement>
-
- <!--
- <supplement>
- <project>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-jodatime</artifactId>
- <version>3.1.1</version>
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- </license>
- </licenses>
- </project>
- </supplement>
-
- <supplement>
- <project>
- <groupId>org.scannotation</groupId>
- <artifactId>scannotation</artifactId>
- <version>1.0.3</version>
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- </project>
- </supplement>
-
- <supplement>
- <project>
- <groupId>net.jcip</groupId>
- <artifactId>jcip-annotations</artifactId>
- <version>1.0</version>
- <licenses>
- <license>
- <name>Creative Commons Attribution 2.5 License</name>
- <url>http://creativecommons.org/licenses/by/2.5/</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- </project>
- </supplement>
-
-
- <supplement>
- <project>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- </project>
- </supplement>
- -->
-
-
-</supplementalDataModels>
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/pom.xml b/component/viewer/wicket/ui/pom.xml
deleted file mode 100644
index bca5b7d..0000000
--- a/component/viewer/wicket/ui/pom.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>isis-viewer-wicket-ui</artifactId>
- <name>Isis Wicket Viewer UI Components</name>
-
- <properties>
- <siteBaseDir>..</siteBaseDir>
- <relativeUrl>ui/</relativeUrl>
- </properties>
-
- <!-- used in Site generation for relative references. -->
- <url>http://isis.apache.org/${relativeUrl}</url>
-
- <build>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>net.alchim31.maven</groupId>
- <artifactId>yuicompressor-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-wicket-model</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-metamodel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-unittestsupport</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-extensions</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-auth-roles</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-guice</artifactId>
- </dependency>
- <dependency>
- <groupId>com.vaynberg.wicket.select2</groupId>
- <artifactId>wicket-select2</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>select2</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>jquery-ui</artifactId>
- </dependency>
-
- <!-- WEBJARS -->
- <dependency>
- <groupId>de.agilecoders.wicket.webjars</groupId>
- <artifactId>wicket-webjars</artifactId>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-extensions</artifactId>
- </dependency>
-
- <dependency>
- <groupId>de.agilecoders.wicket</groupId>
- <artifactId>wicket-bootstrap-themes</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-servlet_2.5_spec</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- LOGGING DEPENDENCIES - LOG4J -->
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/images/Images.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/images/Images.java b/component/viewer/wicket/ui/src/main/java/images/Images.java
deleted file mode 100644
index f1e6fb0..0000000
--- a/component/viewer/wicket/ui/src/main/java/images/Images.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package images;
-
-import org.apache.wicket.request.resource.PackageResource;
-
-/**
- * This is a bit of a hack, but the Isis convention is to plonk all the images
- * in an images package. This empty class allows Wicket to pick them up as
- * {@link PackageResource}s.
- */
-public final class Images {
-
- private Images() {
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/CollectionContentsAsFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/CollectionContentsAsFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/CollectionContentsAsFactory.java
deleted file mode 100644
index 440b0ff..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/CollectionContentsAsFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.viewer.wicket.ui;
-
-import org.apache.wicket.model.IModel;
-
-/**
- * <p>
- * An interface for all {@link org.apache.isis.viewer.wicket.ui.ComponentFactory component factories}
- * (e.g. CollectionContentAsXyzFactory-ies) which want to provide specific title and CSS class(es)
- * for their representation in {@link org.apache.isis.viewer.wicket.ui.components.collectioncontents.multiple.CollectionContentsMultipleViewsPanel}.
- * </p>
- * <p>
- * If the {@link org.apache.isis.viewer.wicket.ui.ComponentFactory} doesn't implement this interface or the implementation
- * of any of its methods return {@code null} then {@link ComponentFactory#getName()} will be used as title and its
- * {@link org.apache.isis.core.commons.lang.StringExtensions#asLowerDashed(java.lang.String) dashed representation}
- * as CSS class for the optional image.
- * </p>
- */
-public interface CollectionContentsAsFactory {
-
- /**
- * @return A model that will be used as a label for the "View as" dropdown for "collection contents as"
- * component factories
- */
- IModel<String> getTitleLabel();
-
- /**
- * @return A model that will be used as a CSS class for the icon/image next to "View as" dropdown
- * for "collection contents as" component factories
- */
- IModel<String> getCssClass();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java
deleted file mode 100644
index e52ad7a..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui;
-
-import java.io.Serializable;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.request.resource.CssResourceReference;
-
-import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
-
-/**
- * Creates {@link Component}s of a specified {@link ComponentType}, optionally
- * {@link #appliesTo(ComponentType, IModel) dependent on} the provided
- * {@link IModel model}.
- *
- * <p>
- * This interface is at the very heart of the Wicket Objects' model, being an
- * usage of the chain-of-responsibility design pattern. The available
- * {@link ComponentFactory}s are registered through
- * {@link ComponentFactoryRegistry} (bootstrapped from the
- * <tt>IsisWicketApplication</tt>); various adapters make it easy to lookup
- * {@link Component}s from this registry.
- */
-public interface ComponentFactory extends Serializable {
-
- /**
- * The {@link ComponentType} with which this component factory has been
- * registered.
- */
- ComponentType getComponentType();
-
- public enum ApplicationAdvice {
- APPLIES(true, false),
- APPLIES_EXCLUSIVELY(true, true),
- DOES_NOT_APPLY(false, false);
- private final boolean applies;
- private final boolean exclusively;
-
- private ApplicationAdvice(final boolean applies, final boolean exclusively) {
- this.applies = applies;
- this.exclusively = exclusively;
- }
-
- public boolean applies() {
- return applies;
- }
-
- /**
- * Whether no other {@link ComponentFactory}s should apply (ie stop
- * searching for other views).
- */
- public boolean exclusively() {
- return exclusively;
- }
-
- public static final ApplicationAdvice appliesIf(final boolean b) {
- return b ? ApplicationAdvice.APPLIES : ApplicationAdvice.DOES_NOT_APPLY;
- }
- }
-
- /**
- * Whether the {@link Component} created by this factory applies to the
- * specified {@link ComponentType} and {@link IModel}.
- */
- ApplicationAdvice appliesTo(ComponentType componentType, IModel<?> model);
-
- /**
- * Creates component, with id being derived from the
- * {@link #getComponentType() component type} for this factory.
- *
- * @param model
- * @return
- */
- Component createComponent(IModel<?> model);
-
- /**
- * Creates component, with specified id.
- */
- Component createComponent(String id, IModel<?> model);
-
- /**
- * Used for rendering in drop-downs.
- */
- String getName();
-
- CssResourceReference getCssResourceReference();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java
deleted file mode 100644
index e018a74..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.request.resource.CssResourceReference;
-
-import org.apache.isis.viewer.wicket.ui.panels.PanelUtil;
-
-/**
- * Adapter implementation for {@link ComponentFactory}.
- */
-public abstract class ComponentFactoryAbstract implements ComponentFactory {
-
- private static final long serialVersionUID = 1L;
-
- private final ComponentType componentType;
- private final String name;
-
- private final Class<?> componentClass;
-
- public ComponentFactoryAbstract(final ComponentType componentType) {
- this(componentType, null, null);
- }
-
- public ComponentFactoryAbstract(final ComponentType componentType, final String name) {
- this(componentType, name, null);
- }
-
- public ComponentFactoryAbstract(final ComponentType componentType, @SuppressWarnings("rawtypes") Class componentClass) {
- this(componentType, null, componentClass);
- }
-
- public ComponentFactoryAbstract(final ComponentType componentType, final String name, @SuppressWarnings("rawtypes") Class componentClass) {
- this.componentType = componentType;
- this.name = name != null ? name : getClass().getSimpleName();
- if(componentClass != null && ComponentFactory.class.isAssignableFrom(componentClass)) {
- throw new IllegalArgumentException("specified a ComponentFactory as a componentClass... you probably meant the component instead? componentClass = " + componentClass.getName());
- }
- this.componentClass = componentClass;
- }
-
- @Override
- public ComponentType getComponentType() {
- return componentType;
- }
-
- /**
- * Applies if {@link #getComponentType()} matches; disregards the provided
- * {@link IModel}.
- *
- * @see #appliesTo(IModel)
- */
- @Override
- public final ApplicationAdvice appliesTo(final ComponentType componentType, final IModel<?> model) {
- if (componentType != getComponentType()) {
- return ApplicationAdvice.DOES_NOT_APPLY;
- }
- return appliesTo(model);
- }
-
- /**
- * Hook for subclasses to check the {@link IModel}.
- */
- protected abstract ApplicationAdvice appliesTo(IModel<?> model);
-
- protected final ApplicationAdvice appliesIf(final boolean b) {
- return ApplicationAdvice.appliesIf(b);
- }
-
- /**
- * Convenience for subclasses to call from {@link #appliesTo(IModel)}
- */
- protected final ApplicationAdvice appliesExclusivelyIf(final boolean b) {
- return b ? ApplicationAdvice.APPLIES_EXCLUSIVELY : ApplicationAdvice.DOES_NOT_APPLY;
- }
-
- @Override
- public final Component createComponent(final IModel<?> model) {
- return createComponent(getComponentType().toString(), model);
- }
-
- @Override
- public abstract Component createComponent(String id, IModel<?> model);
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public CssResourceReference getCssResourceReference() {
- return PanelUtil.cssResourceReferenceFor(componentClass);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java
deleted file mode 100644
index 70281cf..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui;
-
-import org.apache.wicket.Component;
-
-import org.apache.isis.core.commons.lang.StringExtensions;
-
-/**
- * Enumerates the different types of {@link Component}s that can be constructed
- * using {@link ComponentFactory}.
- *
- * <p>
- * Some are fine-grained (such as {@link ComponentType#SCALAR_NAME_AND_VALUE}, a
- * panel to represent a single scalar property or parameter), but others are
- * somewhat larger (such as {@link ComponentType#ENTITY}, representing an
- * entity, with its actions, properties and collections).
- */
-public enum ComponentType {
-
-
- /**
- * About page text.
- */
- ABOUT,
- /**
- * Welcome page text.
- */
- WELCOME,
- /**
- * List of services and their actions.
- *
- * <p>
- * Could be rendered using a JavaScript or DHTML menu, an accordion, or a
- * tree view.
- */
- SERVICE_ACTIONS,
- /**
- * A single domain entity.
- */
- ENTITY,
- /**
- * Icon and title for a single entity.
- */
- ENTITY_ICON_AND_TITLE,
- /**
- * Icon, title and a copy link for a single entity.
- */
- ENTITY_ICON_TITLE_AND_COPYLINK,
- /**
- * Title, icon and action list for a single entity.
- */
- ENTITY_SUMMARY,
- /**
- * The set of properties for a single entity.
- */
- ENTITY_PROPERTIES,
- /**
- * The set of collections of a single entity, designed to be standalone outside of a form.
- *
- * <p>
- * compare with {@value #ENTITY_COLLECTIONS}.
- */
- ENTITY_COLLECTIONS,
- /**
- * A single standalone value, as might be returned from an action.
- */
- VALUE,
- /**
- * The name and value of a single property or parameter, ie a scalar.
- */
- SCALAR_NAME_AND_VALUE,
- /**
- * The name and contents of a single collection of an entity;
- * {@link Component}s are expected to use {@link #COLLECTION_CONTENTS} to
- * actually render the contents.
- */
- COLLECTION_NAME_AND_CONTENTS,
- /**
- * The parameter form (dialog box) of an action.
- */
- PARAMETERS,
- /**
- * Info details for an action, eg to display the target, a resubmit button,
- * any description or help text, and so on.
- */
- ACTION_INFO,
- /**
- * Used to display the parameters of an action.
- */
- ACTION_PROMPT,
- /**
- * Top-level component for rendering a standalone collection (ie as returned by
- * an action).
- */
- STANDALONE_COLLECTION,
- /**
- * Bookmarked link to invoke an action
- */
- ACTION_LINK,
- /**
- * A collection of entities (the value of)
- */
- COLLECTION_CONTENTS,
- /**
- * A link to an entity.
- */
- ENTITY_LINK,
- /**
- * A collection of entities, from an action, but none returned.
- */
- EMPTY_COLLECTION,
- /**
- * A void result from an action.
- */
- VOID_RETURN,
- /**
- * A list of {@link IsisModel}s, rendered as a list of links.
- */
- BOOKMARKED_PAGES,
- /**
- * Place holder for a component used to represent an unknown model;
- * not used for matching, since the {@link ComponentFactory} implementation
- * acts as a fallback whenever a more suitable factory cannot be located.
- */
- UNKNOWN,
-
- /**
- * The header (navigation bar) of the page
- */
- HEADER,
-
- /**
- * The footer of the page
- */
- FOOTER;
-
- /**
- * Returns the {@link #name()} formatted as
- * {@link org.apache.isis.core.commons.lang.StringExtensions#toCamelCase(String) case}.
- *
- * <p>
- * For example, <tt>OBJECT_EDIT</tt> becomes <tt>objectEdit</tt>.
- */
- @Override
- public String toString() {
- return getWicketId();
- }
-
- public String getWicketId() {
- return StringExtensions.toCamelCase(name());
- }
-
- public static ComponentType lookup(final String id) {
- for (final ComponentType componentType : values()) {
- if (componentType.getWicketId().equals(id)) {
- return componentType;
- }
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/HeaderContributorProvider.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/HeaderContributorProvider.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/HeaderContributorProvider.java
deleted file mode 100644
index fd9663b..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/HeaderContributorProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.viewer.wicket.ui;
-
-import org.apache.wicket.markup.html.IHeaderContributor;
-
-// TODO unused. Remove ?!
-public interface HeaderContributorProvider {
-
- IHeaderContributor getHeaderContributor();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponse.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponse.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponse.java
deleted file mode 100644
index ad5bbf5..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/actionresponse/ActionResultResponse.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.isis.viewer.wicket.ui.actionresponse;
-
-import java.net.URL;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.request.IRequestHandler;
-
-import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
-
-/**
- * The response to provide as a result of interpreting the response;
- * either to show a {@link #toPage(PageAbstract) page}, or to {@link #withHandler(IRequestHandler) redirect} to a
- * handler (eg a download).
- */
-public class ActionResultResponse {
-
- private final ActionResultResponseHandlingStrategy handlingStrategy;
- private final IRequestHandler handler;
- private final PageAbstract page;
- private final AjaxRequestTarget target;
- private final URL url;
-
- public static ActionResultResponse withHandler(IRequestHandler handler) {
- return new ActionResultResponse(
- ActionResultResponseHandlingStrategy.SCHEDULE_HANDLER, handler, null, null, null);
- }
- public static ActionResultResponse toPage(PageAbstract page) {
- return new ActionResultResponse(
- ActionResultResponseHandlingStrategy.REDIRECT_TO_PAGE, null, page, null, null);
- }
- public static ActionResultResponse openUrlInBrowser(final AjaxRequestTarget target, final URL url) {
- return new ActionResultResponse(
- ActionResultResponseHandlingStrategy.OPEN_URL_IN_BROWSER, null, null, target, url);
- }
- private ActionResultResponse(
- final ActionResultResponseHandlingStrategy strategy,
- final IRequestHandler handler,
- final PageAbstract page,
- final AjaxRequestTarget target,
- final URL url) {
- handlingStrategy = strategy;
- this.handler = handler;
- this.page = page;
- this.target = target;
- this.url = url;
- }
-
- public ActionResultResponseHandlingStrategy getHandlingStrategy() {
- return handlingStrategy;
- }
-
- /**
- * Populated only if {@link #getHandlingStrategy() handling strategy} is {@link ActionResultResponseHandlingStrategy#SCHEDULE_HANDLER}
- */
- public IRequestHandler getHandler() {
- return handler;
- }
- /**
- * Populated only if {@link #getHandlingStrategy() handling strategy} is {@link ActionResultResponseHandlingStrategy#REDIRECT_TO_PAGE}
- */
- public PageAbstract getToPage() {
- return page;
- }
- /**
- * Populated only if {@link #getHandlingStrategy() handling strategy} is {@link ActionResultResponseHandlingStrategy#OPEN_URL_IN_BROWSER}
- */
- public AjaxRequestTarget getTarget() {
- return target;
- }
- /**
- * Populated only if {@link #getHandlingStrategy() handling strategy} is {@link ActionResultResponseHandlingStrategy#OPEN_URL_IN_BROWSER}
- */
- public URL getUrl() {
- return url;
- }
-}