http://git-wip-us.apache.org/repos/asf/isis/blob/2e8c0943/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 index 025253b..3578772 100644 --- 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 @@ -21,7 +21,10 @@ <body> <wicket:panel> <div class="tabPanel"> - <div wicket:id="entityPropertiesAndCollections"></div> + <form class="inputForm" role="form"> + <div wicket:id="entityPropertiesAndCollections"> + </div> + </form> </div> </wicket:panel> </body>
http://git-wip-us.apache.org/repos/asf/isis/blob/2e8c0943/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 2667d05..0889e1a 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 @@ -21,7 +21,10 @@ package org.apache.isis.viewer.wicket.ui.components.entity.tabgroups; import java.util.List; +import javax.xml.bind.Marshaller; + import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import org.apache.wicket.extensions.markup.html.tabs.AbstractTab; @@ -35,6 +38,7 @@ import org.apache.isis.applib.layout.v1_0.ObjectLayoutMetadata; 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.applib.services.layout.Object_downloadLayoutXml; 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.layoutmetadata.ObjectLayoutMetadataFacet; @@ -75,10 +79,16 @@ public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> { final ObjectLayoutMetadataFacet objectLayoutMetadataFacet = model.getTypeOfSpecification().getFacet(ObjectLayoutMetadataFacet.class); final ObjectLayoutMetadata objectLayoutMetadata = objectLayoutMetadataFacet.getMetadata(); + // TODO: debugging, remove - final String xml = getServicesInjector().lookupService(JaxbService.class).toXml(objectLayoutMetadata); + final JaxbService jaxbService = getServicesInjector().lookupService(JaxbService.class); + final String xml = jaxbService.toXml(objectLayoutMetadata, + ImmutableMap.<String,Object>of( + Marshaller.JAXB_SCHEMA_LOCATION, + Object_downloadLayoutXml.TNS + " " + Object_downloadLayoutXml.SCHEMA_LOCATION)); System.out.println(xml); + addOrReplace(ComponentType.ENTITY_SUMMARY, model); final List<TabGroup> tabGroups = FluentIterable @@ -122,8 +132,7 @@ public class EntityTabGroupsPanel extends PanelAbstract<EntityModel> { public EntityTabPanel(String id, final EntityModel model, final Tab tab) { super(id); - final EntityModel modelWithTabHints = new EntityModel(model.getPageParameters()); - modelWithTabHints.withTabMetadata(tab); + final EntityModel modelWithTabHints = model.cloneWithTabMetadata(tab); getComponentFactoryRegistry().addOrReplaceComponent(this, ID_ENTITY_PROPERTIES_AND_COLLECTIONS, ComponentType.ENTITY_PROPERTIES, modelWithTabHints); } http://git-wip-us.apache.org/repos/asf/isis/blob/2e8c0943/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 index 4171d89..d602730 100644 --- 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 @@ -28,6 +28,7 @@ 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; +import org.apache.isis.viewer.wicket.ui.components.entity.combined.EntityCombinedPanel; /** * {@link ComponentFactory} for {@link EntityTabGroupsPanel}. @@ -44,13 +45,20 @@ public class EntityTabGroupsPanelFactory extends EntityComponentFactoryAbstract @Override protected ApplicationAdvice doAppliesTo(final EntityModel entityModel) { - final ObjectSpecification specification = entityModel.getTypeOfSpecification(); - return appliesIf(specification.containsDoOpFacet(ObjectLayoutMetadataFacet.class)); + return super.doAppliesTo(entityModel); // TODO: remove this override } @Override public Component createComponent(final String id, final IModel<?> model) { + final EntityModel entityModel = (EntityModel) model; - return new EntityTabGroupsPanel(id, entityModel); + + final ObjectSpecification specification = entityModel.getTypeOfSpecification(); + final ObjectLayoutMetadataFacet facet = specification.getFacet(ObjectLayoutMetadataFacet.class); + facet.reloadMetadata(); + final boolean hasLayout = !facet.isNoop(); + return hasLayout + ? new EntityTabGroupsPanel(id, entityModel) + : new EntityCombinedPanel(id, entityModel); } } http://git-wip-us.apache.org/repos/asf/isis/blob/2e8c0943/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java index e068168..d12a496 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java @@ -34,6 +34,7 @@ import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChec import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException; import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy; import org.apache.isis.core.metamodel.deployment.DeploymentCategory; +import org.apache.isis.core.metamodel.facets.object.layoutmetadata.ObjectLayoutMetadataFacet; import org.apache.isis.core.metamodel.spec.feature.ObjectMember; import org.apache.isis.core.runtime.system.DeploymentType; import org.apache.isis.core.runtime.system.context.IsisContext; @@ -134,20 +135,17 @@ public class EntityPage extends PageAbstract { // // invalidate the cache so that can do dynamic reloading of layout metadata etc. // - // Note that it's necessary to load the page twice. (I think) that the first time is to load the new - // Java class files into the webapp (but too "late" to be used), the second then works. - // Moving this functionality earlier on in the web request pipeline (eg WebRequestCycleForIsis) - // made no difference. - // - // what might help is using some sort of daemon process to monitor when the class files change, and then - // reload (a la JRebel). Don't think DCEVM by itself is enough, but possibly using - // https://github.com/fakereplace/fakereplace or https://github.com/spring-projects/spring-loaded - // might instead suffice since they provide a java agent similar to JRebel. - // - if(!getDeploymentType().isProduction()) { - getSpecificationLoader().invalidateCacheFor(objectAdapter.getObject()); + final ObjectLayoutMetadataFacet facet = entityModel.getTypeOfSpecification() + .getFacet(ObjectLayoutMetadataFacet.class); + if(facet != null) { + // the facet should always exist + // + // it's sufficient to simply call reloadMetadata(). + // The facet checks the ObjectLayoutMetadataService to determine if dynamic reloading is enabled. + facet.reloadMetadata(); } + if(titleString == null) { final String titleStr = objectAdapter.titleString(null); setTitle(titleStr);