isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1371197 [4/4] - in /incubator/isis/trunk: examples/quickstart/dom/src/main/java/dom/todo/ framework/core/commons/src/main/java/org/apache/isis/core/commons/base64/ framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapt...
Date Thu, 09 Aug 2012 13:18:21 GMT
Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java?rev=1371197&r1=1371196&r2=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
Thu Aug  9 13:18:18 2012
@@ -27,15 +27,17 @@ import com.google.common.collect.Maps;
 import org.apache.wicket.PageParameters;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.adapter.oid.stringable.OidStringifier;
 import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PageParameterNames;
 import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
-import org.apache.isis.viewer.wicket.model.mementos.SpecMemento;
 
 /**
  * Backing model to represent a {@link ObjectAdapter}.
@@ -47,6 +49,8 @@ import org.apache.isis.viewer.wicket.mod
 public class EntityModel extends ModelAbstract<ObjectAdapter> {
 
     private static final long serialVersionUID = 1L;
+    
+    private static final OidMarshaller oidMarshaller  = new OidMarshaller();
 
     // //////////////////////////////////////////////////////////
     // factory methods for PageParameters
@@ -61,14 +65,16 @@ public class EntityModel extends ModelAb
         final PageParameters pageParameters = new PageParameters();
 
         final Boolean persistent = adapter.representsPersistent();
-        PageParameterNames.OBJECT_PERSISTENT.addTo(pageParameters, persistent.toString());
+        //PageParameterNames.OBJECT_PERSISTENT.addTo(pageParameters, persistent.toString());
 
         if (persistent) {
-            final String oidStr = oidStringifier.enString((RootOid) adapter.getOid());
-            final ObjectSpecification noSpec = adapter.getSpecification();
+            //final String oidStr = oidStringifier.enString((RootOid) adapter.getOid());
+            final String oidStr = oidMarshaller.marshal((RootOid) adapter.getOid());
 
             PageParameterNames.OBJECT_OID.addTo(pageParameters, oidStr);
-            PageParameterNames.OBJECT_SPEC.addTo(pageParameters, noSpec.getFullIdentifier());
+            
+            //final ObjectSpecification noSpec = adapter.getSpecification();
+            //PageParameterNames.OBJECT_SPEC.addTo(pageParameters, noSpec.getFullIdentifier());
         } else {
             // don't do anything; instead the page should be redirected back to
             // an EntityPage so that the underlying EntityModel that contains
@@ -99,8 +105,8 @@ public class EntityModel extends ModelAb
     public EntityModel() {
     }
 
-    public EntityModel(final PageParameters pageParameters, final OidStringifier oidStringifier)
{
-        this(ObjectAdapterMemento.createPersistent(oidStringifier.deString(PageParameterNames.OBJECT_OID.getFrom(pageParameters)),
SpecMemento.representing(PageParameterNames.OBJECT_SPEC.getFrom(pageParameters))));
+    public EntityModel(final PageParameters pageParameters) {
+        this(ObjectAdapterMemento.createPersistent(rootOidFrom(pageParameters)));
     }
 
     public EntityModel(final ObjectAdapter adapter) {
@@ -112,6 +118,15 @@ public class EntityModel extends ModelAb
         this.adapterMemento = adapterMemento;
     }
 
+    private static String oidStr(final PageParameters pageParameters) {
+        return PageParameterNames.OBJECT_OID.getFrom(pageParameters);
+    }
+
+    private static RootOid rootOidFrom(final PageParameters pageParameters) {
+        return oidMarshaller.unmarshal(oidStr(pageParameters), RootOid.class);
+    }
+    
+
     // //////////////////////////////////////////////////////////
     // ObjectAdapterMemento, typeOfSpecification
     // //////////////////////////////////////////////////////////
@@ -128,9 +143,13 @@ public class EntityModel extends ModelAb
         if (adapterMemento == null) {
             return null;
         }
-        return adapterMemento.getSpecMemento().getSpecification();
+        return getSpecificationFor(adapterMemento.getObjectSpecId());
     }
 
+    private ObjectSpecification getSpecificationFor(ObjectSpecId objectSpecId) {
+        return IsisContext.getSpecificationLoader().lookupBySpecId(objectSpecId);
+    }
+    
     // //////////////////////////////////////////////////////////
     // load, setObject
     // //////////////////////////////////////////////////////////
@@ -153,7 +172,7 @@ public class EntityModel extends ModelAb
     public void detach() {
         if (isAttached()) {
             if (adapterMemento != null) {
-                adapterMemento.captureTitleHintIfPossible(adapterMemento.getObjectAdapter());
+                adapterMemento.captureTitleHintIfPossible();
             }
         }
         super.detach();

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java?rev=1371197&r1=1371196&r2=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ScalarModel.java
Thu Aug  9 13:18:18 2012
@@ -34,6 +34,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
@@ -41,6 +42,7 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.viewer.wicket.model.mementos.ActionParameterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
+import org.apache.isis.viewer.wicket.model.mementos.SpecUtils;
 import org.apache.isis.viewer.wicket.model.util.ClassLoaders;
 
 /**
@@ -64,7 +66,8 @@ public class ScalarModel extends EntityM
 
             @Override
             public ObjectSpecification getScalarTypeSpec(final ScalarModel scalarModel) {
-                return scalarModel.getPropertyMemento().getType().getSpecification();
+                ObjectSpecId type = scalarModel.getPropertyMemento().getType();
+                return SpecUtils.getSpecificationFor(type);
             }
 
             @Override
@@ -74,7 +77,8 @@ public class ScalarModel extends EntityM
 
             @Override
             public String getLongName(final ScalarModel scalarModel) {
-                final String specShortName = scalarModel.parentObjectAdapterMemento.getSpecMemento().getSpecification().getShortIdentifier();
+                ObjectSpecId objectSpecId = scalarModel.parentObjectAdapterMemento.getObjectSpecId();
+                final String specShortName = SpecUtils.getSpecificationFor(objectSpecId).getShortIdentifier();
                 return specShortName + "-" + scalarModel.getPropertyMemento().getProperty().getId();
             }
 
@@ -165,7 +169,8 @@ public class ScalarModel extends EntityM
                     // shouldn't happen
                     return null;
                 }
-                final String specShortName = adapterMemento.getSpecMemento().getSpecification().getShortIdentifier();
+                ObjectSpecId objectSpecId = adapterMemento.getObjectSpecId();
+                final String specShortName = SpecUtils.getSpecificationFor(objectSpecId).getShortIdentifier();
                 final String parmId = scalarModel.getParameterMemento().getActionParameter().getIdentifier().toNameIdentityString();
                 return specShortName + "-" + parmId + "-" + scalarModel.getParameterMemento().getNumber();
             }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/util/Mementos.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/util/Mementos.java?rev=1371197&r1=1371196&r2=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/util/Mementos.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/util/Mementos.java
Thu Aug  9 13:18:18 2012
@@ -22,6 +22,7 @@ package org.apache.isis.viewer.wicket.mo
 import com.google.common.base.Function;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
@@ -34,19 +35,18 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.mementos.CollectionMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
-import org.apache.isis.viewer.wicket.model.mementos.SpecMemento;
 
 public final class Mementos {
 
     private Mementos() {
     }
 
-    public static Function<ObjectSpecification, SpecMemento> fromSpec() {
-        return new Function<ObjectSpecification, SpecMemento>() {
+    public static Function<ObjectSpecification, ObjectSpecId> fromSpec() {
+        return new Function<ObjectSpecification, ObjectSpecId>() {
 
             @Override
-            public SpecMemento apply(final ObjectSpecification from) {
-                return new SpecMemento(from);
+            public ObjectSpecId apply(final ObjectSpecification from) {
+                return from.getSpecId();
             }
         };
     }

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/PropCollForm.css
(from r1371153, incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/PropCollForm.css?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/PropCollForm.css&p1=incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js&r1=1371153&r2=1371197&rev=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/propcoll/PropCollForm.css
Thu Aug  9 13:18:18 2012
@@ -16,7 +16,3 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-$(document).ready(function()
-{
-    $(".message-header").fadeOut(2000)
-});
\ No newline at end of file

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuItemPanel.css
(from r1371153, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuItemPanel.css?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuItemPanel.css&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java&r1=1371153&r2=1371197&rev=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuItemPanel.css
Thu Aug  9 13:18:18 2012
@@ -1,26 +1,20 @@
-/*
- *  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.runtimes.dflt.runtime.persistence;
-
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionHydrator;
-
-public interface PersistenceSessionHydratorAware {
-    void setHydrator(PersistenceSessionHydrator hydrator);
-}
+/*
+ *  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.
+ */
+
+ 
\ No newline at end of file

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssSubMenuItemsPanel.css
(from r1371153, incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssSubMenuItemsPanel.css?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssSubMenuItemsPanel.css&p1=incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js&r1=1371153&r2=1371197&rev=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/resources/htmlviewer.js (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssSubMenuItemsPanel.css
Thu Aug  9 13:18:18 2012
@@ -1,22 +1,20 @@
-/*
- *  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.
- */
-$(document).ready(function()
-{
-    $(".message-header").fadeOut(2000)
-});
\ No newline at end of file
+/*
+ *  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.
+ */
+
+ 
\ No newline at end of file

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/ValueChoicesPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/ValueChoicesPanel.java?rev=1371197&r1=1371196&r2=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/ValueChoicesPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/ValueChoicesPanel.java
Thu Aug  9 13:18:18 2012
@@ -176,7 +176,8 @@ public class ValueChoicesPanel extends S
 
     private DropDownChoicesForValueMementos createDropDownChoices(final IModel<List<?
extends ObjectAdapterMemento>> choicesMementos, final IModel<ObjectAdapterMemento>
modelObject) {
         final String id = ID_VALUE_ID;
-        return new DropDownChoicesForValueMementos(id, modelObject, choicesMementos);
+        DropDownChoicesForValueMementos dropDownChoices = new DropDownChoicesForValueMementos(id,
modelObject, choicesMementos);
+        return dropDownChoices;
     }
 
     @Override

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java?rev=1371197&r1=1371196&r2=1371197&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
Thu Aug  9 13:18:18 2012
@@ -36,7 +36,7 @@ public class EntityPage extends PageAbst
 
     public EntityPage(final PageParameters pageParameters) {
         super(pageParameters, ComponentType.ENTITY);
-        final IModel<?> model = new EntityModel(getPageParameters(), getOidStringifier());
+        final IModel<?> model = new EntityModel(getPageParameters());
         addChildComponents(model);
     }
 



Mime
View raw message