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 2016/01/08 11:28:23 UTC
[1/6] isis git commit: ISIS-993: metadata has back owners. Wicket
component broken at this point
Repository: isis
Updated Branches:
refs/heads/ISIS-993 b590c9791 -> 0ac8eda9a
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
new file mode 100644
index 0000000..3f9b76f
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
@@ -0,0 +1,119 @@
+/*
+ * 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.components.entity.tabgroups;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+
+import org.apache.isis.applib.layout.v1_0.DomainObject;
+import org.apache.isis.applib.layout.v1_0.Tab;
+import org.apache.isis.applib.layout.v1_0.TabGroup;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.object.layoutxml.LayoutXmlFacet;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
+
+/**
+ * {@link PanelAbstract Panel} to represent an entity on a single page made up
+ * of several <div> regions.
+ */
+public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_ENTITY_PROPERTIES_AND_COLLECTIONS = "entityPropertiesAndCollections";
+ private static final String ID_TAB_GROUPS = "tabGroups";
+ private static final String ID_TAB_GROUP = "tabGroup";
+
+ public EntityTabGroupsPanel(final String id, final EntityModel entityModel) {
+ super(id, entityModel);
+ buildGui();
+ }
+
+ private void buildGui() {
+ final EntityModel model = getModel();
+ final ObjectAdapter objectAdapter = model.getObject();
+ final CssClassFacet facet = objectAdapter.getSpecification().getFacet(CssClassFacet.class);
+ if(facet != null) {
+ final String cssClass = facet.cssClass(objectAdapter);
+ CssClassAppender.appendCssClassTo(this, cssClass);
+ }
+
+ // forces metadata to be derived && synced
+ final LayoutXmlFacet layoutXmlFacet = model.getTypeOfSpecification().getFacet(LayoutXmlFacet.class);
+ final DomainObject domainObject = layoutXmlFacet.getLayoutMetadata();
+
+ addOrReplace(ComponentType.ENTITY_SUMMARY, model);
+
+ final List<TabGroup> tabGroups = domainObject.getTabGroups();
+ final ListView<TabGroup> tabGroupsList =
+ new ListView<TabGroup>(ID_TAB_GROUPS, tabGroups) {
+
+ @Override
+ protected void populateItem(final ListItem<TabGroup> item) {
+
+ final List<ITab> tabs = Lists.newArrayList();
+ final TabGroup tabGroup = item.getModelObject();
+ final List<Tab> tabList = tabGroup.getTabs();
+
+ for (final Tab tab : tabList) {
+
+ tabs.add(new AbstractTab(Model.of(tab.getName())) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Panel getPanel(String panelId) {
+ return new EntityTabPanel(panelId, model, tab);
+ }
+ });
+ }
+ item.add(new AjaxBootstrapTabbedPanel(ID_TAB_GROUP, tabs));
+ }
+ };
+ add(tabGroupsList);
+ }
+
+ private static class EntityTabPanel extends PanelAbstract {
+ private static final long serialVersionUID = 1L;
+
+ public EntityTabPanel(String id, final EntityModel model, final Tab tab) {
+ super(id);
+
+ final EntityModel modelWithTabHints = new EntityModel(model.getPageParameters());
+ model.setTab(tab);
+
+ getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_PROPERTIES_AND_COLLECTIONS, ComponentType.ENTITY_PROPERTIES, modelWithTabHints);
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanelFactory.java
new file mode 100644
index 0000000..825ea59
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanelFactory.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.components.entity.tabgroups;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+
+import org.apache.isis.core.metamodel.facets.object.layoutxml.LayoutXmlFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.ComponentFactory;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
+
+/**
+ * {@link ComponentFactory} for {@link EntityTabGroupsPanel}.
+ */
+public class EntityTabGroupsPanelFactory extends EntityComponentFactoryAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String NAME = "tabbed";
+
+ public EntityTabGroupsPanelFactory() {
+ super(ComponentType.ENTITY, NAME, EntityTabGroupsPanel.class);
+ }
+
+ @Override
+ protected ApplicationAdvice doAppliesTo(final EntityModel entityModel) {
+ final ObjectSpecification specification = entityModel.getTypeOfSpecification();
+ return appliesIf(specification.containsDoOpFacet(LayoutXmlFacet.class));
+ }
+
+ @Override
+ public Component createComponent(final String id, final IModel<?> model) {
+ final EntityModel entityModel = (EntityModel) model;
+ return new EntityTabGroupsPanel(id, entityModel);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
index 036b99d..bb468a5 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
@@ -31,4 +31,14 @@
</left>
</tab>
</tabGroup>
+ <tabGroup>
+ <tab name="Similar To">
+ <left span="12">
+ <collection id="similarTo">
+ <actions/>
+ <layout/>
+ </collection>
+ </left>
+ </tab>
+ </tabGroup>
</domainObject>
\ No newline at end of file
[2/6] isis git commit: ISIS-993: metadata has back owners. Wicket
component broken at this point
Posted by da...@apache.org.
ISIS-993: metadata has back owners. Wicket component broken at this point
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/165202f6
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/165202f6
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/165202f6
Branch: refs/heads/ISIS-993
Commit: 165202f603ff7eb858f51f7f5a80df0f97e0b23d
Parents: b590c97
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Jan 8 08:50:03 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Jan 8 08:50:03 2016 +0000
----------------------------------------------------------------------
.../src/main/asciidoc/guides/cg.adoc | 31 ++++
.../src/main/asciidoc/guides/rg.adoc | 14 +-
.../src/main/asciidoc/guides/ug.adoc | 4 +-
.../apache/isis/applib/layout/v1_0/Action.java | 29 +++-
.../isis/applib/layout/v1_0/ActionLayout.java | 26 +++-
.../isis/applib/layout/v1_0/Collection.java | 23 ++-
.../applib/layout/v1_0/CollectionLayout.java | 27 +++-
.../apache/isis/applib/layout/v1_0/Column.java | 40 ++++-
.../isis/applib/layout/v1_0/DomainObject.java | 111 +++++++-------
.../isis/applib/layout/v1_0/Property.java | 25 +++-
.../isis/applib/layout/v1_0/PropertyGroup.java | 26 +++-
.../isis/applib/layout/v1_0/PropertyLayout.java | 28 +++-
.../org/apache/isis/applib/layout/v1_0/Tab.java | 29 +++-
.../isis/applib/layout/v1_0/TabGroup.java | 33 ++++-
.../apache/isis/applib/layout/v1_0/Util.java | 49 ++++++
.../object/layoutxml/LayoutXmlFacetDefault.java | 148 ++++++++++++-------
.../metamodel/spec/ObjectSpecifications.java | 17 ++-
.../spec/feature/ObjectAssociation.java | 3 +-
.../ComponentFactoryRegistrarDefault.java | 4 +-
.../viewer/wicket/model/models/EntityModel.java | 17 ++-
.../collections/EntityCollectionsPanel.html | 2 +-
.../entity/properties/EntityPropertiesForm.java | 48 ++++--
.../properties/EntityPropertiesPanel.html | 6 +-
.../EntityTabbedPanel$EntityTabPanel.html | 29 ----
.../entity/tabbed/EntityTabbedPanel.html | 31 ----
.../entity/tabbed/EntityTabbedPanel.java | 114 --------------
.../entity/tabbed/EntityTabbedPanelFactory.java | 56 -------
.../EntityTabGroupsPanel$EntityTabPanel.html | 29 ++++
.../entity/tabgroups/EntityTabGroupsPanel.html | 33 +++++
.../entity/tabgroups/EntityTabGroupsPanel.java | 119 +++++++++++++++
.../tabgroups/EntityTabGroupsPanelFactory.java | 56 +++++++
.../dom/simple/SimpleObject.layout.xml | 10 ++
32 files changed, 833 insertions(+), 384 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/adocs/documentation/src/main/asciidoc/guides/cg.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/cg.adoc b/adocs/documentation/src/main/asciidoc/guides/cg.adoc
new file mode 100644
index 0000000..9437dc7
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/cg.adoc
@@ -0,0 +1,31 @@
+[[cg]]
+= "Supporting Procedures" Guides
+:Notice: 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.
+:_basedir: ../
+:_imagesdir: images/
+:numbered:
+
+
+Apache Isis documentation is broken out into a number of user, reference and "supporting procedures" guides.
+
+The user guides available are:
+
+* xref:ugfun.adoc#[Fundamentals]
+* xref:ugvw.adoc#[Wicket viewer]
+* xref:ugvro.adoc#[Restful Objects viewer]
+* xref:ugsec.adoc#[Security]
+* xref:ugtst.adoc#[Testing]
+* xref:ugbtb.adoc#[Beyond the Basics]
+
+The reference guides are:
+
+* xref:rgant.adoc#[Annotations]
+* xref:rgsvc.adoc#[Domain Services]
+* xref:rgcfg.adoc#[Configuration Properties]
+* xref:rgcms.adoc#[Classes, Methods and Schema]
+
+The *supporting procedures* guides are:
+
+* xref:cgcon.adoc#[Contributors' Guide] (how to set up a development environment
+for Apache Isis and contribute back to the project)
+* xref:cgcon.adoc#[Committers' Guide] (release procedures and related practices)
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/adocs/documentation/src/main/asciidoc/guides/rg.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/rg.adoc b/adocs/documentation/src/main/asciidoc/guides/rg.adoc
index fceaed5..f5f702f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rg.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rg.adoc
@@ -6,16 +6,16 @@
:numbered:
-Apache Isis documentation is broken out into a number of user and reference guides.
+Apache Isis documentation is broken out into a number of user, reference and "supporting procedures" guides.
-The user guides available are:
+The *user guides* available are:
* xref:ugfun.adoc#[Fundamentals]
* xref:ugvw.adoc#[Wicket viewer]
* xref:ugvro.adoc#[Restful Objects viewer]
* xref:ugsec.adoc#[Security]
* xref:ugtst.adoc#[Testing]
-* xref:ugbtb.adoc#[Beyond the Basics] (this guide)
+* xref:ugbtb.adoc#[Beyond the Basics]
The reference guides are:
@@ -24,6 +24,8 @@ The reference guides are:
* xref:rgcfg.adoc#[Configuration Properties]
* xref:rgcms.adoc#[Classes, Methods and Schema]
-In addition, there is a xref:cgcon.adoc#[Contributors' Guide] (that describes how to set up a development environment
-for Apache Isis and contribute back to the project), and a xref:cgcon.adoc#[Committers' Guide] (that describes release
-procedures and related practices).
+The "supporting procedures" guides are:
+
+* xref:cgcon.adoc#[Contributors' Guide] (how to set up a development environment
+for Apache Isis and contribute back to the project)
+* xref:cgcon.adoc#[Committers' Guide] (release procedures and related practices)
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/adocs/documentation/src/main/asciidoc/guides/ug.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ug.adoc b/adocs/documentation/src/main/asciidoc/guides/ug.adoc
index 6b07136..ee05c8f 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ug.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ug.adoc
@@ -8,14 +8,14 @@
Apache Isis documentation is broken out into a number of user, reference and "supporting procedures" guides.
-The user guides available are:
+The *user guides* available are:
* xref:ugfun.adoc#[Fundamentals]
* xref:ugvw.adoc#[Wicket viewer]
* xref:ugvro.adoc#[Restful Objects viewer]
* xref:ugsec.adoc#[Security]
* xref:ugtst.adoc#[Testing]
-* xref:ugbtb.adoc#[Beyond the Basics] (this guide)
+* xref:ugbtb.adoc#[Beyond the Basics]
The reference guides are:
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
index 05aa54f..61c6443 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
@@ -18,8 +18,11 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlType(
@@ -29,7 +32,9 @@ import javax.xml.bind.annotation.XmlType;
, "layout"
}
)
-public class Action {
+public class Action implements Serializable {
+
+ private static final long serialVersionUID = 1L;
public Action() {
}
@@ -57,7 +62,8 @@ public class Action {
private ActionLayout layout;
- @XmlElement(name="layout", required = false)
+
+ @XmlElement(name="layout", required = true)
public ActionLayout getLayout() {
return layout;
}
@@ -65,4 +71,23 @@ public class Action {
public void setLayout(ActionLayout layout) {
this.layout = layout;
}
+
+
+ private ActionHolder owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public ActionHolder getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final ActionHolder owner) {
+ this.owner = owner;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
index 0e12158..9068d91 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
@@ -16,8 +16,11 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.isis.applib.annotation.BookmarkPolicy;
@@ -37,7 +40,9 @@ import org.apache.isis.applib.annotation.Where;
, "describedAs"
}
)
-public class ActionLayout {
+public class ActionLayout implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private BookmarkPolicy bookmarking;
@@ -151,4 +156,23 @@ public class ActionLayout {
this.position = position;
}
+
+
+ private Action owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Action getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Action owner) {
+ this.owner = owner;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
index cf2dc48..db7d92b 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
@@ -18,11 +18,13 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.google.common.collect.Lists;
@@ -34,8 +36,9 @@ import com.google.common.collect.Lists;
, "layout"
}
)
-public class Collection implements ColumnContent, ActionHolder {
+public class Collection implements ColumnContent, ActionHolder, Serializable {
+ private static final long serialVersionUID = 1L;
public Collection() {
}
@@ -87,5 +90,23 @@ public class Collection implements ColumnContent, ActionHolder {
}
+ private Column owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Column getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Column owner) {
+ this.owner = owner;
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
index 4769b61..08f89fc 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
@@ -17,8 +17,11 @@
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.isis.applib.annotation.Where;
@@ -38,7 +41,9 @@ import org.apache.isis.applib.annotation.Where;
,"sortedBy"
}
)
-public class CollectionLayout {
+public class CollectionLayout implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private String cssClass;
@@ -141,4 +146,24 @@ public class CollectionLayout {
public void setSortedBy(String sortedBy) {
this.sortedBy = sortedBy;
}
+
+
+
+ private Collection owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Collection getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Collection owner) {
+ this.owner = owner;
+ }
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
index 3ac724e..7e7129c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
@@ -18,13 +18,16 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@XmlType(
@@ -33,8 +36,9 @@ import com.google.common.collect.Lists;
, "content"
}
)
-public class Column {
+public class Column implements Serializable {
+ private static final long serialVersionUID = 1L;
public Column() {
}
@@ -71,4 +75,38 @@ public class Column {
this.content = content;
}
+ @XmlTransient
+ public Iterable<PropertyGroup> getPropertyGroups() {
+ return Iterables.transform(
+ Iterables.filter(getContent(), Util.is(PropertyGroup.class)),
+ Util.cast(PropertyGroup.class));
+ }
+ @XmlTransient
+ public Iterable<Collection> getCollections() {
+ return Iterables.transform(
+ Iterables.filter(getContent(), Util.is(Collection.class)),
+ Util.cast(Collection.class));
+ }
+
+
+
+
+ private Tab owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Tab getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Tab owner) {
+ this.owner = owner;
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
index c5fa00d..4d89b47 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
@@ -18,6 +18,7 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -27,9 +28,6 @@ import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.isis.applib.services.dto.Dto;
@@ -41,7 +39,9 @@ import org.apache.isis.applib.services.dto.Dto;
, "tabGroups"
}
)
-public class DomainObject implements Dto, ActionHolder {
+public class DomainObject implements Dto, ActionHolder, Serializable {
+
+ private static final long serialVersionUID = 1L;
private List<Action> actions = Lists.newArrayList();
@@ -81,17 +81,17 @@ public class DomainObject implements Dto, ActionHolder {
public interface Visitor {
- void visit(DomainObject domainObject);
- void visit(TabGroup tabGroup);
- void visit(Tab tab);
- void visit(Column column);
- void visit(PropertyGroup propertyGroup);
- void visit(Property property);
- void visit(@Nullable PropertyLayout propertyLayout, Property forProperty);
- void visit(Collection collection);
- void visit(@Nullable CollectionLayout collectionLayout, Collection forCollection);
- void visit(Action action, ActionHolder holder);
- void visit(@Nullable ActionLayout actionLayout, Action forAction);
+ void visit(final DomainObject domainObject);
+ void visit(final TabGroup tabGroup);
+ void visit(final Tab tab);
+ void visit(final Column column);
+ void visit(final PropertyGroup propertyGroup);
+ void visit(final Property property);
+ void visit(final PropertyLayout propertyLayout);
+ void visit(final Collection collection);
+ void visit(final CollectionLayout collectionLayout);
+ void visit(final Action action);
+ void visit(@Nullable final ActionLayout actionLayout);
}
public static class VisitorAdapter implements Visitor {
@@ -104,73 +104,80 @@ public class DomainObject implements Dto, ActionHolder {
@Override
public void visit(final Column column) { }
@Override
- public void visit(PropertyGroup propertyGroup) {}
+ public void visit(final PropertyGroup propertyGroup) {}
@Override
- public void visit(Property property) {}
+ public void visit(final Property property) {}
@Override
- public void visit(@Nullable final PropertyLayout propertyLayout, final Property forProperty) { }
+ public void visit(final PropertyLayout propertyLayout) { }
@Override
- public void visit(Collection collection) {}
+ public void visit(final Collection collection) {}
@Override
- public void visit(@Nullable final CollectionLayout collectionLayout, final Collection forCollection) { }
+ public void visit(final CollectionLayout collectionLayout) { }
@Override
- public void visit(final Action action, final ActionHolder actionHolder) { }
+ public void visit(final Action action) { }
@Override
- public void visit(@Nullable final ActionLayout actionLayout, final Action forAction) { }
+ public void visit(final ActionLayout actionLayout) { }
}
+ /**
+ * Initializes all "owner" references across the graph, eg {@link TabGroup#setOwner(DomainObject)} and {@link Tab#setOwner(TabGroup)} .
+ */
+ public void init() {
+ visit(new VisitorAdapter());
+ }
public void visit(final Visitor visitor) {
visitor.visit(this);
traverseActions(this, visitor);
final List<TabGroup> tabGroups = getTabGroups();
for (final TabGroup tabGroup : tabGroups) {
+ tabGroup.setOwner(this);
visitor.visit(tabGroup);
final List<Tab> tabs = tabGroup.getTabs();
for (final Tab tab : tabs) {
+ tab.setOwner(tabGroup);
visitor.visit(tab);
- traverseColumn(tab.getLeft(), visitor);
- traverseColumn(tab.getMiddle(), visitor);
- traverseColumn(tab.getRight(), visitor);
+ traverseColumn(tab.getLeft(), tab, visitor);
+ traverseColumn(tab.getMiddle(), tab, visitor);
+ traverseColumn(tab.getRight(), tab, visitor);
}
}
}
- private void traverseColumn(final Column column, final Visitor visitor) {
+ private void traverseColumn(final Column column, final Tab tab, final Visitor visitor) {
if(column == null) {
return;
}
+ column.setOwner(tab);
visitor.visit(column);
traversePropertyGroups(column, visitor);
traverseCollections(column, visitor);
}
private void traversePropertyGroups(final Column column, final Visitor visitor) {
- List<ColumnContent> content = column.getContent();
- final Iterable<PropertyGroup> propertyGroups =
- Iterables.transform(
- Iterables.filter(content, is(PropertyGroup.class)),
- cast(PropertyGroup.class));
- for (final PropertyGroup propertyGroup : propertyGroups) {
+ for (final PropertyGroup propertyGroup : column.getPropertyGroups()) {
+ propertyGroup.setOwner(column);
visitor.visit(propertyGroup);
traverseActions(propertyGroup, visitor);
final List<Property> properties = propertyGroup.getProperties();
for (final Property property : properties) {
+ property.setOwner(propertyGroup);
visitor.visit(property);
- visitor.visit(property.getLayout(), property);
+ final PropertyLayout layout = property.getLayout();
+ layout.setOwner(property);
+ visitor.visit(layout);
traverseActions(property, visitor);
}
}
}
private void traverseCollections(final Column column, final Visitor visitor) {
- final Iterable<Collection> collections =
- Iterables.transform(
- Iterables.filter(column.getContent(), is(Collection.class)),
- cast(Collection.class));
- for (final Collection collection : collections) {
+ for (final Collection collection : column.getCollections()) {
+ collection.setOwner(column);
visitor.visit(collection);
- visitor.visit(collection.getLayout(), collection);
+ final CollectionLayout layout = collection.getLayout();
+ layout.setOwner(collection);
+ visitor.visit(layout);
traverseActions(collection, visitor);
}
}
@@ -178,27 +185,11 @@ public class DomainObject implements Dto, ActionHolder {
private void traverseActions(final ActionHolder actionHolder, final Visitor visitor) {
final List<Action> actions = actionHolder.getActions();
for (final Action action : actions) {
- visitor.visit(action, actionHolder);
- visitor.visit(action.getLayout(), action);
- }
- }
-
- private <F, T extends F> CastFunction<F, T> cast(final Class<T> cls) {
- return new CastFunction<>();
- }
-
- private <F,T> Predicate<F> is(final Class<T> cls) {
- return new Predicate<F>() {
- @Override public boolean apply(@Nullable final F from) {
- return cls.isAssignableFrom(from.getClass());
- }
- };
- }
-
- private static class CastFunction<F, T extends F> implements Function<F, T> {
- @Override
- public final T apply(final F from) {
- return (T) from;
+ action.setOwner(actionHolder);
+ visitor.visit(action);
+ final ActionLayout layout = action.getLayout();
+ layout.setOwner(action);
+ visitor.visit(layout);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
index 5345d06..6f98d07 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
@@ -18,11 +18,13 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.google.common.collect.Lists;
@@ -34,7 +36,9 @@ import com.google.common.collect.Lists;
, "layout"
}
)
-public class Property implements ActionHolder {
+public class Property implements ActionHolder, Serializable {
+
+ private static final long serialVersionUID = 1L;
public Property() {
}
@@ -85,4 +89,23 @@ public class Property implements ActionHolder {
}
+
+
+ private PropertyGroup owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public PropertyGroup getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final PropertyGroup owner) {
+ this.owner = owner;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
index e7b169f..f249071 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
@@ -18,12 +18,14 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.google.common.collect.Lists;
@@ -37,7 +39,9 @@ import org.apache.isis.applib.annotation.MemberOrder;
, "properties"
}
)
-public class PropertyGroup implements ColumnContent, ActionHolder {
+public class PropertyGroup implements ColumnContent, ActionHolder, Serializable {
+
+ private static final long serialVersionUID = 1L;
public PropertyGroup() {
}
@@ -92,4 +96,24 @@ public class PropertyGroup implements ColumnContent, ActionHolder {
public void setProperties(List<Property> properties) {
this.properties = properties;
}
+
+
+ private Column owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Column getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Column owner) {
+ this.owner = owner;
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
index fff5086..7e67acf 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
@@ -16,8 +16,11 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.isis.applib.annotation.LabelPosition;
@@ -29,7 +32,9 @@ import org.apache.isis.applib.annotation.Where;
, "describedAs"
}
)
-public class PropertyLayout {
+public class PropertyLayout implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private String cssClass;
@@ -137,4 +142,25 @@ public class PropertyLayout {
public void setTypicalLength(Integer typicalLength) {
this.typicalLength = typicalLength;
}
+
+
+
+
+ private Property owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public Property getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final Property owner) {
+ this.owner = owner;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
index 988d1e8..4a07dca 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
@@ -18,8 +18,11 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlType(
@@ -31,7 +34,9 @@ import javax.xml.bind.annotation.XmlType;
, "right"
}
)
-public class Tab {
+public class Tab implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private String name;
@@ -80,4 +85,26 @@ public class Tab {
public void setRight(final Column right) {
this.right = right;
}
+
+
+
+ private TabGroup owner;
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public TabGroup getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final TabGroup owner) {
+ this.owner = owner;
+ }
+
+
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/TabGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/TabGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/TabGroup.java
index 2280ad6..60f39b8 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/TabGroup.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/TabGroup.java
@@ -18,22 +18,26 @@
*/
package org.apache.isis.applib.layout.v1_0;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-@XmlType(
- //propOrder = {"tabs"}
-)
-public class TabGroup {
+@XmlType()
+public class TabGroup implements Serializable {
+
+ private static final long serialVersionUID = 1L;
// must be at least one tab.
private List<Tab> tabs = new ArrayList<Tab>(){{
add(new Tab());
}};
+
+
// no wrapper
@XmlElement(name = "tab", required = true)
public List<Tab> getTabs() {
@@ -43,4 +47,25 @@ public class TabGroup {
public void setTabs(List<Tab> tabs) {
this.tabs = tabs;
}
+
+
+
+ private DomainObject owner;
+
+ /**
+ * Owner.
+ *
+ * <p>
+ * Set programmatically by framework after reading in from XML.
+ * </p>
+ */
+ @XmlTransient
+ public DomainObject getOwner() {
+ return owner;
+ }
+
+ public void setOwner(final DomainObject owner) {
+ this.owner = owner;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Util.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Util.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Util.java
new file mode 100644
index 0000000..6007850
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Util.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.layout.v1_0;
+
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+
+class Util {
+
+ private Util(){}
+
+ static <F,T> Predicate<F> is(final Class<T> cls) {
+ return new Predicate<F>() {
+ @Override public boolean apply(@Nullable final F from) {
+ return cls.isAssignableFrom(from.getClass());
+ }
+ };
+ }
+
+ static <F, T extends F> CastFunction<F, T> cast(final Class<T> cls) {
+ return new CastFunction<>();
+ }
+
+ private static class CastFunction<F, T extends F> implements Function<F, T> {
+ @Override
+ public final T apply(final F from) {
+ return (T) from;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
index e0b81d6..ad617e8 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
@@ -58,6 +58,7 @@ import org.apache.isis.core.metamodel.facets.collections.layout.NamedFacetForCol
import org.apache.isis.core.metamodel.facets.collections.layout.PagedFacetForCollectionLayoutXml;
import org.apache.isis.core.metamodel.facets.collections.layout.SortedByFacetForCollectionLayoutXml;
import org.apache.isis.core.metamodel.facets.members.order.annotprop.MemberOrderFacetXml;
+import org.apache.isis.core.metamodel.facets.object.membergroups.MemberGroupLayoutFacet;
import org.apache.isis.core.metamodel.facets.properties.propertylayout.CssClassFacetForPropertyLayoutXml;
import org.apache.isis.core.metamodel.facets.properties.propertylayout.DescribedAsFacetForPropertyLayoutXml;
import org.apache.isis.core.metamodel.facets.properties.propertylayout.HiddenFacetForPropertyLayoutXml;
@@ -106,22 +107,22 @@ public class LayoutXmlFacetDefault
}
- private boolean derivedAndSynced;
+ private boolean derived;
public DomainObject getLayoutMetadata() {
- //return derivedAndSynced ? metadata : deriveAndSync(metadata);
- return deriveAndSync(metadata);
+ //return derived ? metadata : deriveAndOverwrite(metadata);
+ return deriveAndOverwrite(metadata);
}
- private DomainObject deriveAndSync(final DomainObject metadata) {
+ private DomainObject deriveAndOverwrite(final DomainObject metadata) {
synchronized (metadata) {
- doDeriveAndSync(metadata);
- derivedAndSynced = true;
+ doDeriveAndOverwrite(metadata);
+ derived = true;
}
return metadata;
}
- private void doDeriveAndSync(final DomainObject metadata) {
+ private void doDeriveAndOverwrite(final DomainObject metadata) {
final ObjectSpecification objectSpec = (ObjectSpecification) getFacetHolder();
final Map<String, OneToOneAssociation> oneToOneAssociationById =
@@ -132,11 +133,17 @@ public class LayoutXmlFacetDefault
ObjectMember.Util.mapById(objectSpec.getObjectActions(Contributed.INCLUDED));
derive(metadata, oneToOneAssociationById, oneToManyAssociationById, objectActionById);
-
- sync(metadata, oneToOneAssociationById, oneToManyAssociationById, objectActionById);
+ overwrite(metadata, oneToOneAssociationById, oneToManyAssociationById, objectActionById);
}
- private void derive(
+ /**
+ * Ensures that all object members (properties, collections and actions) are in the metadata.
+ *
+ * <p>
+ * If they are missing then they will be added to default tabs (created on the fly if need be).
+ * </p>
+ */
+ private static void derive(
final DomainObject metadata,
final Map<String, OneToOneAssociation> oneToOneAssociationById,
final Map<String, OneToManyAssociation> oneToManyAssociationById,
@@ -144,10 +151,11 @@ public class LayoutXmlFacetDefault
final List<String> propertyIds = Lists.newArrayList();
final List<String> collectionIds = Lists.newArrayList();
final List<String> actionIds = Lists.newArrayList();
- final AtomicReference<PropertyGroup> generalPropertyGroupRef = new AtomicReference<>();
+ final AtomicReference<PropertyGroup> defaultPropertyGroupRef = new AtomicReference<>();
final AtomicReference<Column> firstColumnRef = new AtomicReference<>();
final AtomicReference<TabGroup> lastTabGroupRef = new AtomicReference<>();
+ // catalog which property, collection and action Ids appear (anywhere) in the metadata
metadata.visit(new DomainObject.VisitorAdapter() {
@Override
public void visit(final Property property) {
@@ -158,17 +166,22 @@ public class LayoutXmlFacetDefault
collectionIds.add(collection.getId());
}
@Override
- public void visit(final Action action, final ActionHolder holder) {
+ public void visit(final Action action) {
actionIds.add(action.getId());
}
+ });
+
+ // capture the first column, and also
+ // capture the first property group (if any) with the default name ('General')
+ metadata.visit(new DomainObject.VisitorAdapter() {
@Override
public void visit(final Column column) {
firstColumnRef.compareAndSet(null, column);
}
@Override
public void visit(final PropertyGroup propertyGroup) {
- if(propertyGroup.getName().equals("General")) {
- generalPropertyGroupRef.compareAndSet(null, propertyGroup);
+ if(MemberGroupLayoutFacet.DEFAULT_GROUP.equals(propertyGroup.getName())) {
+ defaultPropertyGroupRef.compareAndSet(null, propertyGroup);
}
}
@Override
@@ -178,20 +191,21 @@ public class LayoutXmlFacetDefault
});
// any missing properties will be added to the (first) 'General' property group found
- // if there is no 'General' property group then one will be added to the first Column of the first Tab.
+ // if there is no default ('General') property group
+ // then one will be added to the first Column of the first Tab.
final List<String> missingPropertyIds = Lists.newArrayList(oneToOneAssociationById.keySet());
missingPropertyIds.removeAll(propertyIds);
if(!missingPropertyIds.isEmpty()) {
// ensure that there is a property group to use
- boolean wasSet = generalPropertyGroupRef.compareAndSet(null, new PropertyGroup("General"));
- final PropertyGroup generalPropertyGroup = generalPropertyGroupRef.get();
+ boolean wasSet = defaultPropertyGroupRef.compareAndSet(null, new PropertyGroup(MemberGroupLayoutFacet.DEFAULT_GROUP));
+ final PropertyGroup defaultPropertyGroup = defaultPropertyGroupRef.get();
if(wasSet) {
- firstColumnRef.get().getContent().add(generalPropertyGroup);
+ firstColumnRef.get().getContent().add(defaultPropertyGroup);
}
Iterables.removeAll(propertyIds, oneToOneAssociationById.keySet());
for (final String propertyId : missingPropertyIds) {
- generalPropertyGroup.getProperties().add(new Property(propertyId));
+ defaultPropertyGroup.getProperties().add(new Property(propertyId));
}
}
@@ -227,21 +241,22 @@ public class LayoutXmlFacetDefault
}
}
- private void sync(
+ private void overwrite(
final DomainObject metadata,
final Map<String, OneToOneAssociation> oneToOneAssociationById,
final Map<String, OneToManyAssociation> oneToManyAssociationById,
final Map<String, ObjectAction> objectActionById) {
metadata.visit(new DomainObject.VisitorAdapter() {
- private int domainObjectSequence = 1;
- private int propertyGroupSequence = 1;
- private int propertySequence = 1;
- private int collectionSequence = 1;
- private Map<Action, ActionHolder> actionHolderByAction = Maps.newHashMap();
+ private final Map<String, int[]> propertySequenceByGroup = Maps.newHashMap();
+ private int actionDomainObjectSequence = 1;
+ private int actionPropertyGroupSequence = 1;
+ private int actionPropertySequence = 1;
+ private int actionCollectionSequence = 1;
+
@Override
- public void visit(final Action action, final ActionHolder actionHolder) {
- actionHolderByAction.put(action, actionHolder);
+ public void visit(final Action action) {
+ final ActionHolder actionHolder = action.getOwner();
final ObjectAction objectAction = objectActionById.get(action.getId());
final String memberOrderName;
final int memberOrderSequence;
@@ -250,51 +265,48 @@ public class LayoutXmlFacetDefault
final List<Property> properties = propertyGroup.getProperties();
final Property property = properties.get(0); // any will do
memberOrderName = property.getId();
- memberOrderSequence = propertyGroupSequence++;
+ memberOrderSequence = actionPropertyGroupSequence++;
} else if(actionHolder instanceof Property) {
final Property property = (Property) actionHolder;
memberOrderName = property.getId();
- memberOrderSequence = propertySequence++;
+ memberOrderSequence = actionPropertySequence++;
} else if(actionHolder instanceof Collection) {
final Collection collection = (Collection) actionHolder;
memberOrderName = collection.getId();
- memberOrderSequence = collectionSequence++;
+ memberOrderSequence = actionCollectionSequence++;
} else {
// DomainObject
memberOrderName = null;
- memberOrderSequence = domainObjectSequence++;
+ memberOrderSequence = actionDomainObjectSequence++;
}
FacetUtil.addFacet(
new MemberOrderFacetXml(memberOrderName, ""+memberOrderSequence, translationService, objectAction));
}
+
@Override
- public void visit(final ActionLayout actionLayout, final Action action) {
- final ObjectAction objectAction = objectActionById.get(action.getId());
- final ActionHolder actionHolder = actionHolderByAction.get(action);
+ public void visit(final ActionLayout actionLayout) {
+ final Action action = actionLayout.getOwner();
+ final ActionHolder actionHolder = action.getOwner();
- final ActionLayout actionLayoutForPosition;
if(actionHolder instanceof PropertyGroup) {
- // ensure that there is a non-null valid ActionLayout#position()
- actionLayoutForPosition = actionLayout != null ? actionLayout : new ActionLayout();
- if( actionLayoutForPosition.getPosition() == null ||
- actionLayoutForPosition.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.BELOW ||
- actionLayoutForPosition.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.RIGHT) {
- actionLayoutForPosition.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.PANEL);
+ if(actionLayout.getPosition() == null ||
+ actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.BELOW ||
+ actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.RIGHT) {
+ actionLayout.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.PANEL);
}
} else if(actionHolder instanceof Property) {
- // ensure that there is a non-null valid ActionLayout#position()
- actionLayoutForPosition = actionLayout != null ? actionLayout : new ActionLayout();
- if( actionLayoutForPosition.getPosition() == null ||
- actionLayoutForPosition.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL_DROPDOWN ||
- actionLayoutForPosition.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL) {
- actionLayoutForPosition.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.BELOW);
+ if(actionLayout.getPosition() == null ||
+ actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL_DROPDOWN ||
+ actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL) {
+ actionLayout.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.BELOW);
}
} else {
// doesn't do anything for DomainObject or Collection
- actionLayoutForPosition = null;
+ actionLayout.setPosition(null);
}
- FacetUtil.addFacet(ActionPositionFacetForActionLayoutXml.create(actionLayoutForPosition, objectAction));
+ final ObjectAction objectAction = objectActionById.get(action.getId());
+ FacetUtil.addFacet(ActionPositionFacetForActionLayoutXml.create(actionLayout, objectAction));
FacetUtil.addFacet(BookmarkPolicyFacetForActionLayoutXml.create(actionLayout, objectAction));
FacetUtil.addFacet(CssClassFacetForActionLayoutXml.create(actionLayout, objectAction));
FacetUtil.addFacet(CssClassFaFacetForActionLayoutXml.create(actionLayout, objectAction));
@@ -302,8 +314,11 @@ public class LayoutXmlFacetDefault
FacetUtil.addFacet(HiddenFacetForActionLayoutXml.create(actionLayout, objectAction));
FacetUtil.addFacet(NamedFacetForActionLayoutXml.create(actionLayout, objectAction));
}
+
@Override
- public void visit(final PropertyLayout propertyLayout, final Property property) {
+ public void visit(final PropertyLayout propertyLayout) {
+ final Property property = propertyLayout.getOwner();
+
final OneToOneAssociation oneToOneAssociation = oneToOneAssociationById.get(property.getId());
FacetUtil.addFacet(CssClassFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
FacetUtil.addFacet(DescribedAsFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
@@ -313,10 +328,20 @@ public class LayoutXmlFacetDefault
FacetUtil.addFacet(NamedFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
FacetUtil.addFacet(RenderedAdjustedFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
FacetUtil.addFacet(TypicalLengthFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
+
+ // @MemberOrder#name based on owning property group, @MemberOrder#sequence monotonically increasing
+ final PropertyGroup propertyGroup = property.getOwner();
+ final String groupName = propertyGroup.getName();
+ final String sequence = nextInSequenceFor(groupName);
+ FacetUtil.addFacet(
+ new MemberOrderFacetXml(groupName, sequence, translationService, oneToOneAssociation));
}
+
@Override
- public void visit(final CollectionLayout collectionLayout, final Collection collection) {
+ public void visit(final CollectionLayout collectionLayout) {
+ final Collection collection = collectionLayout.getOwner();
final OneToManyAssociation oneToManyAssociation = oneToManyAssociationById.get(collection.getId());
+
FacetUtil.addFacet(CssClassFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
FacetUtil.addFacet(DefaultViewFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
FacetUtil.addFacet(DescribedAsFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
@@ -324,17 +349,34 @@ public class LayoutXmlFacetDefault
FacetUtil.addFacet(NamedFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
FacetUtil.addFacet(PagedFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
FacetUtil.addFacet(SortedByFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
+
+ // copy the collection name onto the tab
+ final Column column = collection.getOwner();
+ final Tab tab = column.getOwner();
+ tab.setName(collection.getId());
+ }
+
+ private String nextInSequenceFor(final String propertyGroupName) {
+ synchronized (propertySequenceByGroup) {
+ int[] holder = propertySequenceByGroup.get(propertyGroupName);
+ if(holder == null) {
+ holder = new int[]{0};
+ propertySequenceByGroup.put(propertyGroupName, holder);
+ }
+ holder[0]++;
+ return ""+holder[0];
+ }
}
});
}
- private List<OneToOneAssociation> getOneToOneAssociations(final ObjectSpecification objectSpec) {
+ private static List<OneToOneAssociation> getOneToOneAssociations(final ObjectSpecification objectSpec) {
List associations = objectSpec
.getAssociations(Contributed.INCLUDED, ObjectAssociation.Filters.PROPERTIES);
return associations;
}
- private List<OneToManyAssociation> getOneToManyAssociations(final ObjectSpecification objectSpec) {
+ private static List<OneToManyAssociation> getOneToManyAssociations(final ObjectSpecification objectSpec) {
List associations = objectSpec
.getAssociations(Contributed.INCLUDED, ObjectAssociation.Filters.COLLECTIONS);
return associations;
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecifications.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecifications.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecifications.java
index 9a7cc67..7fee60b 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecifications.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectSpecifications.java
@@ -26,6 +26,8 @@ import java.util.Set;
import com.google.common.collect.Lists;
import org.apache.isis.applib.annotation.MemberGroupLayout.ColumnSpans;
+import org.apache.isis.applib.layout.v1_0.Column;
+import org.apache.isis.applib.layout.v1_0.Tab;
import org.apache.isis.core.metamodel.facets.object.membergroups.MemberGroupLayoutFacet;
@@ -43,11 +45,22 @@ public final class ObjectSpecifications {
if(this == LEFT) return columnSpans.getLeft();
if(this == MIDDLE) return columnSpans.getMiddle();
if(this == RIGHT) return columnSpans.getRight();
- return 0;
+ throw new IllegalStateException();
+ }
+
+ public Column from(final Tab tab) {
+ if(this == LEFT) {return tab.getLeft();}
+ if(this == MIDDLE) return tab.getMiddle();
+ if(this == RIGHT) return tab.getRight();
+ throw new IllegalStateException();
}
}
- public static List<String> orderByMemberGroups(ObjectSpecification objSpec, Set<String> groupNamesToOrder, MemberGroupLayoutHint memberGroupLayoutHint) {
+ public static List<String> orderByMemberGroups(
+ final ObjectSpecification objSpec,
+ final Set<String> groupNamesToOrder,
+ final MemberGroupLayoutHint memberGroupLayoutHint) {
+
final MemberGroupLayoutFacet facet = objSpec.getFacet(MemberGroupLayoutFacet.class);
final List<String> leftColumnGroupNames = Lists.newArrayList(groupNamesToOrder);
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
index 5e74780..8837916 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
@@ -36,6 +36,7 @@ import org.apache.isis.core.metamodel.consent.Consent;
import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
import org.apache.isis.core.metamodel.facets.members.order.MemberOrderFacet;
+import org.apache.isis.core.metamodel.facets.object.membergroups.MemberGroupLayoutFacet;
import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
import org.apache.isis.core.metamodel.specloader.specimpl.ContributeeMember;
@@ -418,7 +419,7 @@ public interface ObjectAssociation extends ObjectMember, CurrentHolder {
return;
}
}
- getFrom(associationsByGroup, "General").add(association);
+ getFrom(associationsByGroup, MemberGroupLayoutFacet.DEFAULT_GROUP).add(association);
}
private static List<ObjectAssociation> getFrom(Map<String, List<ObjectAssociation>> associationsByGroup, final String groupName) {
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
index 75b0e71..befd252 100644
--- a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
+++ b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
@@ -46,7 +46,7 @@ import org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconAn
import org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconTitleAndCopyLinkPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.properties.EntityPropertiesPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.selector.links.EntityLinksSelectorPanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.entity.tabbed.EntityTabbedPanelFactory;
+import org.apache.isis.viewer.wicket.ui.components.entity.tabgroups.EntityTabGroupsPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.footer.FooterPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.header.HeaderPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.scalars.isisapplib.IsisBlobPanelFactory;
@@ -167,7 +167,7 @@ public class ComponentFactoryRegistrarDefault implements ComponentFactoryRegistr
protected void addComponentFactoriesForEntity(final ComponentFactoryList componentFactories) {
// top-level
- componentFactories.add(new EntityTabbedPanelFactory());
+ componentFactories.add(new EntityTabGroupsPanelFactory());
componentFactories.add(new EntityCombinedPanelFactory());
// lower-level
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
index fde03d7..97ef07c 100644
--- a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
+++ b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
@@ -29,6 +29,7 @@ import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.layout.v1_0.Tab;
import org.apache.isis.applib.services.memento.MementoService.Memento;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
@@ -633,9 +634,23 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> {
// //////////////////////////////////////////////////////////
+ // tab (if any)
+ // //////////////////////////////////////////////////////////
+
+ private Tab tab;
+
+ public Tab getTab() {
+ return tab;
+ }
+
+ public void setTab(final Tab tab) {
+ this.tab = tab;
+ }
+
+ // //////////////////////////////////////////////////////////
// equals, hashCode
// //////////////////////////////////////////////////////////
-
+
@Override
public int hashCode() {
final int prime = 31;
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
index 2d39517..f46ec4a 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
@@ -38,7 +38,7 @@
</div>
</div>
- <div wicket:id="collection" class="collection panel-body">
+ <div wicket:id="owner" class="collection panel-body">
[collection]
</div>
</div>
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
index 1f7f638..8339981 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
@@ -21,6 +21,10 @@ package org.apache.isis.viewer.wicket.ui.components.entity.properties;
import java.util.List;
import java.util.Map;
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.wicket.Component;
@@ -49,6 +53,9 @@ import org.apache.isis.applib.annotation.MemberGroupLayout.ColumnSpans;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.filter.Filter;
import org.apache.isis.applib.filter.Filters;
+import org.apache.isis.applib.layout.v1_0.Column;
+import org.apache.isis.applib.layout.v1_0.PropertyGroup;
+import org.apache.isis.applib.layout.v1_0.Tab;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizer;
import org.apache.isis.applib.services.exceprecog.ExceptionRecognizerComposite;
import org.apache.isis.core.commons.authentication.MessageBroker;
@@ -147,9 +154,17 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
private void buildGui() {
final EntityModel entityModel = (EntityModel) getModel();
- MemberGroupLayoutFacet memberGroupLayoutFacet =
- entityModel.getObject().getSpecification().getFacet(MemberGroupLayoutFacet.class);
- final ColumnSpans columnSpans = memberGroupLayoutFacet.getColumnSpans();
+
+ final Tab tabIfAny = entityModel.getTab();
+
+ final ColumnSpans columnSpans;
+ if(tabIfAny != null) {
+ columnSpans = ColumnSpans.asSpans(tabIfAny.getLeft().getSpan(), tabIfAny.getMiddle().getSpan(), tabIfAny.getRight().getSpan());
+ } else {
+ final MemberGroupLayoutFacet memberGroupLayoutFacet =
+ entityModel.getObject().getSpecification().getFacet(MemberGroupLayoutFacet.class);
+ columnSpans = memberGroupLayoutFacet.getColumnSpans();
+ }
renderedFirstField = false;
@@ -159,7 +174,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
boolean addedProperties;
if(columnSpans.getLeft() > 0) {
- addedProperties = addPropertiesInColumn(leftColumn, MemberGroupLayoutHint.LEFT, columnSpans);
+ addedProperties = addPropertiesInColumn(leftColumn, MemberGroupLayoutHint.LEFT, tabIfAny, columnSpans);
addButtons(leftColumn);
addFeedbackGui(leftColumn);
} else {
@@ -177,7 +192,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
if(columnSpans.getMiddle() > 0) {
MarkupContainer middleColumn = new WebMarkupContainer(ID_MIDDLE_COLUMN);
add(middleColumn);
- addPropertiesInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, columnSpans);
+ addPropertiesInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, tabIfAny, columnSpans);
} else {
Components.permanentlyHide(this, ID_MIDDLE_COLUMN);
}
@@ -186,7 +201,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
if(columnSpans.getRight() > 0) {
MarkupContainer rightColumn = new WebMarkupContainer(ID_RIGHT_COLUMN);
add(rightColumn);
- addPropertiesInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, columnSpans);
+ addPropertiesInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, tabIfAny, columnSpans);
} else {
Components.permanentlyHide(this, ID_RIGHT_COLUMN);
}
@@ -220,6 +235,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
private boolean addPropertiesInColumn(
final MarkupContainer markupContainer,
final MemberGroupLayoutHint hint,
+ final Tab tabIfAny,
final ColumnSpans columnSpans) {
final int span = hint.from(columnSpans);
@@ -234,10 +250,15 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
final Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociation.Util.groupByMemberOrderName(associations);
- final List<String> groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet(), hint);
-
+ final List<String> groupNames;
+ if(tabIfAny != null) {
+ final Column column = hint.from(tabIfAny);
+ groupNames = Lists.newArrayList(Iterables.transform(column.getPropertyGroups(), propertyGroupName()));
+ } else {
+ groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet(), hint);
+ }
- for(String groupName: groupNames) {
+ for(final String groupName: groupNames) {
final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
if(associationsInGroup==null) {
continue;
@@ -278,6 +299,15 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
return !groupNames.isEmpty();
}
+ private static Function<? super PropertyGroup, String> propertyGroupName() {
+ return new Function<PropertyGroup, String>() {
+ @Nullable @Override
+ public String apply(@Nullable final PropertyGroup propertyGroup) {
+ return propertyGroup.getName();
+ }
+ };
+ }
+
private void addPropertyToForm(
final EntityModel entityModel,
final OneToOneAssociation otoa,
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
index e65c157..afff1d6 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
@@ -36,7 +36,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="property" class="property">[property]</div>
+ <div wicket:id="owner" class="property">[property]</div>
</div>
</div>
</div>
@@ -64,7 +64,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="property" class="property">[property]</div>
+ <div wicket:id="owner" class="property">[property]</div>
</div>
</div>
</div>
@@ -84,7 +84,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="property" class="property">[property]</div>
+ <div wicket:id="owner" class="property">[property]</div>
</div>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel$EntityTabPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel$EntityTabPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel$EntityTabPanel.html
deleted file mode 100644
index 94582b1..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel$EntityTabPanel.html
+++ /dev/null
@@ -1,29 +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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div class="tabPanel">
- <div wicket:id="entityPropertiesAndCollections"></div>
-
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
deleted file mode 100644
index 999a22e..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.html
+++ /dev/null
@@ -1,31 +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.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div class="entityTabbed">
- <div wicket:id="entitySummary"></div>
-
- <div wicket:id="tabs">[tabbed panel will be here]</div>
-
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
deleted file mode 100644
index c1c65ba..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanel.java
+++ /dev/null
@@ -1,114 +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.components.entity.tabbed;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
-import org.apache.wicket.extensions.markup.html.tabs.ITab;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.Model;
-
-import org.apache.isis.applib.layout.v1_0.DomainObject;
-import org.apache.isis.applib.layout.v1_0.Tab;
-import org.apache.isis.applib.layout.v1_0.TabGroup;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
-import org.apache.isis.core.metamodel.facets.object.layoutxml.LayoutXmlFacet;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
-
-/**
- * {@link PanelAbstract Panel} to represent an entity on a single page made up
- * of several <div> regions.
- */
-public class EntityTabbedPanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_ENTITY_PROPERTIES_AND_COLLECTIONS = "entityPropertiesAndCollections";
-
-
- public EntityTabbedPanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
- buildGui();
- }
-
- private void buildGui() {
- final EntityModel model = getModel();
- final ObjectAdapter objectAdapter = model.getObject();
- final CssClassFacet facet = objectAdapter.getSpecification().getFacet(CssClassFacet.class);
- if(facet != null) {
- final String cssClass = facet.cssClass(objectAdapter);
- CssClassAppender.appendCssClassTo(this, cssClass);
- }
-
- // forces metadata to be derived && synced
- final LayoutXmlFacet layoutXmlFacet = model.getTypeOfSpecification().getFacet(LayoutXmlFacet.class);
- final DomainObject domainObject = layoutXmlFacet.getLayoutMetadata();
-
-
- addOrReplace(ComponentType.ENTITY_SUMMARY, model);
-
-
- List<TabGroup> tabGroups = domainObject.getTabGroups();
- TabGroup tabGroup = tabGroups.get(0);
-
- List<ITab> tabs = Lists.newArrayList();
- List<Tab> tabList = tabGroup.getTabs();
-
- for (Tab tab : tabList) {
-
- tabs.add(new AbstractTab(Model.of(tab.getName())) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public Panel getPanel(String panelId) {
- return new EntityTabPanel(panelId, getModel());
- }
-
- });
-
- }
-
-
- addOrReplace(new AjaxBootstrapTabbedPanel("tabs", tabs));
-
- }
-
- private static class EntityTabPanel extends PanelAbstract {
- private static final long serialVersionUID = 1L;
-
- public EntityTabPanel(String id, final EntityModel model) {
- super(id);
- getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_PROPERTIES_AND_COLLECTIONS, ComponentType.ENTITY_PROPERTIES, model);
-
- }
-
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java
deleted file mode 100644
index 04c3496..0000000
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabbed/EntityTabbedPanelFactory.java
+++ /dev/null
@@ -1,56 +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.components.entity.tabbed;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-
-import org.apache.isis.core.metamodel.facets.object.layoutxml.LayoutXmlFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
-
-/**
- * {@link ComponentFactory} for {@link EntityTabbedPanel}.
- */
-public class EntityTabbedPanelFactory extends EntityComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- private static final String NAME = "tabbed";
-
- public EntityTabbedPanelFactory() {
- super(ComponentType.ENTITY, NAME, EntityTabbedPanel.class);
- }
-
- @Override
- protected ApplicationAdvice doAppliesTo(final EntityModel entityModel) {
- final ObjectSpecification specification = entityModel.getTypeOfSpecification();
- return appliesIf(specification.containsDoOpFacet(LayoutXmlFacet.class));
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityModel entityModel = (EntityModel) model;
- return new EntityTabbedPanel(id, entityModel);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel$EntityTabPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel$EntityTabPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel$EntityTabPanel.html
new file mode 100644
index 0000000..94582b1
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel$EntityTabPanel.html
@@ -0,0 +1,29 @@
+<?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.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<body>
+<wicket:panel>
+ <div class="tabPanel">
+ <div wicket:id="entityPropertiesAndCollections"></div>
+
+ </div>
+</wicket:panel>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/165202f6/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.html
new file mode 100644
index 0000000..ebe6c63
--- /dev/null
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.html
@@ -0,0 +1,33 @@
+<?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.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<body>
+<wicket:panel>
+ <div class="entityTabbed">
+ <div wicket:id="entitySummary"></div>
+
+ <div wicket:id="tabGroups">
+ <div wicket:id="tabGroup">[tabbed panel will be here]</div>
+ </div>
+
+ </div>
+</wicket:panel>
+</body>
+</html>
[3/6] isis git commit: ISIS-993: simplifying the metadata. the wicket
components still broken at this point
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
index bb468a5..2abd6be 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
@@ -8,11 +8,10 @@
<left span="4">
<propertyGroup name="General">
<actions/>
- <property id="name">
+ <property id="name" labelPosition="TOP">
<actions>
<action id="updateName"/>
</actions>
- <layout/>
</property>
</propertyGroup>
</left>
@@ -23,10 +22,7 @@
<actions>
<action id="downloadJdoMetadata"/>
</actions>
- <property id="versionSequence">
- <actions/>
- <layout labelPosition="TOP" multiLine="5" cssClass="abcde"/>
- </property>
+ <property id="versionSequence"/>
</propertyGroup>
</left>
</tab>
@@ -34,10 +30,7 @@
<tabGroup>
<tab name="Similar To">
<left span="12">
- <collection id="similarTo">
- <actions/>
- <layout/>
- </collection>
+ <collection id="similarTo"/>
</left>
</tab>
</tabGroup>
[4/6] isis git commit: ISIS-993: simplifying the metadata. the wicket
components still broken at this point
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionLayoutXml.java
deleted file mode 100644
index 10241a1..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
-
-public class DescribedAsFacetForCollectionLayoutXml extends DescribedAsFacetAbstract {
-
- public static DescribedAsFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if(collectionLayout == null) {
- return null;
- }
- final String describedAs = Strings.emptyToNull(collectionLayout.getDescribedAs());
- return describedAs != null ? new DescribedAsFacetForCollectionLayoutXml(describedAs, holder) : null;
- }
-
- private DescribedAsFacetForCollectionLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionXml.java
new file mode 100644
index 0000000..a159fc2
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DescribedAsFacetForCollectionXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetForCollectionXml extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(Collection collectionLayout, FacetHolder holder) {
+ if(collectionLayout == null) {
+ return null;
+ }
+ final String describedAs = Strings.emptyToNull(collectionLayout.getDescribedAs());
+ return describedAs != null ? new DescribedAsFacetForCollectionXml(describedAs, holder) : null;
+ }
+
+ private DescribedAsFacetForCollectionXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionLayoutXml.java
deleted file mode 100644
index f362634..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,52 +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.core.metamodel.facets.collections.layout;
-
-import org.apache.isis.applib.annotation.When;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
-import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
-
-public class HiddenFacetForCollectionLayoutXml extends HiddenFacetAbstract {
-
- public static HiddenFacet create(final CollectionLayout collectionLayout, final FacetHolder holder) {
- if (collectionLayout == null) {
- return null;
- }
- final Where where = collectionLayout.getHidden();
- return where != null && where != Where.NOT_SPECIFIED ? new HiddenFacetForCollectionLayoutXml(where, holder) : null;
- }
-
- private HiddenFacetForCollectionLayoutXml(final Where where, final FacetHolder holder) {
- super(When.ALWAYS, where, holder);
- }
-
- @Override
- public String hiddenReason(final ObjectAdapter targetAdapter, final Where whereContext) {
- if(!where().includes(whereContext)) {
- return null;
- }
- return "Hidden on " + where().getFriendlyName();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionXml.java
new file mode 100644
index 0000000..8a52c8e
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/HiddenFacetForCollectionXml.java
@@ -0,0 +1,52 @@
+/*
+ * 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.core.metamodel.facets.collections.layout;
+
+import org.apache.isis.applib.annotation.When;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
+
+public class HiddenFacetForCollectionXml extends HiddenFacetAbstract {
+
+ public static HiddenFacet create(final Collection collectionLayout, final FacetHolder holder) {
+ if (collectionLayout == null) {
+ return null;
+ }
+ final Where where = collectionLayout.getHidden();
+ return where != null && where != Where.NOT_SPECIFIED ? new HiddenFacetForCollectionXml(where, holder) : null;
+ }
+
+ private HiddenFacetForCollectionXml(final Where where, final FacetHolder holder) {
+ super(When.ALWAYS, where, holder);
+ }
+
+ @Override
+ public String hiddenReason(final ObjectAdapter targetAdapter, final Where whereContext) {
+ if(!where().includes(whereContext)) {
+ return null;
+ }
+ return "Hidden on " + where().getFriendlyName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionLayoutXml.java
deleted file mode 100644
index e9828d7..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,48 +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.core.metamodel.facets.collections.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
-
-public class NamedFacetForCollectionLayoutXml extends NamedFacetAbstract {
-
- public static NamedFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if(collectionLayout == null) {
- return null;
- }
- final String named = Strings.emptyToNull(collectionLayout.getNamed());
- final Boolean escaped = collectionLayout.getNamedEscaped();
- return named != null ? new NamedFacetForCollectionLayoutXml(named, escaped == null || escaped, holder) : null;
- }
-
- private NamedFacetForCollectionLayoutXml(
- final String value,
- final boolean escaped,
- final FacetHolder holder) {
-
- super(value, escaped, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionXml.java
new file mode 100644
index 0000000..295cbc9
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/NamedFacetForCollectionXml.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetForCollectionXml extends NamedFacetAbstract {
+
+ public static NamedFacet create(Collection collectionLayout, FacetHolder holder) {
+ if(collectionLayout == null) {
+ return null;
+ }
+ final String named = Strings.emptyToNull(collectionLayout.getNamed());
+ final Boolean escaped = collectionLayout.getNamedEscaped();
+ return named != null ? new NamedFacetForCollectionXml(named, escaped == null || escaped, holder) : null;
+ }
+
+ private NamedFacetForCollectionXml(
+ final String value,
+ final boolean escaped,
+ final FacetHolder holder) {
+
+ super(value, escaped, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionLayoutXml.java
deleted file mode 100644
index f14abb1..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.layout;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.paged.PagedFacet;
-import org.apache.isis.core.metamodel.facets.object.paged.PagedFacetAbstract;
-
-public class PagedFacetForCollectionLayoutXml extends PagedFacetAbstract {
-
- public static PagedFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if(collectionLayout == null) {
- return null;
- }
- final Integer paged = collectionLayout.getPaged();
- return paged != null && paged != -1 ? new PagedFacetForCollectionLayoutXml(paged, holder) : null;
- }
-
- private PagedFacetForCollectionLayoutXml(int paged, FacetHolder holder) {
- super(paged, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionXml.java
new file mode 100644
index 0000000..eee8838
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/PagedFacetForCollectionXml.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.layout;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.paged.PagedFacet;
+import org.apache.isis.core.metamodel.facets.object.paged.PagedFacetAbstract;
+
+public class PagedFacetForCollectionXml extends PagedFacetAbstract {
+
+ public static PagedFacet create(Collection collectionLayout, FacetHolder holder) {
+ if(collectionLayout == null) {
+ return null;
+ }
+ final Integer paged = collectionLayout.getPaged();
+ return paged != null && paged != -1 ? new PagedFacetForCollectionXml(paged, holder) : null;
+ }
+
+ private PagedFacetForCollectionXml(int paged, FacetHolder holder) {
+ super(paged, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionLayoutXml.java
deleted file mode 100644
index 2030e45..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,52 +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.core.metamodel.facets.collections.layout;
-
-import java.util.Comparator;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.commons.lang.ClassUtil;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.collections.sortedby.SortedByFacet;
-import org.apache.isis.core.metamodel.facets.collections.sortedby.SortedByFacetAbstract;
-
-public class SortedByFacetForCollectionLayoutXml extends SortedByFacetAbstract {
-
- public static SortedByFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if(collectionLayout == null) {
- return null;
- }
- final String sortedBy = collectionLayout.getSortedBy();
- if (sortedBy == null) {
- return null;
- }
- final Class sortedByClass = ClassUtil.forName(sortedBy);
- if(sortedByClass == Comparator.class) {
- return null;
- }
-
- return sortedByClass != null ? new SortedByFacetForCollectionLayoutXml(sortedByClass, holder) : null;
- }
-
- private SortedByFacetForCollectionLayoutXml(Class<? extends Comparator<?>> sortedBy, FacetHolder holder) {
- super(sortedBy, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionXml.java
new file mode 100644
index 0000000..dbba9dd
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/SortedByFacetForCollectionXml.java
@@ -0,0 +1,52 @@
+/*
+ * 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.core.metamodel.facets.collections.layout;
+
+import java.util.Comparator;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.commons.lang.ClassUtil;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.collections.sortedby.SortedByFacet;
+import org.apache.isis.core.metamodel.facets.collections.sortedby.SortedByFacetAbstract;
+
+public class SortedByFacetForCollectionXml extends SortedByFacetAbstract {
+
+ public static SortedByFacet create(Collection collectionLayout, FacetHolder holder) {
+ if(collectionLayout == null) {
+ return null;
+ }
+ final String sortedBy = collectionLayout.getSortedBy();
+ if (sortedBy == null) {
+ return null;
+ }
+ final Class sortedByClass = ClassUtil.forName(sortedBy);
+ if(sortedByClass == Comparator.class) {
+ return null;
+ }
+
+ return sortedByClass != null ? new SortedByFacetForCollectionXml(sortedByClass, holder) : null;
+ }
+
+ private SortedByFacetForCollectionXml(Class<? extends Comparator<?>> sortedBy, FacetHolder holder) {
+ super(sortedBy, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
index ad617e8..ca42fa6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
@@ -28,14 +28,11 @@ import com.google.common.collect.Maps;
import org.apache.isis.applib.layout.v1_0.Action;
import org.apache.isis.applib.layout.v1_0.ActionHolder;
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
import org.apache.isis.applib.layout.v1_0.Collection;
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
import org.apache.isis.applib.layout.v1_0.Column;
import org.apache.isis.applib.layout.v1_0.DomainObject;
import org.apache.isis.applib.layout.v1_0.Property;
import org.apache.isis.applib.layout.v1_0.PropertyGroup;
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
import org.apache.isis.applib.layout.v1_0.Tab;
import org.apache.isis.applib.layout.v1_0.TabGroup;
import org.apache.isis.applib.services.i18n.TranslationService;
@@ -43,30 +40,30 @@ import org.apache.isis.core.metamodel.facetapi.Facet;
import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facets.actions.layout.ActionPositionFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.actions.layout.BookmarkPolicyFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.actions.layout.CssClassFaFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.actions.layout.CssClassFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.actions.layout.DescribedAsFacetForActionLayoutXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.ActionPositionFacetForActionXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.BookmarkPolicyFacetForActionXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.CssClassFaFacetForActionXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.CssClassFacetForActionXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.DescribedAsFacetForActionXml;
import org.apache.isis.core.metamodel.facets.actions.layout.HiddenFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.actions.layout.NamedFacetForActionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.CssClassFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.DefaultViewFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.DescribedAsFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.HiddenFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.NamedFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.PagedFacetForCollectionLayoutXml;
-import org.apache.isis.core.metamodel.facets.collections.layout.SortedByFacetForCollectionLayoutXml;
+import org.apache.isis.core.metamodel.facets.actions.layout.NamedFacetForActionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.CssClassFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.DefaultViewFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.DescribedAsFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.HiddenFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.NamedFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.PagedFacetForCollectionXml;
+import org.apache.isis.core.metamodel.facets.collections.layout.SortedByFacetForCollectionXml;
import org.apache.isis.core.metamodel.facets.members.order.annotprop.MemberOrderFacetXml;
import org.apache.isis.core.metamodel.facets.object.membergroups.MemberGroupLayoutFacet;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.CssClassFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.DescribedAsFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.HiddenFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.LabelAtFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.MultiLineFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.NamedFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.RenderedAdjustedFacetForPropertyLayoutXml;
-import org.apache.isis.core.metamodel.facets.properties.propertylayout.TypicalLengthFacetForPropertyLayoutXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.CssClassFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.DescribedAsFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.HiddenFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.LabelAtFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.MultiLineFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.NamedFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.RenderedAdjustedFacetForPropertyXml;
+import org.apache.isis.core.metamodel.facets.properties.propertylayout.TypicalLengthFacetForPropertyXml;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.feature.Contributed;
import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
@@ -281,53 +278,46 @@ public class LayoutXmlFacetDefault
}
FacetUtil.addFacet(
new MemberOrderFacetXml(memberOrderName, ""+memberOrderSequence, translationService, objectAction));
- }
- @Override
- public void visit(final ActionLayout actionLayout) {
- final Action action = actionLayout.getOwner();
- final ActionHolder actionHolder = action.getOwner();
if(actionHolder instanceof PropertyGroup) {
- if(actionLayout.getPosition() == null ||
- actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.BELOW ||
- actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.RIGHT) {
- actionLayout.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.PANEL);
+ if(action.getPosition() == null ||
+ action.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.BELOW ||
+ action.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.RIGHT) {
+ action.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.PANEL);
}
} else if(actionHolder instanceof Property) {
- if(actionLayout.getPosition() == null ||
- actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL_DROPDOWN ||
- actionLayout.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL) {
- actionLayout.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.BELOW);
+ if(action.getPosition() == null ||
+ action.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL_DROPDOWN ||
+ action.getPosition() == org.apache.isis.applib.annotation.ActionLayout.Position.PANEL) {
+ action.setPosition(org.apache.isis.applib.annotation.ActionLayout.Position.BELOW);
}
} else {
// doesn't do anything for DomainObject or Collection
- actionLayout.setPosition(null);
+ action.setPosition(null);
}
- final ObjectAction objectAction = objectActionById.get(action.getId());
- FacetUtil.addFacet(ActionPositionFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(BookmarkPolicyFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(CssClassFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(CssClassFaFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(DescribedAsFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(HiddenFacetForActionLayoutXml.create(actionLayout, objectAction));
- FacetUtil.addFacet(NamedFacetForActionLayoutXml.create(actionLayout, objectAction));
+ FacetUtil.addFacet(ActionPositionFacetForActionXml.create(action, objectAction));
+ FacetUtil.addFacet(BookmarkPolicyFacetForActionXml.create(action, objectAction));
+ FacetUtil.addFacet(CssClassFacetForActionXml.create(action, objectAction));
+ FacetUtil.addFacet(CssClassFaFacetForActionXml.create(action, objectAction));
+ FacetUtil.addFacet(DescribedAsFacetForActionXml.create(action, objectAction));
+ FacetUtil.addFacet(HiddenFacetForActionLayoutXml.create(action, objectAction));
+ FacetUtil.addFacet(NamedFacetForActionXml.create(action, objectAction));
}
@Override
- public void visit(final PropertyLayout propertyLayout) {
- final Property property = propertyLayout.getOwner();
+ public void visit(final Property property) {
final OneToOneAssociation oneToOneAssociation = oneToOneAssociationById.get(property.getId());
- FacetUtil.addFacet(CssClassFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(DescribedAsFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(HiddenFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(LabelAtFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(MultiLineFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(NamedFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(RenderedAdjustedFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
- FacetUtil.addFacet(TypicalLengthFacetForPropertyLayoutXml.create(propertyLayout, oneToOneAssociation));
+ FacetUtil.addFacet(CssClassFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(DescribedAsFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(HiddenFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(LabelAtFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(MultiLineFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(NamedFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(RenderedAdjustedFacetForPropertyXml.create(property, oneToOneAssociation));
+ FacetUtil.addFacet(TypicalLengthFacetForPropertyXml.create(property, oneToOneAssociation));
// @MemberOrder#name based on owning property group, @MemberOrder#sequence monotonically increasing
final PropertyGroup propertyGroup = property.getOwner();
@@ -338,17 +328,16 @@ public class LayoutXmlFacetDefault
}
@Override
- public void visit(final CollectionLayout collectionLayout) {
- final Collection collection = collectionLayout.getOwner();
+ public void visit(final Collection collection) {
final OneToManyAssociation oneToManyAssociation = oneToManyAssociationById.get(collection.getId());
- FacetUtil.addFacet(CssClassFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(DefaultViewFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(DescribedAsFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(HiddenFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(NamedFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(PagedFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
- FacetUtil.addFacet(SortedByFacetForCollectionLayoutXml.create(collectionLayout, oneToManyAssociation));
+ FacetUtil.addFacet(CssClassFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(DefaultViewFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(DescribedAsFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(HiddenFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(NamedFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(PagedFacetForCollectionXml.create(collection, oneToManyAssociation));
+ FacetUtil.addFacet(SortedByFacetForCollectionXml.create(collection, oneToManyAssociation));
// copy the collection name onto the tab
final Column column = collection.getOwner();
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyLayoutXml.java
deleted file mode 100644
index fb9bdb8..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.properties.propertylayout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
-
-public class CssClassFacetForPropertyLayoutXml extends CssClassFacetAbstract {
-
- public static CssClassFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final String cssClass = Strings.emptyToNull(propertyLayout.getCssClass());
- return cssClass != null ? new CssClassFacetForPropertyLayoutXml(cssClass, holder) : null;
- }
-
- private CssClassFacetForPropertyLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyXml.java
new file mode 100644
index 0000000..065e80c
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/CssClassFacetForPropertyXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetForPropertyXml extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String cssClass = Strings.emptyToNull(propertyLayout.getCssClass());
+ return cssClass != null ? new CssClassFacetForPropertyXml(cssClass, holder) : null;
+ }
+
+ private CssClassFacetForPropertyXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyLayoutXml.java
deleted file mode 100644
index d36dfa9..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.properties.propertylayout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
-
-public class DescribedAsFacetForPropertyLayoutXml extends DescribedAsFacetAbstract {
-
- public static DescribedAsFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final String describedAs = Strings.emptyToNull(propertyLayout.getDescribedAs());
- return describedAs != null ? new DescribedAsFacetForPropertyLayoutXml(describedAs, holder) : null;
- }
-
- private DescribedAsFacetForPropertyLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyXml.java
new file mode 100644
index 0000000..2c9f6f6
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/DescribedAsFacetForPropertyXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetForPropertyXml extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String describedAs = Strings.emptyToNull(propertyLayout.getDescribedAs());
+ return describedAs != null ? new DescribedAsFacetForPropertyXml(describedAs, holder) : null;
+ }
+
+ private DescribedAsFacetForPropertyXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyLayoutXml.java
deleted file mode 100644
index 7a93898..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,52 +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.core.metamodel.facets.properties.propertylayout;
-
-import org.apache.isis.applib.annotation.When;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
-import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
-
-public class HiddenFacetForPropertyLayoutXml extends HiddenFacetAbstract {
-
- public static HiddenFacet create(final PropertyLayout propertyLayout, final FacetHolder holder) {
- if (propertyLayout == null) {
- return null;
- }
- final Where where = propertyLayout.getHidden();
- return where != null && where != Where.NOT_SPECIFIED ? new HiddenFacetForPropertyLayoutXml(where, holder) : null;
- }
-
- private HiddenFacetForPropertyLayoutXml(final Where where, final FacetHolder holder) {
- super(HiddenFacetForPropertyLayoutXml.class, When.ALWAYS, where, holder);
- }
-
- @Override
- public String hiddenReason(final ObjectAdapter targetAdapter, final Where whereContext) {
- if(!where().includes(whereContext)) {
- return null;
- }
- return "Hidden on " + where().getFriendlyName();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyXml.java
new file mode 100644
index 0000000..4ee7f1d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/HiddenFacetForPropertyXml.java
@@ -0,0 +1,52 @@
+/*
+ * 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.core.metamodel.facets.properties.propertylayout;
+
+import org.apache.isis.applib.annotation.When;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
+
+public class HiddenFacetForPropertyXml extends HiddenFacetAbstract {
+
+ public static HiddenFacet create(final Property propertyLayout, final FacetHolder holder) {
+ if (propertyLayout == null) {
+ return null;
+ }
+ final Where where = propertyLayout.getHidden();
+ return where != null && where != Where.NOT_SPECIFIED ? new HiddenFacetForPropertyXml(where, holder) : null;
+ }
+
+ private HiddenFacetForPropertyXml(final Where where, final FacetHolder holder) {
+ super(HiddenFacetForPropertyXml.class, When.ALWAYS, where, holder);
+ }
+
+ @Override
+ public String hiddenReason(final ObjectAdapter targetAdapter, final Where whereContext) {
+ if(!where().includes(whereContext)) {
+ return null;
+ }
+ return "Hidden on " + where().getFriendlyName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyLayoutXml.java
deleted file mode 100644
index c8a84d0..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,42 +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.core.metamodel.facets.properties.propertylayout;
-
-import org.apache.isis.applib.annotation.LabelPosition;
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacet;
-import org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacetAbstract;
-
-public class LabelAtFacetForPropertyLayoutXml extends LabelAtFacetAbstract {
-
- public static LabelAtFacet create(final PropertyLayout propertyLayout, FacetHolder holder) {
- if (propertyLayout == null) {
- return null;
- }
- final LabelPosition labelPosition = propertyLayout.getLabelPosition();
- return labelPosition != null ? new LabelAtFacetForPropertyLayoutXml(labelPosition, holder) : null;
- }
-
- private LabelAtFacetForPropertyLayoutXml(final LabelPosition value, final FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyXml.java
new file mode 100644
index 0000000..ba512a9
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/LabelAtFacetForPropertyXml.java
@@ -0,0 +1,42 @@
+/*
+ * 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.core.metamodel.facets.properties.propertylayout;
+
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacet;
+import org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacetAbstract;
+
+public class LabelAtFacetForPropertyXml extends LabelAtFacetAbstract {
+
+ public static LabelAtFacet create(final Property propertyLayout, FacetHolder holder) {
+ if (propertyLayout == null) {
+ return null;
+ }
+ final LabelPosition labelPosition = propertyLayout.getLabelPosition();
+ return labelPosition != null ? new LabelAtFacetForPropertyXml(labelPosition, holder) : null;
+ }
+
+ private LabelAtFacetForPropertyXml(final LabelPosition value, final FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyLayoutXml.java
deleted file mode 100644
index 072f287..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.properties.propertylayout;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacet;
-import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacetAbstract;
-
-public class MultiLineFacetForPropertyLayoutXml extends MultiLineFacetAbstract {
-
- public static MultiLineFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final Integer multiLine = propertyLayout.getMultiLine();
- return multiLine != null && multiLine > 1 ? new MultiLineFacetForPropertyLayoutXml(multiLine, false, holder) : null;
- }
-
- private MultiLineFacetForPropertyLayoutXml(int numberOfLines, boolean preventWrapping, FacetHolder holder) {
- super(numberOfLines, preventWrapping, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyXml.java
new file mode 100644
index 0000000..9a48271
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/MultiLineFacetForPropertyXml.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacet;
+import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacetAbstract;
+
+public class MultiLineFacetForPropertyXml extends MultiLineFacetAbstract {
+
+ public static MultiLineFacet create(Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final Integer multiLine = propertyLayout.getMultiLine();
+ return multiLine != null && multiLine > 1 ? new MultiLineFacetForPropertyXml(multiLine, false, holder) : null;
+ }
+
+ private MultiLineFacetForPropertyXml(int numberOfLines, boolean preventWrapping, FacetHolder holder) {
+ super(numberOfLines, preventWrapping, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyLayoutXml.java
deleted file mode 100644
index 0f0e9b7..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,48 +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.core.metamodel.facets.properties.propertylayout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
-
-public class NamedFacetForPropertyLayoutXml extends NamedFacetAbstract {
-
- public static NamedFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final String named = Strings.emptyToNull(propertyLayout.getNamed());
- final Boolean escaped = propertyLayout.getNamedEscaped();
- return named != null ? new NamedFacetForPropertyLayoutXml(named, (escaped == null || escaped), holder) : null;
- }
-
- private NamedFacetForPropertyLayoutXml(
- final String value,
- final boolean escaped,
- final FacetHolder holder) {
-
- super(value, escaped, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyXml.java
new file mode 100644
index 0000000..392a152
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/NamedFacetForPropertyXml.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetForPropertyXml extends NamedFacetAbstract {
+
+ public static NamedFacet create(Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String named = Strings.emptyToNull(propertyLayout.getNamed());
+ final Boolean escaped = propertyLayout.getNamedEscaped();
+ return named != null ? new NamedFacetForPropertyXml(named, (escaped == null || escaped), holder) : null;
+ }
+
+ private NamedFacetForPropertyXml(
+ final String value,
+ final boolean escaped,
+ final FacetHolder holder) {
+
+ super(value, escaped, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyLayoutXml.java
deleted file mode 100644
index 0ceab99..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.properties.propertylayout;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.objectvalue.renderedadjusted.RenderedAdjustedFacet;
-import org.apache.isis.core.metamodel.facets.objectvalue.renderedadjusted.RenderedAdjustedFacetAbstract;
-
-public class RenderedAdjustedFacetForPropertyLayoutXml extends RenderedAdjustedFacetAbstract {
-
- public static RenderedAdjustedFacet create(final PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final Boolean renderedAsDayBefore = propertyLayout.getRenderedAsDayBefore();
- return renderedAsDayBefore != null && renderedAsDayBefore ? new RenderedAdjustedFacetForPropertyLayoutXml(holder) : null;
- }
-
- public static final int ADJUST_BY = -1;
-
- private RenderedAdjustedFacetForPropertyLayoutXml(FacetHolder holder) {
- super(ADJUST_BY, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyXml.java
new file mode 100644
index 0000000..63a3e4a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/RenderedAdjustedFacetForPropertyXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objectvalue.renderedadjusted.RenderedAdjustedFacet;
+import org.apache.isis.core.metamodel.facets.objectvalue.renderedadjusted.RenderedAdjustedFacetAbstract;
+
+public class RenderedAdjustedFacetForPropertyXml extends RenderedAdjustedFacetAbstract {
+
+ public static RenderedAdjustedFacet create(final Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final Boolean renderedAsDayBefore = propertyLayout.getRenderedAsDayBefore();
+ return renderedAsDayBefore != null && renderedAsDayBefore ? new RenderedAdjustedFacetForPropertyXml(holder) : null;
+ }
+
+ public static final int ADJUST_BY = -1;
+
+ private RenderedAdjustedFacetForPropertyXml(FacetHolder holder) {
+ super(ADJUST_BY, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyLayoutXml.java
deleted file mode 100644
index 5d51ce9..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyLayoutXml.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.core.metamodel.facets.properties.propertylayout;
-
-import org.apache.isis.applib.layout.v1_0.PropertyLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.objectvalue.typicallen.TypicalLengthFacet;
-import org.apache.isis.core.metamodel.facets.objectvalue.typicallen.TypicalLengthFacetAbstract;
-
-public class TypicalLengthFacetForPropertyLayoutXml extends TypicalLengthFacetAbstract {
-
- public static TypicalLengthFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
- if(propertyLayout == null) {
- return null;
- }
- final Integer typicalLength = propertyLayout.getTypicalLength();
- return typicalLength != null && typicalLength != -1 ? new TypicalLengthFacetForPropertyLayoutXml(typicalLength, holder) : null;
- }
-
- private final int typicalLength;
-
- private TypicalLengthFacetForPropertyLayoutXml(int typicalLength, FacetHolder holder) {
- super(holder, Derivation.NOT_DERIVED);
- this.typicalLength = typicalLength;
- }
-
- @Override
- public int value() {
- return typicalLength;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyXml.java
new file mode 100644
index 0000000..1a193e5
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/propertylayout/TypicalLengthFacetForPropertyXml.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.properties.propertylayout;
+
+import org.apache.isis.applib.layout.v1_0.Property;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objectvalue.typicallen.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.objectvalue.typicallen.TypicalLengthFacetAbstract;
+
+public class TypicalLengthFacetForPropertyXml extends TypicalLengthFacetAbstract {
+
+ public static TypicalLengthFacet create(Property propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final Integer typicalLength = propertyLayout.getTypicalLength();
+ return typicalLength != null && typicalLength != -1 ? new TypicalLengthFacetForPropertyXml(typicalLength, holder) : null;
+ }
+
+ private final int typicalLength;
+
+ private TypicalLengthFacetForPropertyXml(int typicalLength, FacetHolder holder) {
+ super(holder, Derivation.NOT_DERIVED);
+ this.typicalLength = typicalLength;
+ }
+
+ @Override
+ public int value() {
+ return typicalLength;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
index 51269c5..437783a 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
@@ -18,11 +18,13 @@
*/
package org.apache.isis.core.metamodel.layoutxml.v1_0;
+import java.util.List;
import java.util.Map;
import javax.xml.bind.Marshaller;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Before;
@@ -79,10 +81,14 @@ public class DomainObjectTest {
Action updateNameAction = new Action();
updateNameAction.setId("updateName");
+ final List<Action> propertyActions = Lists.newArrayList();
+ nameProperty.setActions(propertyActions);
nameProperty.getActions().add(updateNameAction);
Action deleteAction = new Action();
deleteAction.setId("delete");
+ final List<Action> domainObjectActions = Lists.newArrayList();
+ domainObject.setActions(domainObjectActions);
domainObject.getActions().add(deleteAction);
String xml = jaxbService.toXml(domainObject,
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
index 3f9b76f..1ab845e 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
@@ -33,6 +33,7 @@ import org.apache.wicket.model.Model;
import org.apache.isis.applib.layout.v1_0.DomainObject;
import org.apache.isis.applib.layout.v1_0.Tab;
import org.apache.isis.applib.layout.v1_0.TabGroup;
+import org.apache.isis.applib.services.jaxb.JaxbService;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
import org.apache.isis.core.metamodel.facets.object.layoutxml.LayoutXmlFacet;
@@ -73,6 +74,10 @@ public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> {
final LayoutXmlFacet layoutXmlFacet = model.getTypeOfSpecification().getFacet(LayoutXmlFacet.class);
final DomainObject domainObject = layoutXmlFacet.getLayoutMetadata();
+ // TODO: debugging, remove
+ final String xml = getServicesInjector().lookupService(JaxbService.class).toXml(domainObject);
+ System.out.println(xml);
+
addOrReplace(ComponentType.ENTITY_SUMMARY, model);
final List<TabGroup> tabGroups = domainObject.getTabGroups();
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
index a5fe4ef..70bf2d5 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -18,6 +18,9 @@
*/
package domainapp.dom.simple;
+import java.util.List;
+
+import javax.inject.Inject;
import javax.jdo.JDOHelper;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.VersionStrategy;
@@ -143,6 +146,18 @@ public class SimpleObject implements Comparable<SimpleObject> {
@javax.inject.Inject
@SuppressWarnings("unused")
- private DomainObjectContainer container;
+ DomainObjectContainer container;
+
+
+ public List<SimpleObject> getSimilarTo() {
+ return simpleObjects.findByName(getName().substring(0,1));
+ }
+
+ public List<SimpleObject> getOthers() {
+ return simpleObjects.listAll();
+ }
+
+ @Inject
+ SimpleObjects simpleObjects;
}
[6/6] isis git commit: ISIS-993: slight simplification to metadata to
make easier to fit into existing wicket cpt implementation;
Wicket components now rendering again
Posted by da...@apache.org.
ISIS-993: slight simplification to metadata to make easier to fit into existing wicket cpt implementation; Wicket components now rendering again
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0ac8eda9
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0ac8eda9
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0ac8eda9
Branch: refs/heads/ISIS-993
Commit: 0ac8eda9ae352210b1d6262f10ce3f6d46c7bf1d
Parents: 739899b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Jan 8 10:28:12 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Jan 8 10:28:12 2016 +0000
----------------------------------------------------------------------
.../schema/applib/layout/layout-1.0.xsd | 8 +--
.../asciidoc/schema/applib/layout/layout.xsd | 8 +--
.../apache/isis/applib/layout/v1_0/Column.java | 45 ++++++-------
.../isis/applib/layout/v1_0/ColumnContent.java | 1 +
.../isis/applib/layout/v1_0/PropertyGroup.java | 7 +-
.../org/apache/isis/applib/layout/v1_0/Tab.java | 30 ++++++++-
.../object/layoutxml/LayoutXmlFacetDefault.java | 16 +++--
.../layoutxml/v1_0/DomainObjectTest.java | 15 ++---
.../viewer/wicket/model/models/EntityModel.java | 12 ++--
.../collections/EntityCollectionsPanel.html | 2 +-
.../entity/properties/EntityPropertiesForm.java | 69 ++++++++++++--------
.../properties/EntityPropertiesPanel.html | 7 +-
.../entity/tabgroups/EntityTabGroupsPanel.java | 2 +-
.../java/domainapp/dom/simple/SimpleObject.java | 4 +-
.../dom/simple/SimpleObject.layout.xml | 3 +-
15 files changed, 134 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
index ba275c2..6aeb3d6 100644
--- a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
@@ -48,17 +48,15 @@
<xs:complexType name="column">
<xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="propertyGroup" type="tns:propertyGroup"/>
- <xs:element name="collection" type="tns:collection"/>
- </xs:choice>
+ <xs:element name="propertyGroup" type="tns:propertyGroup" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="collection" type="tns:collection" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="span" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="propertyGroup">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
index ba275c2..6aeb3d6 100644
--- a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
@@ -48,17 +48,15 @@
<xs:complexType name="column">
<xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="propertyGroup" type="tns:propertyGroup"/>
- <xs:element name="collection" type="tns:collection"/>
- </xs:choice>
+ <xs:element name="propertyGroup" type="tns:propertyGroup" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="collection" type="tns:collection" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="span" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="propertyGroup">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
index 7e7129c..905438f 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Column.java
@@ -23,17 +23,15 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@XmlType(
propOrder = {
- "span"
- , "content"
+ "propertyGroups"
+ , "collections"
}
)
public class Column implements Serializable {
@@ -60,35 +58,30 @@ public class Column implements Serializable {
- private List<ColumnContent> content = Lists.newArrayList();
+ private List<PropertyGroup> propertyGroups = Lists.newArrayList();
- @XmlElements({
- @XmlElement(name = "propertyGroup", required = false, type = PropertyGroup.class),
- @XmlElement(name = "collection", required = false, type = Collection.class)
-
- })
- public List<ColumnContent> getContent() {
- return content;
+ // no wrapper
+ @XmlElement(name = "propertyGroup", required = false)
+ public List<PropertyGroup> getPropertyGroups() {
+ return propertyGroups;
}
- public void setContent(List<ColumnContent> content) {
- this.content = content;
+ public void setPropertyGroups(final List<PropertyGroup> propertyGroups) {
+ this.propertyGroups = propertyGroups;
}
- @XmlTransient
- public Iterable<PropertyGroup> getPropertyGroups() {
- return Iterables.transform(
- Iterables.filter(getContent(), Util.is(PropertyGroup.class)),
- Util.cast(PropertyGroup.class));
- }
- @XmlTransient
- public Iterable<Collection> getCollections() {
- return Iterables.transform(
- Iterables.filter(getContent(), Util.is(Collection.class)),
- Util.cast(Collection.class));
- }
+ private List<Collection> collections = Lists.newArrayList();
+
+ // no wrapper
+ @XmlElement(name = "collection", required = false)
+ public List<Collection> getCollections() {
+ return collections;
+ }
+ public void setCollections(final List<Collection> collections) {
+ this.collections = collections;
+ }
private Tab owner;
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ColumnContent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ColumnContent.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ColumnContent.java
index ccd0e3f..526aa26 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ColumnContent.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ColumnContent.java
@@ -20,4 +20,5 @@ package org.apache.isis.applib.layout.v1_0;
public interface ColumnContent {
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
index f249071..78ef28a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyGroup.java
@@ -66,12 +66,9 @@ public class PropertyGroup implements ColumnContent, ActionHolder, Serializable
- private List<Action> actions = Lists.newArrayList();
+ private List<Action> actions;
- /**
- * The <code><actions></code> element must be present but can be empty.
- */
- @XmlElementWrapper(required = true)
+ @XmlElementWrapper(required = false)
@XmlElement(name = "action", required = false)
public List<Action> getActions() {
return actions;
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
index 4a07dca..e81d20a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Tab.java
@@ -19,12 +19,17 @@
package org.apache.isis.applib.layout.v1_0;
import java.io.Serializable;
+import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.annotation.Programmatic;
+
@XmlType(
name="tab"
, propOrder = {
@@ -105,6 +110,29 @@ public class Tab implements Serializable {
this.owner = owner;
}
+ /**
+ * Aggregates the contents of all collections on this tab.
+ */
+ @Programmatic
+ public List<ColumnContent> getContents() {
+ final List<ColumnContent> contents = Lists.newArrayList();
+ appendContent(contents, getLeft());
+ appendContent(contents, getMiddle());
+ appendContent(contents, getRight());
+ return contents;
+ }
-
+ private static void appendContent(final List<ColumnContent> contents, final Column column) {
+ if(column == null) {
+ return;
+ }
+ final List<PropertyGroup> propertyGroups = column.getPropertyGroups();
+ if(propertyGroups != null) {
+ contents.addAll(propertyGroups);
+ }
+ final List<Collection> collections = column.getCollections();
+ if(collections != null) {
+ contents.addAll(collections);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
index ca42fa6..eedda94 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/layoutxml/LayoutXmlFacetDefault.java
@@ -198,7 +198,7 @@ public class LayoutXmlFacetDefault
boolean wasSet = defaultPropertyGroupRef.compareAndSet(null, new PropertyGroup(MemberGroupLayoutFacet.DEFAULT_GROUP));
final PropertyGroup defaultPropertyGroup = defaultPropertyGroupRef.get();
if(wasSet) {
- firstColumnRef.get().getContent().add(defaultPropertyGroup);
+ firstColumnRef.get().getPropertyGroups().add(defaultPropertyGroup);
}
Iterables.removeAll(propertyIds, oneToOneAssociationById.keySet());
for (final String propertyId : missingPropertyIds) {
@@ -223,7 +223,7 @@ public class LayoutXmlFacetDefault
lastTabGroup.getTabs().add(tab);
Column left = new Column(12);
tab.setLeft(left);
- left.getContent().add(new Collection(collectionId));
+ left.getCollections().add(new Collection(collectionId));
}
}
@@ -339,10 +339,18 @@ public class LayoutXmlFacetDefault
FacetUtil.addFacet(PagedFacetForCollectionXml.create(collection, oneToManyAssociation));
FacetUtil.addFacet(SortedByFacetForCollectionXml.create(collection, oneToManyAssociation));
- // copy the collection name onto the tab
+ // @MemberOrder#name based on the collection's id (so that each has a single "member group")
+ final String groupName = collection.getId();
+ final String sequence = nextInSequenceFor(groupName);
+ FacetUtil.addFacet(
+ new MemberOrderFacetXml(groupName, sequence, translationService, oneToManyAssociation));
+
+ // if there is only a single column and no other contents, then copy the collection Id onto the tab'
final Column column = collection.getOwner();
final Tab tab = column.getOwner();
- tab.setName(collection.getId());
+ if(tab.getContents().size() == 1) {
+ tab.setName(collection.getId());
+ }
}
private String nextInSequenceFor(final String propertyGroupName) {
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
index 437783a..a8d06c0 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/layoutxml/v1_0/DomainObjectTest.java
@@ -18,7 +18,6 @@
*/
package org.apache.isis.core.metamodel.layoutxml.v1_0;
-import java.util.List;
import java.util.Map;
import javax.xml.bind.Marshaller;
@@ -69,11 +68,13 @@ public class DomainObjectTest {
Column left = tab.getLeft();
PropertyGroup leftPropGroup = new PropertyGroup();
- left.getContent().add(leftPropGroup);
+ left.setPropertyGroups(Lists.<PropertyGroup>newArrayList());
+ left.getPropertyGroups().add(leftPropGroup);
leftPropGroup.setName("General");
Collection similarToColl = new Collection();
- left.getContent().add(similarToColl);
+ left.setCollections(Lists.<Collection>newArrayList());
+ left.getCollections().add(similarToColl);
similarToColl.setId("similarTo");
Property nameProperty = leftPropGroup.getProperties().get(0);
@@ -81,14 +82,12 @@ public class DomainObjectTest {
Action updateNameAction = new Action();
updateNameAction.setId("updateName");
- final List<Action> propertyActions = Lists.newArrayList();
- nameProperty.setActions(propertyActions);
+ nameProperty.setActions(Lists.<Action>newArrayList());
nameProperty.getActions().add(updateNameAction);
Action deleteAction = new Action();
deleteAction.setId("delete");
- final List<Action> domainObjectActions = Lists.newArrayList();
- domainObject.setActions(domainObjectActions);
+ domainObject.setActions(Lists.<Action>newArrayList());
domainObject.getActions().add(deleteAction);
String xml = jaxbService.toXml(domainObject,
@@ -115,7 +114,7 @@ public class DomainObjectTest {
protected void dumpXsd(final DomainObject domainObject) {
Map<String, String> schemas = jaxbService.toXsd(domainObject, JaxbService.IsisSchemas.INCLUDE);
for (Map.Entry<String, String> entry : schemas.entrySet()) {
- System.out.println(entry.getKey() + ":");
+ //System.out.println(entry.getKey() + ":");
System.out.println(entry.getValue());
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
index 97ef07c..899f48e 100644
--- a/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
+++ b/core/viewer-wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
@@ -634,17 +634,17 @@ public class EntityModel extends BookmarkableModel<ObjectAdapter> {
// //////////////////////////////////////////////////////////
- // tab (if any)
+ // tab metadata (if any)
// //////////////////////////////////////////////////////////
- private Tab tab;
+ private Tab tabMetadata;
- public Tab getTab() {
- return tab;
+ public Tab getTabMetadata() {
+ return tabMetadata;
}
- public void setTab(final Tab tab) {
- this.tab = tab;
+ public void setTabMetadata(final Tab tabMetadata) {
+ this.tabMetadata = tabMetadata;
}
// //////////////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
index f46ec4a..2d39517 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.html
@@ -38,7 +38,7 @@
</div>
</div>
- <div wicket:id="owner" class="collection panel-body">
+ <div wicket:id="collection" class="collection panel-body">
[collection]
</div>
</div>
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
index 8339981..5901d08 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
@@ -155,11 +155,14 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
final EntityModel entityModel = (EntityModel) getModel();
- final Tab tabIfAny = entityModel.getTab();
+ final Tab tabMetaDataIfAny = entityModel.getTabMetadata();
final ColumnSpans columnSpans;
- if(tabIfAny != null) {
- columnSpans = ColumnSpans.asSpans(tabIfAny.getLeft().getSpan(), tabIfAny.getMiddle().getSpan(), tabIfAny.getRight().getSpan());
+ if(tabMetaDataIfAny != null) {
+ columnSpans = ColumnSpans.asSpans(
+ tabMetaDataIfAny.getLeft().getSpan(),
+ tabMetaDataIfAny.getMiddle().getSpan(),
+ tabMetaDataIfAny.getRight().getSpan());
} else {
final MemberGroupLayoutFacet memberGroupLayoutFacet =
entityModel.getObject().getSpecification().getFacet(MemberGroupLayoutFacet.class);
@@ -174,7 +177,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
boolean addedProperties;
if(columnSpans.getLeft() > 0) {
- addedProperties = addPropertiesInColumn(leftColumn, MemberGroupLayoutHint.LEFT, tabIfAny, columnSpans);
+ addedProperties = addMembersInColumn(leftColumn, MemberGroupLayoutHint.LEFT, tabMetaDataIfAny, columnSpans);
addButtons(leftColumn);
addFeedbackGui(leftColumn);
} else {
@@ -192,7 +195,7 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
if(columnSpans.getMiddle() > 0) {
MarkupContainer middleColumn = new WebMarkupContainer(ID_MIDDLE_COLUMN);
add(middleColumn);
- addPropertiesInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, tabIfAny, columnSpans);
+ addMembersInColumn(middleColumn, MemberGroupLayoutHint.MIDDLE, tabMetaDataIfAny, columnSpans);
} else {
Components.permanentlyHide(this, ID_MIDDLE_COLUMN);
}
@@ -201,13 +204,13 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
if(columnSpans.getRight() > 0) {
MarkupContainer rightColumn = new WebMarkupContainer(ID_RIGHT_COLUMN);
add(rightColumn);
- addPropertiesInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, tabIfAny, columnSpans);
+ addMembersInColumn(rightColumn, MemberGroupLayoutHint.RIGHT, tabMetaDataIfAny, columnSpans);
} else {
Components.permanentlyHide(this, ID_RIGHT_COLUMN);
}
- // collections
- if(columnSpans.getCollections() > 0) {
+ // collections (only if not being added to a tab)
+ if(tabMetaDataIfAny == null && columnSpans.getCollections() > 0) {
final String idCollectionsToShow;
final String idCollectionsToHide;
int collectionSpan;
@@ -223,19 +226,18 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
final Component collectionsColumn = getComponentFactoryRegistry().addOrReplaceComponent(this, idCollectionsToShow, ComponentType.ENTITY_COLLECTIONS, entityModel);
addClassForSpan(collectionsColumn, collectionSpan);
-
+
Components.permanentlyHide(this, idCollectionsToHide);
} else {
Components.permanentlyHide(this, ID_ENTITY_COLLECTIONS);
Components.permanentlyHide(this, ID_ENTITY_COLLECTIONS_OVERFLOW);
}
-
}
- private boolean addPropertiesInColumn(
+ private boolean addMembersInColumn(
final MarkupContainer markupContainer,
final MemberGroupLayoutHint hint,
- final Tab tabIfAny,
+ final Tab tabMetaDataIfAny,
final ColumnSpans columnSpans) {
final int span = hint.from(columnSpans);
@@ -243,20 +245,20 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
final ObjectAdapter adapter = entityModel.getObject();
final ObjectSpecification objSpec = adapter.getSpecification();
- final List<ObjectAssociation> associations = visibleProperties(adapter, objSpec, Where.OBJECT_FORMS);
+ final Column columnMetaDataIfAny = tabMetaDataIfAny != null ? hint.from(tabMetaDataIfAny) : null;
+
+ // if in a tab, then collections are also rendered.
+ final List<ObjectAssociation> properties = visibleAssociations(adapter, ObjectAssociation.Filters.PROPERTIES);
final RepeatingView memberGroupRv = new RepeatingView(ID_MEMBER_GROUP);
markupContainer.add(memberGroupRv);
- final Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociation.Util.groupByMemberOrderName(associations);
-
- final List<String> groupNames;
- if(tabIfAny != null) {
- final Column column = hint.from(tabIfAny);
- groupNames = Lists.newArrayList(Iterables.transform(column.getPropertyGroups(), propertyGroupName()));
- } else {
- groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet(), hint);
- }
+ final Map<String, List<ObjectAssociation>> associationsByGroup =
+ ObjectAssociation.Util.groupByMemberOrderName(properties);
+
+ final List<String> groupNames = tabMetaDataIfAny != null
+ ? Lists.newArrayList(Iterables.transform(columnMetaDataIfAny.getPropertyGroups(), propertyGroupName()))
+ : ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet(), hint);
for(final String groupName: groupNames) {
final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
@@ -296,6 +298,13 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
}
addClassForSpan(markupContainer, span);
+
+ // if in a tab, then also render collections
+ if(columnMetaDataIfAny != null) {
+ final List<ObjectAssociation> collections = visibleAssociations(adapter, ObjectAssociation.Filters.COLLECTIONS);
+
+ }
+
return !groupNames.isEmpty();
}
@@ -330,13 +339,21 @@ public class EntityPropertiesForm extends FormAbstract<ObjectAdapter> implements
}
- private List<ObjectAssociation> visibleProperties(final ObjectAdapter adapter, final ObjectSpecification objSpec, Where where) {
- return objSpec.getAssociations(Contributed.INCLUDED, visiblePropertyFilter(adapter, where));
+ private List<ObjectAssociation> visibleAssociations(
+ final ObjectAdapter adapter,
+ final Filter<ObjectAssociation> associationFilter) {
+ final ObjectSpecification objSpec = adapter.getSpecification();
+
+ return objSpec.getAssociations(Contributed.INCLUDED, visibleAssociationFilter(adapter, Where.OBJECT_FORMS,
+ associationFilter));
}
@SuppressWarnings("unchecked")
- private Filter<ObjectAssociation> visiblePropertyFilter(final ObjectAdapter adapter, Where where) {
- return Filters.and(ObjectAssociation.Filters.PROPERTIES, ObjectAssociation.Filters.dynamicallyVisible(adapter,
+ private static Filter<ObjectAssociation> visibleAssociationFilter(
+ final ObjectAdapter adapter,
+ final Where where,
+ final Filter<ObjectAssociation> associationFilter) {
+ return Filters.and(associationFilter, ObjectAssociation.Filters.dynamicallyVisible(adapter,
InteractionInitiatedBy.USER, where
));
}
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
index afff1d6..4e917e2 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
@@ -36,7 +36,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="owner" class="property">[property]</div>
+ <div wicket:id="property" class="property">[property]</div>
</div>
</div>
</div>
@@ -64,7 +64,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="owner" class="property">[property]</div>
+ <div wicket:id="property" class="property">[property]</div>
</div>
</div>
</div>
@@ -84,7 +84,7 @@
</div>
<div class="properties panel-body">
<div wicket:id="properties">
- <div wicket:id="owner" class="property">[property]</div>
+ <div wicket:id="property" class="property">[property]</div>
</div>
</div>
</div>
@@ -96,7 +96,6 @@
<div class="row">
<div wicket:id="entityCollectionsOverflow"></div>
</div>
-
</form>
</div>
</wicket:panel>
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
index 1ab845e..e8438e1 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/tabgroups/EntityTabGroupsPanel.java
@@ -115,7 +115,7 @@ public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> {
super(id);
final EntityModel modelWithTabHints = new EntityModel(model.getPageParameters());
- model.setTab(tab);
+ model.setTabMetadata(tab);
getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_PROPERTIES_AND_COLLECTIONS, ComponentType.ENTITY_PROPERTIES, modelWithTabHints);
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
index 70bf2d5..dad55cf 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.java
@@ -57,11 +57,11 @@ import org.apache.isis.applib.util.ObjectContracts;
@javax.jdo.annotations.Query(
name = "find", language = "JDOQL",
value = "SELECT "
- + "FROM domainapp.dom.modules.simple.SimpleObject "),
+ + "FROM domainapp.dom.simple.SimpleObject "),
@javax.jdo.annotations.Query(
name = "findByName", language = "JDOQL",
value = "SELECT "
- + "FROM domainapp.dom.modules.simple.SimpleObject "
+ + "FROM domainapp.dom.simple.SimpleObject "
+ "WHERE name.indexOf(:name) >= 0 ")
})
@javax.jdo.annotations.Unique(name="SimpleObject_name_UNQ", members = {"name"})
http://git-wip-us.apache.org/repos/asf/isis/blob/0ac8eda9/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
index 2abd6be..d367269 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/simple/SimpleObject.layout.xml
@@ -1,3 +1,5 @@
+DELIBERATE SYNTAX ERROR TO DISABLE NEW RENDERING
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<domainObject xsi:schemaLocation="http://isis.apache.org/schema/applib/layout http://isis.apache.org/schema/applib/layout/layout-1.0.xsd" xmlns="http://isis.apache.org/schema/applib/layout" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<actions>
@@ -7,7 +9,6 @@
<tab name="Common">
<left span="4">
<propertyGroup name="General">
- <actions/>
<property id="name" labelPosition="TOP">
<actions>
<action id="updateName"/>
[5/6] isis git commit: ISIS-993: simplifying the metadata. the wicket
components still broken at this point
Posted by da...@apache.org.
ISIS-993: simplifying the metadata. the wicket components still broken at this point
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/739899ba
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/739899ba
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/739899ba
Branch: refs/heads/ISIS-993
Commit: 739899bada81ca19290ab6c6333598e81aa7483f
Parents: 165202f
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Jan 8 09:17:04 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Jan 8 09:17:04 2016 +0000
----------------------------------------------------------------------
.../schema/applib/layout/layout-1.0.xsd | 42 ++---
.../asciidoc/schema/applib/layout/layout.xsd | 42 ++---
.../apache/isis/applib/layout/v1_0/Action.java | 133 ++++++++++++--
.../isis/applib/layout/v1_0/ActionLayout.java | 178 -------------------
.../isis/applib/layout/v1_0/Collection.java | 134 ++++++++++++--
.../applib/layout/v1_0/CollectionLayout.java | 169 ------------------
.../isis/applib/layout/v1_0/DomainObject.java | 32 +---
.../isis/applib/layout/v1_0/Property.java | 136 ++++++++++++--
.../isis/applib/layout/v1_0/PropertyLayout.java | 166 -----------------
.../ActionPositionFacetForActionLayoutXml.java | 41 -----
.../layout/ActionPositionFacetForActionXml.java | 41 +++++
.../BookmarkPolicyFacetForActionLayoutXml.java | 42 -----
.../layout/BookmarkPolicyFacetForActionXml.java | 42 +++++
.../CssClassFaFacetForActionLayoutXml.java | 45 -----
.../layout/CssClassFaFacetForActionXml.java | 45 +++++
.../layout/CssClassFacetForActionLayoutXml.java | 43 -----
.../layout/CssClassFacetForActionXml.java | 43 +++++
.../DescribedAsFacetForActionLayoutXml.java | 43 -----
.../layout/DescribedAsFacetForActionXml.java | 43 +++++
.../layout/HiddenFacetForActionLayoutXml.java | 4 +-
.../layout/NamedFacetForActionLayoutXml.java | 45 -----
.../actions/layout/NamedFacetForActionXml.java | 45 +++++
.../CssClassFacetForCollectionLayoutXml.java | 43 -----
.../layout/CssClassFacetForCollectionXml.java | 43 +++++
.../DefaultViewFacetForCollectionLayoutXml.java | 43 -----
.../DefaultViewFacetForCollectionXml.java | 43 +++++
.../DescribedAsFacetForCollectionLayoutXml.java | 43 -----
.../DescribedAsFacetForCollectionXml.java | 43 +++++
.../HiddenFacetForCollectionLayoutXml.java | 52 ------
.../layout/HiddenFacetForCollectionXml.java | 52 ++++++
.../NamedFacetForCollectionLayoutXml.java | 48 -----
.../layout/NamedFacetForCollectionXml.java | 48 +++++
.../PagedFacetForCollectionLayoutXml.java | 41 -----
.../layout/PagedFacetForCollectionXml.java | 41 +++++
.../SortedByFacetForCollectionLayoutXml.java | 52 ------
.../layout/SortedByFacetForCollectionXml.java | 52 ++++++
.../object/layoutxml/LayoutXmlFacetDefault.java | 119 ++++++-------
.../CssClassFacetForPropertyLayoutXml.java | 43 -----
.../CssClassFacetForPropertyXml.java | 43 +++++
.../DescribedAsFacetForPropertyLayoutXml.java | 43 -----
.../DescribedAsFacetForPropertyXml.java | 43 +++++
.../HiddenFacetForPropertyLayoutXml.java | 52 ------
.../HiddenFacetForPropertyXml.java | 52 ++++++
.../LabelAtFacetForPropertyLayoutXml.java | 42 -----
.../LabelAtFacetForPropertyXml.java | 42 +++++
.../MultiLineFacetForPropertyLayoutXml.java | 41 -----
.../MultiLineFacetForPropertyXml.java | 41 +++++
.../NamedFacetForPropertyLayoutXml.java | 48 -----
.../NamedFacetForPropertyXml.java | 48 +++++
...nderedAdjustedFacetForPropertyLayoutXml.java | 43 -----
.../RenderedAdjustedFacetForPropertyXml.java | 43 +++++
.../TypicalLengthFacetForPropertyLayoutXml.java | 49 -----
.../TypicalLengthFacetForPropertyXml.java | 49 +++++
.../layoutxml/v1_0/DomainObjectTest.java | 6 +
.../entity/tabgroups/EntityTabGroupsPanel.java | 5 +
.../java/domainapp/dom/simple/SimpleObject.java | 17 +-
.../dom/simple/SimpleObject.layout.xml | 13 +-
57 files changed, 1413 insertions(+), 1667 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
index 221c807..ba275c2 100644
--- a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout-1.0.xsd
@@ -5,7 +5,7 @@
<xs:complexType name="domainObject">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
@@ -18,13 +18,6 @@
<xs:complexType name="action">
<xs:sequence>
- <xs:element name="layout" type="tns:actionLayout" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="actionLayout">
- <xs:sequence>
<xs:element name="named" type="xs:string" minOccurs="0"/>
<xs:element name="describedAs" type="xs:string" minOccurs="0"/>
</xs:sequence>
@@ -33,8 +26,9 @@
<xs:attribute name="cssClassFa" type="xs:string"/>
<xs:attribute name="cssClassFaPosition" type="tns:cssClassFaPosition"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
- <xs:attribute name="position" type="tns:position" use="required"/>
+ <xs:attribute name="position" type="tns:position"/>
</xs:complexType>
<xs:complexType name="tabGroup">
@@ -78,25 +72,19 @@
<xs:complexType name="property">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="named" type="xs:string" minOccurs="0"/>
+ <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="layout" type="tns:propertyLayout"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="propertyLayout">
- <xs:sequence>
- <xs:element name="named" type="xs:string" minOccurs="0"/>
- <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="cssClass" type="xs:string"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="labelPosition" type="tns:labelPosition"/>
<xs:attribute name="multiLine" type="xs:int"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
@@ -106,27 +94,21 @@
<xs:complexType name="collection">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="named" type="xs:string" minOccurs="0"/>
+ <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
+ <xs:element name="sortedBy" type="xs:string" minOccurs="0"/>
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="layout" type="tns:collectionLayout"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="collectionLayout">
- <xs:sequence>
- <xs:element name="named" type="xs:string" minOccurs="0"/>
- <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
- <xs:element name="sortedBy" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="cssClass" type="xs:string"/>
<xs:attribute name="defaultView" type="xs:string"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
<xs:attribute name="paged" type="xs:int"/>
</xs:complexType>
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
index 221c807..ba275c2 100644
--- a/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/applib/layout/layout.xsd
@@ -5,7 +5,7 @@
<xs:complexType name="domainObject">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
@@ -18,13 +18,6 @@
<xs:complexType name="action">
<xs:sequence>
- <xs:element name="layout" type="tns:actionLayout" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="actionLayout">
- <xs:sequence>
<xs:element name="named" type="xs:string" minOccurs="0"/>
<xs:element name="describedAs" type="xs:string" minOccurs="0"/>
</xs:sequence>
@@ -33,8 +26,9 @@
<xs:attribute name="cssClassFa" type="xs:string"/>
<xs:attribute name="cssClassFaPosition" type="tns:cssClassFaPosition"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
- <xs:attribute name="position" type="tns:position" use="required"/>
+ <xs:attribute name="position" type="tns:position"/>
</xs:complexType>
<xs:complexType name="tabGroup">
@@ -78,25 +72,19 @@
<xs:complexType name="property">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="named" type="xs:string" minOccurs="0"/>
+ <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="layout" type="tns:propertyLayout"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="propertyLayout">
- <xs:sequence>
- <xs:element name="named" type="xs:string" minOccurs="0"/>
- <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="cssClass" type="xs:string"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="labelPosition" type="tns:labelPosition"/>
<xs:attribute name="multiLine" type="xs:int"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
@@ -106,27 +94,21 @@
<xs:complexType name="collection">
<xs:sequence>
- <xs:element name="actions">
+ <xs:element name="named" type="xs:string" minOccurs="0"/>
+ <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
+ <xs:element name="sortedBy" type="xs:string" minOccurs="0"/>
+ <xs:element name="actions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="action" type="tns:action" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="layout" type="tns:collectionLayout"/>
- </xs:sequence>
- <xs:attribute name="id" type="xs:string" use="required"/>
- </xs:complexType>
-
- <xs:complexType name="collectionLayout">
- <xs:sequence>
- <xs:element name="named" type="xs:string" minOccurs="0"/>
- <xs:element name="describedAs" type="xs:string" minOccurs="0"/>
- <xs:element name="sortedBy" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="cssClass" type="xs:string"/>
<xs:attribute name="defaultView" type="xs:string"/>
<xs:attribute name="hidden" type="tns:where"/>
+ <xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="namedEscaped" type="xs:boolean"/>
<xs:attribute name="paged" type="xs:int"/>
</xs:complexType>
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
index 61c6443..7dd00de 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Action.java
@@ -25,12 +25,22 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.annotation.Where;
+
+/**
+ * Broadly corresponds to {@link org.apache.isis.applib.annotation.ActionLayout}.
+ *
+ * <p>
+ * Note that {@link org.apache.isis.applib.annotation.ActionLayout#contributed()} is omitted because this only applies
+ * to domain services.
+ * </p>
+ */
@XmlType(
- name="action"
- , propOrder = {
- "id"
- , "layout"
- }
+ propOrder = {
+ "named"
+ , "describedAs"
+ }
)
public class Action implements Serializable {
@@ -61,15 +71,116 @@ public class Action implements Serializable {
- private ActionLayout layout;
+ private BookmarkPolicy bookmarking;
+
+ @XmlAttribute(required = false)
+ public BookmarkPolicy getBookmarking() {
+ return bookmarking;
+ }
+
+ public void setBookmarking(BookmarkPolicy bookmarking) {
+ this.bookmarking = bookmarking;
+ }
+
+
+ private String cssClass;
+
+ @XmlAttribute(required = false)
+ public String getCssClass() {
+ return cssClass;
+ }
+
+ public void setCssClass(String cssClass) {
+ this.cssClass = cssClass;
+ }
+
+
+ private String cssClassFa;
+
+ @XmlAttribute(required = false)
+ public String getCssClassFa() {
+ return cssClassFa;
+ }
+
+ public void setCssClassFa(String cssClassFa) {
+ this.cssClassFa = cssClassFa;
+ }
+
+
+
+ private org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition cssClassFaPosition;
+
+ @XmlAttribute(required = false)
+ public org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition getCssClassFaPosition() {
+ return cssClassFaPosition;
+ }
+
+ public void setCssClassFaPosition(org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition cssClassFaPosition) {
+ this.cssClassFaPosition = cssClassFaPosition;
+ }
+
+
+ private String describedAs;
+
+ @XmlElement(required = false)
+ public String getDescribedAs() {
+ return describedAs;
+ }
+
+ public void setDescribedAs(String describedAs) {
+ this.describedAs = describedAs;
+ }
+
+
+
+ private Where hidden;
+
+ @XmlAttribute(required = false)
+ public Where getHidden() {
+ return hidden;
+ }
+
+ public void setHidden(Where hidden) {
+ this.hidden = hidden;
+ }
+
+
+
+ private String named;
+
+ @XmlElement(required = false)
+ public String getNamed() {
+ return named;
+ }
+
+ public void setNamed(String named) {
+ this.named = named;
+ }
+
+
+
+ private Boolean namedEscaped;
+
+ @XmlAttribute(required = false)
+ public Boolean getNamedEscaped() {
+ return namedEscaped;
+ }
+
+ public void setNamedEscaped(Boolean namedEscaped) {
+ this.namedEscaped = namedEscaped;
+ }
+
+
+
+ private org.apache.isis.applib.annotation.ActionLayout.Position position;
- @XmlElement(name="layout", required = true)
- public ActionLayout getLayout() {
- return layout;
+ @XmlAttribute(required = false)
+ public org.apache.isis.applib.annotation.ActionLayout.Position getPosition() {
+ return position;
}
- public void setLayout(ActionLayout layout) {
- this.layout = layout;
+ public void setPosition(org.apache.isis.applib.annotation.ActionLayout.Position position) {
+ this.position = position;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
deleted file mode 100644
index 9068d91..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/ActionLayout.java
+++ /dev/null
@@ -1,178 +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.applib.layout.v1_0;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.annotation.Where;
-
-/**
- * Broadly corresponds to {@link org.apache.isis.applib.annotation.ActionLayout}.
- *
- * <p>
- * Note that {@link org.apache.isis.applib.annotation.ActionLayout#contributed()} is omitted because this only applies
- * to domain services.
- * </p>
- */
-@XmlType(
- propOrder = {
- "named"
- , "describedAs"
- }
-)
-public class ActionLayout implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private BookmarkPolicy bookmarking;
-
- @XmlAttribute(required = false)
- public BookmarkPolicy getBookmarking() {
- return bookmarking;
- }
-
- public void setBookmarking(BookmarkPolicy bookmarking) {
- this.bookmarking = bookmarking;
- }
-
-
- private String cssClass;
-
- @XmlAttribute(required = false)
- public String getCssClass() {
- return cssClass;
- }
-
- public void setCssClass(String cssClass) {
- this.cssClass = cssClass;
- }
-
-
- private String cssClassFa;
-
- @XmlAttribute(required = false)
- public String getCssClassFa() {
- return cssClassFa;
- }
-
- public void setCssClassFa(String cssClassFa) {
- this.cssClassFa = cssClassFa;
- }
-
-
-
- private org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition cssClassFaPosition;
-
- @XmlAttribute(required = false)
- public org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition getCssClassFaPosition() {
- return cssClassFaPosition;
- }
-
- public void setCssClassFaPosition(org.apache.isis.applib.annotation.ActionLayout.CssClassFaPosition cssClassFaPosition) {
- this.cssClassFaPosition = cssClassFaPosition;
- }
-
-
- private String describedAs;
-
- @XmlElement(required = false)
- public String getDescribedAs() {
- return describedAs;
- }
-
- public void setDescribedAs(String describedAs) {
- this.describedAs = describedAs;
- }
-
-
-
- private Where hidden;
-
- @XmlAttribute(required = false)
- public Where getHidden() {
- return hidden;
- }
-
- public void setHidden(Where hidden) {
- this.hidden = hidden;
- }
-
-
-
- private String named;
-
- @XmlElement(required = false)
- public String getNamed() {
- return named;
- }
-
- public void setNamed(String named) {
- this.named = named;
- }
-
-
-
- private Boolean namedEscaped;
-
- @XmlAttribute(required = false)
- public Boolean getNamedEscaped() {
- return namedEscaped;
- }
-
- public void setNamedEscaped(Boolean namedEscaped) {
- this.namedEscaped = namedEscaped;
- }
-
-
-
- private org.apache.isis.applib.annotation.ActionLayout.Position position;
-
- @XmlAttribute(required = true)
- public org.apache.isis.applib.annotation.ActionLayout.Position getPosition() {
- return position;
- }
-
- public void setPosition(org.apache.isis.applib.annotation.ActionLayout.Position position) {
- this.position = position;
- }
-
-
-
- private Action owner;
- /**
- * Owner.
- *
- * <p>
- * Set programmatically by framework after reading in from XML.
- * </p>
- */
- @XmlTransient
- public Action getOwner() {
- return owner;
- }
-
- public void setOwner(final Action owner) {
- this.owner = owner;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
index db7d92b..371db40 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Collection.java
@@ -27,13 +27,22 @@ import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import com.google.common.collect.Lists;
+import org.apache.isis.applib.annotation.Where;
+/**
+ * Broadly corresponds to the {@link org.apache.isis.applib.annotation.CollectionLayout} annotation.
+ *
+ * <p>
+ * Note that {@link org.apache.isis.applib.annotation.CollectionLayout#render()} is omitted because
+ * {@link #defaultView} is its replacement.
+ * </p>
+ */
@XmlType(
propOrder = {
- "id"
+ "named"
+ ,"describedAs"
+ ,"sortedBy"
, "actions"
- , "layout"
}
)
public class Collection implements ColumnContent, ActionHolder, Serializable {
@@ -62,34 +71,125 @@ public class Collection implements ColumnContent, ActionHolder, Serializable {
}
- private List<Action> actions = Lists.newArrayList();
+
+ private String cssClass;
+
+ @XmlAttribute(required = false)
+ public String getCssClass() {
+ return cssClass;
+ }
+
+ public void setCssClass(String cssClass) {
+ this.cssClass = cssClass;
+ }
+
+
+
+ private String describedAs;
+
+ @XmlElement(required = false)
+ public String getDescribedAs() {
+ return describedAs;
+ }
+
+ public void setDescribedAs(String describedAs) {
+ this.describedAs = describedAs;
+ }
+
+
+
+ private String defaultView;
/**
- * The <code><actions></code> element must be present but can be empty.
+ * Typically <code>table</code> or <code>hidden</code>, but could be any other named view that is configured and
+ * appropriate, eg <code>gmap3</code> or <code>fullcalendar2</code>.
*/
- @XmlElementWrapper(name = "actions", required = true)
- @XmlElement(name = "action", required = false)
- public List<Action> getActions() {
- return actions;
+ @XmlAttribute(required = false)
+ public String getDefaultView() {
+ return defaultView;
}
- public void setActions(List<Action> actions) {
- this.actions = actions;
+ public void setDefaultView(String defaultView) {
+ this.defaultView = defaultView;
+ }
+
+
+ private Where hidden;
+
+ @XmlAttribute(required = false)
+ public Where getHidden() {
+ return hidden;
+ }
+
+ public void setHidden(Where hidden) {
+ this.hidden = hidden;
+ }
+
+
+ private String named;
+
+ @XmlElement(required = false)
+ public String getNamed() {
+ return named;
+ }
+
+ public void setNamed(String named) {
+ this.named = named;
+ }
+
+
+ private Boolean namedEscaped;
+
+ @XmlAttribute(required = false)
+ public Boolean getNamedEscaped() {
+ return namedEscaped;
+ }
+
+ public void setNamedEscaped(Boolean namedEscaped) {
+ this.namedEscaped = namedEscaped;
+ }
+
+
+ private Integer paged;
+
+ @XmlAttribute(required = false)
+ public Integer getPaged() {
+ return paged;
+ }
+
+ public void setPaged(Integer paged) {
+ this.paged = paged;
}
- private CollectionLayout layout = new CollectionLayout();
- @XmlElement(name = "layout", required = true)
- public CollectionLayout getLayout() {
- return layout;
+ private String sortedBy;
+
+ @XmlElement(required = false)
+ public String getSortedBy() {
+ return sortedBy;
}
- public void setLayout(CollectionLayout layout) {
- this.layout = layout;
+ public void setSortedBy(String sortedBy) {
+ this.sortedBy = sortedBy;
}
+
+ private List<Action> actions;
+
+ @XmlElementWrapper(name = "actions", required = false)
+ @XmlElement(name = "action", required = false)
+ public List<Action> getActions() {
+ return actions;
+ }
+
+ public void setActions(List<Action> actions) {
+ this.actions = actions;
+ }
+
+
+
private Column owner;
/**
* Owner.
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
deleted file mode 100644
index 08f89fc..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/CollectionLayout.java
+++ /dev/null
@@ -1,169 +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.applib.layout.v1_0;
-
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.isis.applib.annotation.Where;
-
-/**
- * Broadly corresponds to the {@link org.apache.isis.applib.annotation.CollectionLayout} annotation.
- *
- * <p>
- * Note that {@link org.apache.isis.applib.annotation.CollectionLayout#render()} is omitted because
- * {@link #defaultView} is its replacement.
- * </p>
- */
-@XmlType(
- propOrder = {
- "named"
- ,"describedAs"
- ,"sortedBy"
- }
-)
-public class CollectionLayout implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String cssClass;
-
- @XmlAttribute(required = false)
- public String getCssClass() {
- return cssClass;
- }
-
- public void setCssClass(String cssClass) {
- this.cssClass = cssClass;
- }
-
-
-
- private String describedAs;
-
- @XmlElement(required = false)
- public String getDescribedAs() {
- return describedAs;
- }
-
- public void setDescribedAs(String describedAs) {
- this.describedAs = describedAs;
- }
-
-
-
- private String defaultView;
-
- /**
- * Typically <code>table</code> or <code>hidden</code>, but could be any other named view that is configured and
- * appropriate, eg <code>gmap3</code> or <code>fullcalendar2</code>.
- */
- @XmlAttribute(required = false)
- public String getDefaultView() {
- return defaultView;
- }
-
- public void setDefaultView(String defaultView) {
- this.defaultView = defaultView;
- }
-
-
- private Where hidden;
-
- @XmlAttribute(required = false)
- public Where getHidden() {
- return hidden;
- }
-
- public void setHidden(Where hidden) {
- this.hidden = hidden;
- }
-
-
- private String named;
-
- @XmlElement(required = false)
- public String getNamed() {
- return named;
- }
-
- public void setNamed(String named) {
- this.named = named;
- }
-
-
- private Boolean namedEscaped;
-
- @XmlAttribute(required = false)
- public Boolean getNamedEscaped() {
- return namedEscaped;
- }
-
- public void setNamedEscaped(Boolean namedEscaped) {
- this.namedEscaped = namedEscaped;
- }
-
-
- private Integer paged;
-
- @XmlAttribute(required = false)
- public Integer getPaged() {
- return paged;
- }
-
- public void setPaged(Integer paged) {
- this.paged = paged;
- }
-
-
-
- private String sortedBy;
-
- @XmlElement(required = false)
- public String getSortedBy() {
- return sortedBy;
- }
-
- public void setSortedBy(String sortedBy) {
- this.sortedBy = sortedBy;
- }
-
-
-
- private Collection owner;
- /**
- * Owner.
- *
- * <p>
- * Set programmatically by framework after reading in from XML.
- * </p>
- */
- @XmlTransient
- public Collection getOwner() {
- return owner;
- }
-
- public void setOwner(final Collection owner) {
- this.owner = owner;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
index 4d89b47..99388eb 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/DomainObject.java
@@ -22,14 +22,11 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-import com.google.common.collect.Lists;
-
import org.apache.isis.applib.services.dto.Dto;
@XmlRootElement
@@ -43,13 +40,9 @@ public class DomainObject implements Dto, ActionHolder, Serializable {
private static final long serialVersionUID = 1L;
- private List<Action> actions = Lists.newArrayList();
-
+ private List<Action> actions;
- /**
- * The <code><actions></code> element must be present but can be empty.
- */
- @XmlElementWrapper(name = "actions", required = true)
+ @XmlElementWrapper(name = "actions", required = false)
@XmlElement(name = "action", required = false)
public List<Action> getActions() {
return actions;
@@ -87,11 +80,8 @@ public class DomainObject implements Dto, ActionHolder, Serializable {
void visit(final Column column);
void visit(final PropertyGroup propertyGroup);
void visit(final Property property);
- void visit(final PropertyLayout propertyLayout);
void visit(final Collection collection);
- void visit(final CollectionLayout collectionLayout);
void visit(final Action action);
- void visit(@Nullable final ActionLayout actionLayout);
}
public static class VisitorAdapter implements Visitor {
@@ -108,15 +98,9 @@ public class DomainObject implements Dto, ActionHolder, Serializable {
@Override
public void visit(final Property property) {}
@Override
- public void visit(final PropertyLayout propertyLayout) { }
- @Override
public void visit(final Collection collection) {}
@Override
- public void visit(final CollectionLayout collectionLayout) { }
- @Override
public void visit(final Action action) { }
- @Override
- public void visit(final ActionLayout actionLayout) { }
}
/**
@@ -163,9 +147,6 @@ public class DomainObject implements Dto, ActionHolder, Serializable {
for (final Property property : properties) {
property.setOwner(propertyGroup);
visitor.visit(property);
- final PropertyLayout layout = property.getLayout();
- layout.setOwner(property);
- visitor.visit(layout);
traverseActions(property, visitor);
}
}
@@ -175,21 +156,18 @@ public class DomainObject implements Dto, ActionHolder, Serializable {
for (final Collection collection : column.getCollections()) {
collection.setOwner(column);
visitor.visit(collection);
- final CollectionLayout layout = collection.getLayout();
- layout.setOwner(collection);
- visitor.visit(layout);
traverseActions(collection, visitor);
}
}
private void traverseActions(final ActionHolder actionHolder, final Visitor visitor) {
final List<Action> actions = actionHolder.getActions();
+ if(actions == null) {
+ return;
+ }
for (final Action action : actions) {
action.setOwner(actionHolder);
visitor.visit(action);
- final ActionLayout layout = action.getLayout();
- layout.setOwner(action);
- visitor.visit(layout);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
index 6f98d07..e01e47c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/Property.java
@@ -27,13 +27,17 @@ import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-import com.google.common.collect.Lists;
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.Where;
+/**
+ * Broadly corresponds to the {@link org.apache.isis.applib.annotation.PropertyLayout} annotation.
+ */
@XmlType(
propOrder = {
- "id"
+ "named"
+ , "describedAs"
, "actions"
- , "layout"
}
)
public class Property implements ActionHolder, Serializable {
@@ -62,33 +66,127 @@ public class Property implements ActionHolder, Serializable {
}
- private List<Action> actions = Lists.newArrayList();
- /**
- * The <code><actions></code> element must be present but can be empty.
- */
- @XmlElementWrapper(required = true)
- @XmlElement(name = "action", required = false)
- public List<Action> getActions() {
- return actions;
+ private String cssClass;
+
+ @XmlAttribute(required = false)
+ public String getCssClass() {
+ return cssClass;
}
- public void setActions(List<Action> actions) {
- this.actions = actions;
+ public void setCssClass(String cssClass) {
+ this.cssClass = cssClass;
+ }
+
+
+ private String describedAs;
+
+ @XmlElement(required = false)
+ public String getDescribedAs() {
+ return describedAs;
+ }
+
+ public void setDescribedAs(String describedAs) {
+ this.describedAs = describedAs;
+ }
+
+
+ private Where hidden;
+
+ @XmlAttribute(required = false)
+ public Where getHidden() {
+ return hidden;
+ }
+
+ public void setHidden(Where hidden) {
+ this.hidden = hidden;
+ }
+
+
+ private LabelPosition labelPosition;
+
+ @XmlAttribute(required = false)
+ public LabelPosition getLabelPosition() {
+ return labelPosition;
+ }
+
+ public void setLabelPosition(LabelPosition labelPosition) {
+ this.labelPosition = labelPosition;
+ }
+
+
+ private Integer multiLine;
+
+ @XmlAttribute(required = false)
+ public Integer getMultiLine() {
+ return multiLine;
+ }
+
+ public void setMultiLine(Integer multiLine) {
+ this.multiLine = multiLine;
+ }
+
+
+ private String named;
+
+ @XmlElement(required = false)
+ public String getNamed() {
+ return named;
+ }
+
+ public void setNamed(String named) {
+ this.named = named;
}
- private PropertyLayout layout = new PropertyLayout();
- @XmlElement(required = true)
- public PropertyLayout getLayout() {
- return layout;
+ private Boolean namedEscaped;
+
+ @XmlAttribute(required = false)
+ public Boolean getNamedEscaped() {
+ return namedEscaped;
+ }
+
+ public void setNamedEscaped(Boolean namedEscaped) {
+ this.namedEscaped = namedEscaped;
+ }
+
+
+ private Boolean renderedAsDayBefore;
+
+ @XmlAttribute(required = false)
+ public Boolean getRenderedAsDayBefore() {
+ return renderedAsDayBefore;
}
- public void setLayout(PropertyLayout layout) {
- this.layout = layout;
+ public void setRenderedAsDayBefore(Boolean renderedAsDayBefore) {
+ this.renderedAsDayBefore = renderedAsDayBefore;
}
+ private Integer typicalLength;
+
+ @XmlAttribute(required = false)
+ public Integer getTypicalLength() {
+ return typicalLength;
+ }
+
+ public void setTypicalLength(Integer typicalLength) {
+ this.typicalLength = typicalLength;
+ }
+
+
+
+ private List<Action> actions;
+
+ @XmlElementWrapper(required = false)
+ @XmlElement(name = "action", required = false)
+ public List<Action> getActions() {
+ return actions;
+ }
+
+ public void setActions(List<Action> actions) {
+ this.actions = actions;
+ }
private PropertyGroup owner;
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java b/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
deleted file mode 100644
index 7e67acf..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/v1_0/PropertyLayout.java
+++ /dev/null
@@ -1,166 +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.applib.layout.v1_0;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.isis.applib.annotation.LabelPosition;
-import org.apache.isis.applib.annotation.Where;
-
-@XmlType(
- propOrder = {
- "named"
- , "describedAs"
- }
-)
-public class PropertyLayout implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String cssClass;
-
- @XmlAttribute(required = false)
- public String getCssClass() {
- return cssClass;
- }
-
- public void setCssClass(String cssClass) {
- this.cssClass = cssClass;
- }
-
-
- private String describedAs;
-
- @XmlElement(required = false)
- public String getDescribedAs() {
- return describedAs;
- }
-
- public void setDescribedAs(String describedAs) {
- this.describedAs = describedAs;
- }
-
-
- private Where hidden;
-
- @XmlAttribute(required = false)
- public Where getHidden() {
- return hidden;
- }
-
- public void setHidden(Where hidden) {
- this.hidden = hidden;
- }
-
-
- private LabelPosition labelPosition;
-
- @XmlAttribute(required = false)
- public LabelPosition getLabelPosition() {
- return labelPosition;
- }
-
- public void setLabelPosition(LabelPosition labelPosition) {
- this.labelPosition = labelPosition;
- }
-
-
- private Integer multiLine;
-
- @XmlAttribute(required = false)
- public Integer getMultiLine() {
- return multiLine;
- }
-
- public void setMultiLine(Integer multiLine) {
- this.multiLine = multiLine;
- }
-
-
- private String named;
-
- @XmlElement(required = false)
- public String getNamed() {
- return named;
- }
-
- public void setNamed(String named) {
- this.named = named;
- }
-
-
- private Boolean namedEscaped;
-
- @XmlAttribute(required = false)
- public Boolean getNamedEscaped() {
- return namedEscaped;
- }
-
- public void setNamedEscaped(Boolean namedEscaped) {
- this.namedEscaped = namedEscaped;
- }
-
-
- private Boolean renderedAsDayBefore;
-
- @XmlAttribute(required = false)
- public Boolean getRenderedAsDayBefore() {
- return renderedAsDayBefore;
- }
-
- public void setRenderedAsDayBefore(Boolean renderedAsDayBefore) {
- this.renderedAsDayBefore = renderedAsDayBefore;
- }
-
-
- private Integer typicalLength;
-
- @XmlAttribute(required = false)
- public Integer getTypicalLength() {
- return typicalLength;
- }
-
- public void setTypicalLength(Integer typicalLength) {
- this.typicalLength = typicalLength;
- }
-
-
-
-
- private Property owner;
- /**
- * Owner.
- *
- * <p>
- * Set programmatically by framework after reading in from XML.
- * </p>
- */
- @XmlTransient
- public Property getOwner() {
- return owner;
- }
-
- public void setOwner(final Property owner) {
- this.owner = owner;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionLayoutXml.java
deleted file mode 100644
index c585b6b..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.actions.layout;
-
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.actions.position.ActionPositionFacet;
-import org.apache.isis.core.metamodel.facets.actions.position.ActionPositionFacetAbstract;
-
-public class ActionPositionFacetForActionLayoutXml extends ActionPositionFacetAbstract {
-
- public static ActionPositionFacet create(ActionLayout actionLayout, FacetHolder holder) {
- if(actionLayout == null) {
- return null;
- }
- final org.apache.isis.applib.annotation.ActionLayout.Position position = actionLayout.getPosition();
- return position != null ? new ActionPositionFacetForActionLayoutXml(position, holder) : null;
- }
-
- private ActionPositionFacetForActionLayoutXml(final org.apache.isis.applib.annotation.ActionLayout.Position position, final FacetHolder holder) {
- super(position, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionXml.java
new file mode 100644
index 0000000..d19bf9d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/ActionPositionFacetForActionXml.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.actions.layout;
+
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.actions.position.ActionPositionFacet;
+import org.apache.isis.core.metamodel.facets.actions.position.ActionPositionFacetAbstract;
+
+public class ActionPositionFacetForActionXml extends ActionPositionFacetAbstract {
+
+ public static ActionPositionFacet create(Action actionLayout, FacetHolder holder) {
+ if(actionLayout == null) {
+ return null;
+ }
+ final org.apache.isis.applib.annotation.ActionLayout.Position position = actionLayout.getPosition();
+ return position != null ? new ActionPositionFacetForActionXml(position, holder) : null;
+ }
+
+ private ActionPositionFacetForActionXml(final org.apache.isis.applib.annotation.ActionLayout.Position position, final FacetHolder holder) {
+ super(position, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionLayoutXml.java
deleted file mode 100644
index f273e9a..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,42 +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.core.metamodel.facets.actions.layout;
-
-import org.apache.isis.applib.annotation.BookmarkPolicy;
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.bookmarkpolicy.BookmarkPolicyFacet;
-import org.apache.isis.core.metamodel.facets.object.bookmarkpolicy.BookmarkPolicyFacetAbstract;
-
-public class BookmarkPolicyFacetForActionLayoutXml extends BookmarkPolicyFacetAbstract {
-
- public static BookmarkPolicyFacet create(final ActionLayout actionLayout, final FacetHolder holder) {
- if (actionLayout == null) {
- return null;
- }
- final BookmarkPolicy bookmarkPolicy = actionLayout.getBookmarking();
- return bookmarkPolicy != null && bookmarkPolicy != BookmarkPolicy.NEVER ? new BookmarkPolicyFacetForActionLayoutXml(bookmarkPolicy, holder) : null;
- }
-
- private BookmarkPolicyFacetForActionLayoutXml(final BookmarkPolicy bookmarkPolicy, final FacetHolder holder) {
- super(bookmarkPolicy, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionXml.java
new file mode 100644
index 0000000..b3a9623
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/BookmarkPolicyFacetForActionXml.java
@@ -0,0 +1,42 @@
+/*
+ * 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.core.metamodel.facets.actions.layout;
+
+import org.apache.isis.applib.annotation.BookmarkPolicy;
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.bookmarkpolicy.BookmarkPolicyFacet;
+import org.apache.isis.core.metamodel.facets.object.bookmarkpolicy.BookmarkPolicyFacetAbstract;
+
+public class BookmarkPolicyFacetForActionXml extends BookmarkPolicyFacetAbstract {
+
+ public static BookmarkPolicyFacet create(final Action actionLayout, final FacetHolder holder) {
+ if (actionLayout == null) {
+ return null;
+ }
+ final BookmarkPolicy bookmarkPolicy = actionLayout.getBookmarking();
+ return bookmarkPolicy != null && bookmarkPolicy != BookmarkPolicy.NEVER ? new BookmarkPolicyFacetForActionXml(bookmarkPolicy, holder) : null;
+ }
+
+ private BookmarkPolicyFacetForActionXml(final BookmarkPolicy bookmarkPolicy, final FacetHolder holder) {
+ super(bookmarkPolicy, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionLayoutXml.java
deleted file mode 100644
index 285d705..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,45 +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.core.metamodel.facets.actions.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaFacet;
-import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaFacetAbstract;
-import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaPosition;
-
-public class CssClassFaFacetForActionLayoutXml extends CssClassFaFacetAbstract {
-
- public static CssClassFaFacet create(final ActionLayout actionLayout, final FacetHolder holder) {
- if(actionLayout == null) {
- return null;
- }
- final String cssClassFa = Strings.emptyToNull(actionLayout.getCssClassFa());
- CssClassFaPosition cssClassFaPosition = CssClassFaPosition.from(actionLayout.getCssClassFaPosition());
- return cssClassFa != null ? new CssClassFaFacetForActionLayoutXml(cssClassFa, cssClassFaPosition, holder) : null;
- }
-
- private CssClassFaFacetForActionLayoutXml(final String value, final CssClassFaPosition position, final FacetHolder holder) {
- super(value, position, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionXml.java
new file mode 100644
index 0000000..d0258d4
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFaFacetForActionXml.java
@@ -0,0 +1,45 @@
+/*
+ * 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.core.metamodel.facets.actions.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaFacetAbstract;
+import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaPosition;
+
+public class CssClassFaFacetForActionXml extends CssClassFaFacetAbstract {
+
+ public static CssClassFaFacet create(final Action actionLayout, final FacetHolder holder) {
+ if(actionLayout == null) {
+ return null;
+ }
+ final String cssClassFa = Strings.emptyToNull(actionLayout.getCssClassFa());
+ CssClassFaPosition cssClassFaPosition = CssClassFaPosition.from(actionLayout.getCssClassFaPosition());
+ return cssClassFa != null ? new CssClassFaFacetForActionXml(cssClassFa, cssClassFaPosition, holder) : null;
+ }
+
+ private CssClassFaFacetForActionXml(final String value, final CssClassFaPosition position, final FacetHolder holder) {
+ super(value, position, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionLayoutXml.java
deleted file mode 100644
index c242091..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.actions.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
-
-public class CssClassFacetForActionLayoutXml extends CssClassFacetAbstract {
-
- public static CssClassFacet create(ActionLayout actionLayout, FacetHolder holder) {
- if(actionLayout == null) {
- return null;
- }
- final String cssClass = Strings.emptyToNull(actionLayout.getCssClass());
- return cssClass != null ? new CssClassFacetForActionLayoutXml(cssClass, holder) : null;
- }
-
- private CssClassFacetForActionLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionXml.java
new file mode 100644
index 0000000..9ba1431
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/CssClassFacetForActionXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.actions.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetForActionXml extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(Action actionLayout, FacetHolder holder) {
+ if(actionLayout == null) {
+ return null;
+ }
+ final String cssClass = Strings.emptyToNull(actionLayout.getCssClass());
+ return cssClass != null ? new CssClassFacetForActionXml(cssClass, holder) : null;
+ }
+
+ private CssClassFacetForActionXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionLayoutXml.java
deleted file mode 100644
index 493cd7f..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.actions.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
-import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
-
-public class DescribedAsFacetForActionLayoutXml extends DescribedAsFacetAbstract {
-
- public static DescribedAsFacet create(ActionLayout actionLayout, FacetHolder holder) {
- if(actionLayout == null) {
- return null;
- }
- final String describedAs = Strings.emptyToNull(actionLayout.getDescribedAs());
- return describedAs != null ? new DescribedAsFacetForActionLayoutXml(describedAs, holder) : null;
- }
-
- private DescribedAsFacetForActionLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionXml.java
new file mode 100644
index 0000000..a33dd7c
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/DescribedAsFacetForActionXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.actions.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetForActionXml extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(Action actionLayout, FacetHolder holder) {
+ if(actionLayout == null) {
+ return null;
+ }
+ final String describedAs = Strings.emptyToNull(actionLayout.getDescribedAs());
+ return describedAs != null ? new DescribedAsFacetForActionXml(describedAs, holder) : null;
+ }
+
+ private DescribedAsFacetForActionXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/HiddenFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/HiddenFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/HiddenFacetForActionLayoutXml.java
index 821083a..c0b98da1 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/HiddenFacetForActionLayoutXml.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/HiddenFacetForActionLayoutXml.java
@@ -21,7 +21,7 @@ package org.apache.isis.core.metamodel.facets.actions.layout;
import org.apache.isis.applib.annotation.When;
import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
+import org.apache.isis.applib.layout.v1_0.Action;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
@@ -29,7 +29,7 @@ import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
public class HiddenFacetForActionLayoutXml extends HiddenFacetAbstract {
- public static HiddenFacet create(final ActionLayout actionLayout, final FacetHolder holder) {
+ public static HiddenFacet create(final Action actionLayout, final FacetHolder holder) {
if (actionLayout == null) {
return null;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionLayoutXml.java
deleted file mode 100644
index a8917d6..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionLayoutXml.java
+++ /dev/null
@@ -1,45 +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.core.metamodel.facets.actions.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.ActionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
-
-public class NamedFacetForActionLayoutXml extends NamedFacetAbstract {
-
- public static NamedFacet create(final ActionLayout actionLayout, final FacetHolder holder) {
- if(actionLayout == null) {
- return null;
- }
- final String named = Strings.emptyToNull(actionLayout.getNamed());
- Boolean escaped = actionLayout.getNamedEscaped();
- return named != null ? new NamedFacetForActionLayoutXml(named, (escaped == null || escaped), holder) : null;
- }
-
- private NamedFacetForActionLayoutXml(final String value, final boolean escaped, final FacetHolder holder) {
-
- super(value, escaped, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionXml.java
new file mode 100644
index 0000000..c96fa2a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/layout/NamedFacetForActionXml.java
@@ -0,0 +1,45 @@
+/*
+ * 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.core.metamodel.facets.actions.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Action;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetForActionXml extends NamedFacetAbstract {
+
+ public static NamedFacet create(final Action actionLayout, final FacetHolder holder) {
+ if(actionLayout == null) {
+ return null;
+ }
+ final String named = Strings.emptyToNull(actionLayout.getNamed());
+ Boolean escaped = actionLayout.getNamedEscaped();
+ return named != null ? new NamedFacetForActionXml(named, (escaped == null || escaped), holder) : null;
+ }
+
+ private NamedFacetForActionXml(final String value, final boolean escaped, final FacetHolder holder) {
+
+ super(value, escaped, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionLayoutXml.java
deleted file mode 100644
index 80f6132..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
-import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
-
-public class CssClassFacetForCollectionLayoutXml extends CssClassFacetAbstract {
-
- public static CssClassFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if(collectionLayout == null) {
- return null;
- }
- final String cssClass = Strings.emptyToNull(collectionLayout.getCssClass());
- return cssClass != null ? new CssClassFacetForCollectionLayoutXml(cssClass, holder) : null;
- }
-
- private CssClassFacetForCollectionLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionXml.java
new file mode 100644
index 0000000..c75d5a7
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/CssClassFacetForCollectionXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetForCollectionXml extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(Collection collectionLayout, FacetHolder holder) {
+ if(collectionLayout == null) {
+ return null;
+ }
+ final String cssClass = Strings.emptyToNull(collectionLayout.getCssClass());
+ return cssClass != null ? new CssClassFacetForCollectionXml(cssClass, holder) : null;
+ }
+
+ private CssClassFacetForCollectionXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionLayoutXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionLayoutXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionLayoutXml.java
deleted file mode 100644
index b8d9056..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionLayoutXml.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.layout;
-
-import com.google.common.base.Strings;
-
-import org.apache.isis.applib.layout.v1_0.CollectionLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.collections.collection.defaultview.DefaultViewFacet;
-import org.apache.isis.core.metamodel.facets.collections.collection.defaultview.DefaultViewFacetAbstract;
-
-public class DefaultViewFacetForCollectionLayoutXml extends DefaultViewFacetAbstract {
-
- private DefaultViewFacetForCollectionLayoutXml(String value, FacetHolder holder) {
- super(value, holder);
- }
-
- public static DefaultViewFacet create(CollectionLayout collectionLayout, FacetHolder holder) {
- if (collectionLayout == null) {
- return null;
- }
-
- final String defaultView = Strings.emptyToNull(collectionLayout.getDefaultView());
- return defaultView != null ? new DefaultViewFacetForCollectionLayoutXml(defaultView, holder) : null;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/739899ba/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionXml.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionXml.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionXml.java
new file mode 100644
index 0000000..594bca0
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/layout/DefaultViewFacetForCollectionXml.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.layout;
+
+import com.google.common.base.Strings;
+
+import org.apache.isis.applib.layout.v1_0.Collection;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.collections.collection.defaultview.DefaultViewFacet;
+import org.apache.isis.core.metamodel.facets.collections.collection.defaultview.DefaultViewFacetAbstract;
+
+public class DefaultViewFacetForCollectionXml extends DefaultViewFacetAbstract {
+
+ private DefaultViewFacetForCollectionXml(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+ public static DefaultViewFacet create(Collection collectionLayout, FacetHolder holder) {
+ if (collectionLayout == null) {
+ return null;
+ }
+
+ final String defaultView = Strings.emptyToNull(collectionLayout.getDefaultView());
+ return defaultView != null ? new DefaultViewFacetForCollectionXml(defaultView, holder) : null;
+ }
+}