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/25 16:07:43 UTC
[22/50] [abbrv] isis git commit: ISIS-993: slight simplification to
metadata to make easier to fit into existing wicket cpt implementation;
Wicket components now rendering again
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/afe44fc3
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/afe44fc3
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/afe44fc3
Branch: refs/heads/ISIS-993
Commit: afe44fc36f8375f474bf990b12eaeabff1ae3328
Parents: 199c70d
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: Mon Jan 25 15:06:07 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 +-
.../dom/simple/SimpleObject.layout.xml | 3 +-
14 files changed, 132 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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/afe44fc3/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"/>