incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1390176 [1/2] - in /incubator/isis/trunk/framework/viewer/wicket: ./ wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/ wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ wicket-ui/src/main/java/or...
Date Tue, 25 Sep 2012 21:49:53 GMT
Author: danhaywood
Date: Tue Sep 25 21:49:52 2012
New Revision: 1390176

URL: http://svn.apache.org/viewvc?rev=1390176&view=rev
Log:
ISIS-232: adding breadcrumb support

Added:
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkableModel.java
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.css
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.html
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.java
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/icontitle/EntityIconAndTitlePanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanelFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.css
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.html
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanelFactory.java
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/BookmarkedPagesModelProvider.java
      - copied, changed from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
Removed:
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageType.java
Modified:
    incubator/isis/trunk/framework/viewer/wicket/pom.xml
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuLinkFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/icontitle/EntityIconAndTitlePanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jdkmath/JavaMathBigIntegerPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_Pages.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_RegistrationAndCaching.java

Modified: incubator/isis/trunk/framework/viewer/wicket/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/pom.xml?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/pom.xml (original)
+++ incubator/isis/trunk/framework/viewer/wicket/pom.xml Tue Sep 25 21:49:52 2012
@@ -229,7 +229,8 @@
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-log4j12</artifactId>
-				<version>1.5.8</version>
+				<!-- NOT SURE WHY THIS ISN'T INHERITED -->
+				<version>1.6.4</version>
 			</dependency>
 
 			<dependency>

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java Tue Sep 25 21:49:52 2012
@@ -19,6 +19,14 @@
 
 package org.apache.isis.viewer.wicket.model.mementos;
 
+import java.util.List;
+import org.apache.wicket.util.string.StringValue;
+
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
@@ -52,7 +60,7 @@ public enum PageParameterNames {
     /**
      * 
      */
-    ACTION_NAME_PARMS, 
+    ACTION_ID, 
     
     /**
      * 
@@ -71,7 +79,22 @@ public enum PageParameterNames {
      * In the format N=OBJECT_OID, where N is the 0-based action parameter
      * index.
      */
-    ACTION_PARAM_CONTEXT;
+    ACTION_PARAM_CONTEXT,
+
+    /**
+     * To render as the page title
+     */
+    PAGE_TITLE,
+
+    /**
+     * Whether this bookmarks an action or entity, etc, as per {@link BookmarkablePageType}.
+     */
+    PAGE_TYPE,
+    
+    /**
+     * Action argument(s), if known.
+     */
+    ACTION_ARGS;
 
     /**
      * Returns the {@link #name()} formatted as
@@ -85,13 +108,37 @@ public enum PageParameterNames {
         return Strings.toCamelCase(name());
     }
 
-    public String getFrom(final PageParameters pageParameters) {
-        //return pageParameters.getString(this.toString());
-        return pageParameters.get(this.toString()).toString();
+    public String getStringFrom(final PageParameters pageParameters) {
+        return getStringFrom(pageParameters, null);
     }
 
-    public void addTo(final PageParameters pageParameters, final String value) {
+    public String getStringFrom(PageParameters pageParameters, String defaultValue) {
+        return pageParameters.get(this.toString()).toString(defaultValue);
+    }
+
+    public <T extends Enum<T>> T getEnumFrom(PageParameters pageParameters, Class<T> enumClass) {
+        String value = getStringFrom(pageParameters);
+        return value != null? Enum.valueOf(enumClass, value): null;
+    }
+
+    public List<String> getListFrom(PageParameters pageParameters) {
+        return Lists.transform(pageParameters.getValues(this.toString()), new Function<StringValue, String>() {
+            @Override
+            public String apply(@Nullable StringValue input) {
+                return input.toString();
+            }
+        });
+    }
+
+
+    public void addStringTo(final PageParameters pageParameters, final String value) {
         pageParameters.add(this.toString(), value);
     }
 
+    public void addEnumTo(final PageParameters pageParameters, final Enum<?> someEnum) {
+        addStringTo(pageParameters, someEnum.name());
+    }
+
+
+
 }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.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/ActionModel.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/ActionModel.java Tue Sep 25 21:49:52 2012
@@ -19,6 +19,7 @@
 
 package org.apache.isis.viewer.wicket.model.models;
 
+import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.regex.Matcher;
@@ -36,6 +37,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
 import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.spec.ActionType;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -55,9 +57,11 @@ import org.apache.isis.viewer.wicket.mod
  * action's {@link Mode#PARAMETERS parameters}, or the handling of the
  * {@link Mode#RESULTS results} once invoked.
  */
-public class ActionModel extends ModelAbstract<ObjectAdapter> {
+public class ActionModel extends BookmarkableModel<ObjectAdapter> {
 
     private static final long serialVersionUID = 1L;
+    
+    private static final String NULL_ARG = "$nullArg$";
 
     /**
      * Whether we are obtaining arguments (eg in a dialog), or displaying the
@@ -103,31 +107,65 @@ public class ActionModel extends ModelAb
      * see {@link #ActionModel(PageParameters)}
      */
     public static PageParameters createPageParameters(final ObjectAdapter adapter, final ObjectAction objectAction, final ObjectAdapter contextAdapter, final SingleResultsMode singleResultsMode) {
-        final PageParameters pageParameters = EntityModel.createPageParameters(adapter);
+        
+        final boolean persistent = adapter.representsPersistent();
+        if (!persistent) {
+            // REVIEW: can this happen?
+            return new PageParameters();
+        }
 
-        final String actionType = objectAction.getType().name();
-        final String actionNameParmsId = determineActionId(objectAction);
+        final PageParameters pageParameters = createPageParameters(adapter, objectAction, singleResultsMode);
 
         final Mode actionMode = determineActionMode(objectAction, contextAdapter);
+        PageParameterNames.ACTION_MODE.addEnumTo(pageParameters, actionMode);
+
+        addActionParamContextIfPossible(objectAction, contextAdapter, pageParameters);
+        return pageParameters;
+    }
+
+    private static PageParameters createPageParameters(final ObjectAdapter adapter, final ObjectAction objectAction, final SingleResultsMode singleResultsMode) {
+        final PageParameters pageParameters = new PageParameters();
+
+        final String oidStr = adapter.getOid().enString(getOidMarshaller());
+        PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
+
+        final ActionType actionType = objectAction.getType();
+        final String actionId = determineActionId(objectAction);
 
-        PageParameterNames.ACTION_TYPE.addTo(pageParameters, actionType);
+        PageParameterNames.PAGE_TYPE.addEnumTo(pageParameters, PageType.ACTION);
+
+        PageParameterNames.ACTION_TYPE.addEnumTo(pageParameters, actionType);
         final ObjectSpecification actionOnTypeSpec = objectAction.getOnType();
         if (actionOnTypeSpec != null) {
-            PageParameterNames.ACTION_OWNING_SPEC.addTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
+            PageParameterNames.ACTION_OWNING_SPEC.addStringTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
         }
 
-        PageParameterNames.ACTION_NAME_PARMS.addTo(pageParameters, actionNameParmsId);
-        PageParameterNames.ACTION_MODE.addTo(pageParameters, actionMode.name());
-        PageParameterNames.ACTION_SINGLE_RESULTS_MODE.addTo(pageParameters, singleResultsMode.name());
+        PageParameterNames.ACTION_ID.addStringTo(pageParameters, actionId);
+        
+        PageParameterNames.ACTION_SINGLE_RESULTS_MODE.addEnumTo(pageParameters, singleResultsMode);
 
-        addActionParamContextIfPossible(objectAction, contextAdapter, pageParameters);
+        PageParameterNames.PAGE_TITLE.addStringTo(pageParameters, actionId);
+        return pageParameters;
+    }
+
+    public PageParameters asPageParameters() {
+        final ObjectAdapter adapter = getTargetAdapter();
+        final ObjectAction objectAction = getActionMemento().getAction();
+        final PageParameters pageParameters = createPageParameters(adapter, objectAction, SingleResultsMode.REDIRECT);
+        
+        // capture argument values
+        ObjectAdapter[] argumentsAsArray = getArgumentsAsArray();
+        for(ObjectAdapter argumentAdapter: argumentsAsArray) {
+            final String encodedArg = encodeArg(argumentAdapter);
+            PageParameterNames.ACTION_ARGS.addStringTo(pageParameters, encodedArg);    
+        }
+        
         return pageParameters;
     }
 
     private static Mode determineActionMode(final ObjectAction objectAction, final ObjectAdapter contextAdapter) {
         return objectAction.promptForParameters(contextAdapter)?Mode.PARAMETERS:Mode.RESULTS;
     }
-    
 
 	private static void addActionParamContextIfPossible(final ObjectAction objectAction, final ObjectAdapter contextAdapter, final PageParameters pageParameters) {
         if (contextAdapter == null) {
@@ -140,20 +178,20 @@ public class ActionModel extends ModelAb
         for (final ObjectActionParameter actionParam : objectAction.getParameters()) {
             if (ActionParams.compatibleWith(contextAdapter, actionParam)) {
                 final String oidKeyValue = "" + i + "=" + contextAdapter.getOid().enString(getOidMarshaller());
-                PageParameterNames.ACTION_PARAM_CONTEXT.addTo(pageParameters, oidKeyValue);
+                PageParameterNames.ACTION_PARAM_CONTEXT.addStringTo(pageParameters, oidKeyValue);
                 return;
             }
             i++;
         }
     }
 
-    private static String determineActionId(final ObjectAction noAction) {
-        final Identifier identifier = noAction.getIdentifier();
+    private static String determineActionId(final ObjectAction objectAction) {
+        final Identifier identifier = objectAction.getIdentifier();
         if (identifier != null) {
             return identifier.toNameParmsIdentityString();
         }
         // fallback (used for action sets)
-        return noAction.getId();
+        return objectAction.getId();
     }
 
     public static Mode determineMode(final ObjectAction action) {
@@ -175,8 +213,9 @@ public class ActionModel extends ModelAb
     private ActionExecutor executor;
 
     private ActionModel(final PageParameters pageParameters) {
-        this(newObjectAdapterMementoFrom(pageParameters), newActionMementoFrom(pageParameters), actionModeFor(pageParameters), singleResultsModeFor(pageParameters));
+        this(newObjectAdapterMementoFrom(pageParameters), newActionMementoFrom(pageParameters), PageParameterNames.ACTION_MODE.getEnumFrom(pageParameters, Mode.class), PageParameterNames.ACTION_SINGLE_RESULTS_MODE.getEnumFrom(pageParameters, SingleResultsMode.class));
 
+        setArgumentsIfPossible(pageParameters);
         setContextArgumentIfPossible(pageParameters);
 
         // TODO: if #args < param count, then change the actionMode
@@ -193,27 +232,10 @@ public class ActionModel extends ModelAb
     }
 
     private static ActionMemento newActionMementoFrom(final PageParameters pageParameters) {
-        return new ActionMemento(actionOwningSpecFor(pageParameters), actionTypeFor(pageParameters), actionNameParmsFor(pageParameters));
-    }
-
-    private static SingleResultsMode singleResultsModeFor(final PageParameters pageParameters) {
-        return SingleResultsMode.valueOf(PageParameterNames.ACTION_SINGLE_RESULTS_MODE.getFrom(pageParameters));
-    }
-
-    private static Mode actionModeFor(final PageParameters pageParameters) {
-        return Mode.valueOf(PageParameterNames.ACTION_MODE.getFrom(pageParameters));
-    }
-
-    private static String actionNameParmsFor(final PageParameters pageParameters) {
-        return PageParameterNames.ACTION_NAME_PARMS.getFrom(pageParameters);
-    }
-
-    private static ActionType actionTypeFor(final PageParameters pageParameters) {
-        return ActionType.valueOf(PageParameterNames.ACTION_TYPE.getFrom(pageParameters));
-    }
-
-    private static ObjectSpecId actionOwningSpecFor(final PageParameters pageParameters) {
-        return ObjectSpecId.of(PageParameterNames.ACTION_OWNING_SPEC.getFrom(pageParameters));
+        final ObjectSpecId owningSpec = ObjectSpecId.of(PageParameterNames.ACTION_OWNING_SPEC.getStringFrom(pageParameters));
+        final ActionType actionType = PageParameterNames.ACTION_TYPE.getEnumFrom(pageParameters, ActionType.class);
+        final String actionNameParms = PageParameterNames.ACTION_ID.getStringFrom(pageParameters);
+        return new ActionMemento(owningSpec, actionType, actionNameParms);
     }
 
     private static ObjectAdapterMemento newObjectAdapterMementoFrom(final PageParameters pageParameters) {
@@ -227,7 +249,7 @@ public class ActionModel extends ModelAb
     }
 
     private static RootOid oidFor(final PageParameters pageParameters) {
-        String oidStr = PageParameterNames.OBJECT_OID.getFrom(pageParameters);
+        String oidStr = PageParameterNames.OBJECT_OID.getStringFrom(pageParameters);
         return getOidMarshaller().unmarshal(oidStr, RootOid.class);
     }
 
@@ -238,13 +260,27 @@ public class ActionModel extends ModelAb
         this.singleResultsMode = singleResultsMode;
     }
 
+    private void setArgumentsIfPossible(final PageParameters pageParameters) {
+        List<String> args = PageParameterNames.ACTION_ARGS.getListFrom(pageParameters);
+
+        final ObjectAction action = actionMemento.getAction();
+        final List<ObjectSpecification> parameterTypes = action.getParameterTypes();
+
+        for (int paramNum = 0; paramNum < args.size(); paramNum++) {
+            String encoded = args.get(paramNum);
+            setArgument(paramNum, parameterTypes.get(paramNum), encoded);
+        }
+    }
+
     private boolean setContextArgumentIfPossible(final PageParameters pageParameters) {
-        final String paramContext = PageParameterNames.ACTION_PARAM_CONTEXT.getFrom(pageParameters);
+        final String paramContext = PageParameterNames.ACTION_PARAM_CONTEXT.getStringFrom(pageParameters);
         if (paramContext == null) {
             return false;
         }
+
         final ObjectAction action = actionMemento.getAction();
-        final int parameterCount = action.getParameterCount();
+        final List<ObjectSpecification> parameterTypes = action.getParameterTypes();
+        final int parameterCount = parameterTypes.size();
 
         final Map.Entry<Integer, String> mapEntry = parse(paramContext);
 
@@ -253,24 +289,55 @@ public class ActionModel extends ModelAb
             return false;
         }
 
-        RootOid oid;
-        try {
-            oid = RootOidDefault.deStringEncoded(mapEntry.getValue(), getOidMarshaller());
-        } catch (final Exception e) {
-            return false;
+        final String encoded = mapEntry.getValue();
+        setArgument(paramNum, parameterTypes.get(paramNum), encoded);
+
+        return true;
+    }
+
+    private void setArgument(final int paramNum, final ObjectSpecification argSpec, final String encoded) {
+        final ObjectAdapter argumentAdapter = decodeArg(argSpec, encoded);
+        setArgument(paramNum, argumentAdapter);
+    }
+
+    private String encodeArg(ObjectAdapter adapter) {
+        if(adapter == null) {
+            return NULL_ARG;
         }
+        
+        ObjectSpecification objSpec = adapter.getSpecification();
+        if(objSpec.isEncodeable()) {
+            EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
+            return encodeable.toEncodedString(adapter);
+        }
+        
+        return adapter.getOid().enString(getOidMarshaller());
+    }
 
-        final ObjectAdapter argumentAdapter = getAdapterManager().adapterFor(oid);
-        if (argumentAdapter == null) {
-            return false;
+    private ObjectAdapter decodeArg(ObjectSpecification objSpec, String encoded) {
+        if(NULL_ARG.equals(encoded)) {
+            return null;
         }
+        
+        if(objSpec.isEncodeable()) {
+            EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
+            return encodeable.fromEncodedString(encoded);
+        }
+        
+        try {
+            final RootOid oid = RootOidDefault.deStringEncoded(encoded, getOidMarshaller());
+            return getAdapterManager().adapterFor(oid);
+        } catch (final Exception e) {
+            return null;
+        }
+    }
 
+    private void setArgument(final int paramNum, final ObjectAdapter argumentAdapter) {
+        final ObjectAction action = actionMemento.getAction();
         final ObjectActionParameter actionParam = action.getParameters().get(paramNum);
         final ActionParameterMemento apm = new ActionParameterMemento(actionParam);
         final ScalarModel argumentModel = getArgumentModel(apm);
         argumentModel.setObject(argumentAdapter);
-
-        return true;
     }
 
     public static Entry<Integer, String> parse(final String paramContext) {
@@ -340,18 +407,6 @@ public class ActionModel extends ModelAb
         return actionMemento;
     }
 
-//    @Override
-//    public ObjectAdapter getObject() {
-//        return reExecute();
-//    }
-
-    private ObjectAdapter reExecute() {
-        detach(); // force re-execute
-        final ObjectAdapter result = super.getObject();
-        arguments.clear();
-        return result;
-    }
-
     @Override
     protected ObjectAdapter load() {
         
@@ -361,9 +416,6 @@ public class ActionModel extends ModelAb
         final ObjectAdapter results = executeAction();
         this.actionMode = Mode.RESULTS;
         
-        // from getObject()/reExecute
-        arguments.clear();
-        
         return results;
     }
 
@@ -442,6 +494,9 @@ public class ActionModel extends ModelAb
         this.actionMode = determineMode(actionMemento.getAction());
     }
 
+    public void clearArguments() {
+        arguments.clear();
+    }
     
     //////////////////////////////////////////////////
     // Dependencies (from context)
@@ -452,4 +507,5 @@ public class ActionModel extends ModelAb
     }
 
 
+
 }

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkableModel.java (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.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/BookmarkableModel.java?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkableModel.java&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkableModel.java Tue Sep 25 21:49:52 2012
@@ -1,35 +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.viewer.wicket.ui.pages;
-
-import org.apache.wicket.Page;
-
-/**
- * Registry of the {@link Page} class to use for each {@link PageType}.
- */
-public interface PageClassRegistry {
-
-    /**
-     * Used by <tt>WicketObjectsApplication</tt> to lookup pages from the
-     * registry.
-     */
-    public Class<? extends Page> getPageClass(PageType pageType);
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.viewer.wicket.model.models;
+
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public abstract class BookmarkableModel<T> extends ModelAbstract<T>  {
+
+    private static final long serialVersionUID = 1L;
+
+    public BookmarkableModel() {
+        super();
+    }
+
+    public BookmarkableModel(T t) {
+        super(t);
+    }
+
+    /**
+     * So can be bookmarked / added to <tt>BookmarkedPagesModel</tt>.
+     */
+    public abstract PageParameters asPageParameters();
+    
+}

Added: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.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/BookmarkedPagesModel.java?rev=1390176&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java (added)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/BookmarkedPagesModel.java Tue Sep 25 21:49:52 2012
@@ -0,0 +1,79 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.viewer.wicket.model.models;
+
+import java.util.Iterator;
+import java.util.List;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import org.apache.isis.viewer.wicket.model.mementos.PageParameterNames;
+
+
+public class BookmarkedPagesModel extends ModelAbstract<List<PageParameters>> implements Iterable<PageParameters>{
+
+    private static final long serialVersionUID = 1L;
+    
+    private List<PageParameters> list = Lists.newArrayList();
+    private transient PageParameters current;
+    
+    public void bookmarkPage(final BookmarkableModel<?> isisModel) {
+        final PageParameters pageParameters = isisModel.asPageParameters();
+        
+        // ignore if doesn't provide a page type for subsequent disambiguation
+        PageType pageType = PageParameterNames.PAGE_TYPE.getEnumFrom(pageParameters, PageType.class);
+        if(pageType==null) {
+            return;
+        }
+        
+        // ignore if doesn't provide a title for rendering
+        if(PageParameterNames.PAGE_TITLE.getStringFrom(pageParameters)==null) {
+            return;
+        }
+
+        if(!list.contains(pageParameters)) {
+            list.add(pageParameters);
+        }
+        current = pageParameters;
+    }
+
+    @Override
+    protected List<PageParameters> load() {
+        return list;
+    }
+
+    @Override
+    public Iterator<PageParameters> iterator() {
+        return Iterators.unmodifiableIterator(list.iterator());
+    }
+    
+    public boolean isCurrent(PageParameters pageParameters) {
+        return Objects.equal(current, pageParameters);
+    }
+
+    public static String titleFrom(final PageParameters pageParameters) {
+        return PageParameterNames.PAGE_TITLE.getStringFrom(pageParameters);
+    }
+
+}
\ No newline at end of file

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=1390176&r1=1390175&r2=1390176&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 Tue Sep 25 21:49:52 2012
@@ -25,7 +25,6 @@ import java.util.Map;
 import com.google.common.collect.Maps;
 
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.PackageResource;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
@@ -33,7 +32,6 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.facets.object.icon.IconFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
@@ -50,7 +48,7 @@ import org.apache.isis.viewer.wicket.mod
  * So that the model is {@link Serializable}, the {@link ObjectAdapter} is
  * stored as a {@link ObjectAdapterMemento}.
  */
-public class EntityModel extends ModelAbstract<ObjectAdapter> {
+public class EntityModel extends BookmarkableModel<ObjectAdapter> {
 
     private static final long serialVersionUID = 1L;
     
@@ -72,13 +70,16 @@ public class EntityModel extends ModelAb
         if (persistent) {
             final String oidStr = adapter.getOid().enString(getOidMarshaller());
 
-            PageParameterNames.OBJECT_OID.addTo(pageParameters, oidStr);
+            PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
         } else {
             // don't do anything; instead the page should be redirected back to
             // an EntityPage so that the underlying EntityModel that contains
             // the
             // memento for the transient ObjectAdapter can be accessed.
         }
+        
+        PageParameterNames.PAGE_TYPE.addEnumTo(pageParameters, PageType.ENTITY);
+        PageParameterNames.PAGE_TITLE.addStringTo(pageParameters, adapter.titleString());
 
         return pageParameters;
     }
@@ -128,7 +129,7 @@ public class EntityModel extends ModelAb
     }
 
     private static String oidStr(final PageParameters pageParameters) {
-        return PageParameterNames.OBJECT_OID.getFrom(pageParameters);
+        return PageParameterNames.OBJECT_OID.getStringFrom(pageParameters);
     }
 
     private static RootOid rootOidFrom(final PageParameters pageParameters) {
@@ -136,6 +137,16 @@ public class EntityModel extends ModelAb
     }
     
 
+
+    // //////////////////////////////////////////////////////////
+    // asPageParameters
+    // //////////////////////////////////////////////////////////
+
+    @Override
+    public PageParameters asPageParameters() {
+        return createPageParameters(getObject());
+    }
+
     // //////////////////////////////////////////////////////////
     // ObjectAdapterMemento, typeOfSpecification
     // //////////////////////////////////////////////////////////
@@ -201,46 +212,6 @@ public class EntityModel extends ModelAb
         super.detach();
     }
 
-    // hmmm... doesn't seem to be used; get rid of if come back.
-    // I'm guessing the property models stuff below superceded this.
-
-    // ////////////////////////////////////////////////////////////
-    // // child (property) model objects;
-    // ////////////////////////////////////////////////////////////
-    //
-    // public void setChildModelObject(String propertyIdentifier,
-    // ObjectAdapter associatedAdapter) {
-    // ObjectAdapter adapter = getObject();
-    // if (adapter == null) {
-    // // let's fail fast, because this presumably ought not to happen
-    // throw new IllegalStateException(
-    // "no adapter set for the EntityModel");
-    // }
-    // ObjectSpecification noSpec = adapter.getSpecification();
-    // ObjectAssociation association =
-    // noSpec.getAssociation(propertyIdentifier);
-    // if (association == null) {
-    // throw new IllegalArgumentException(String.format(
-    // "Id '%s' does not represent an association in spec '%s'",
-    // propertyIdentifier, noSpec.getFullName()));
-    // }
-    // if (association.isOneToManyAssociation()) {
-    // throw new IllegalArgumentException(String.format(
-    // "Association '%s' is not a property in spec '%s'",
-    // propertyIdentifier, noSpec.getFullName()));
-    // }
-    // OneToOneAssociation property = (OneToOneAssociation) association;
-    //
-    // // TODO: need to add in validation here.
-    // // Also, not sure if should be copying into a pending value rather than
-    // // apply directly.
-    //
-    // if (associatedAdapter != null) {
-    // property.set(adapter, associatedAdapter);
-    // } else {
-    // property.clearAssociation(adapter);
-    // }
-    // }
 
     // //////////////////////////////////////////////////////////
     // PropertyModels
@@ -382,4 +353,5 @@ public class EntityModel extends ModelAb
         return IsisContext.getSpecificationLoader();
     }
 
+
 }

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.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/PageType.java?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistry.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-model/src/main/java/org/apache/isis/viewer/wicket/model/models/PageType.java Tue Sep 25 21:49:52 2012
@@ -17,19 +17,22 @@
  *  under the License.
  */
 
-package org.apache.isis.viewer.wicket.ui.pages;
+package org.apache.isis.viewer.wicket.model.models;
+
 
-import org.apache.wicket.Page;
 
 /**
- * Registry of the {@link Page} class to use for each {@link PageType}.
+ * Enumerates the different types of pages that can be rendered.
+ * 
+ * <p>
+ * Is used by {@link PageClassRegistry} to lookup the concrete page to render
+ * different types of pages. This allows the large-scale structure of page
+ * layout (eg headers, footers) to be altered.
  */
-public interface PageClassRegistry {
-
-    /**
-     * Used by <tt>WicketObjectsApplication</tt> to lookup pages from the
-     * registry.
-     */
-    public Class<? extends Page> getPageClass(PageType pageType);
-
+public enum PageType {
+    SIGN_IN, 
+    HOME, 
+    ABOUT, 
+    ENTITY, 
+    ACTION;
 }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactory.java Tue Sep 25 21:49:52 2012
@@ -70,6 +70,10 @@ public interface ComponentFactory extend
         public boolean exclusively() {
             return exclusively;
         }
+        
+        public static final ApplicationAdvice appliesIf(final boolean b) {
+            return b ? ApplicationAdvice.APPLIES : ApplicationAdvice.DOES_NOT_APPLY;
+        }
     }
 
     /**

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentFactoryAbstract.java Tue Sep 25 21:49:52 2012
@@ -66,11 +66,8 @@ public abstract class ComponentFactoryAb
      */
     protected abstract ApplicationAdvice appliesTo(IModel<?> model);
 
-    /**
-     * Convenenience for subclasses to call from {@link #appliesTo(IModel)}
-     */
     protected final ApplicationAdvice appliesIf(final boolean b) {
-        return b ? ApplicationAdvice.APPLIES : ApplicationAdvice.DOES_NOT_APPLY;
+        return ApplicationAdvice.appliesIf(b);
     }
 
     /**

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/ComponentType.java Tue Sep 25 21:49:52 2012
@@ -21,6 +21,7 @@ package org.apache.isis.viewer.wicket.ui
 
 import org.apache.wicket.Component;
 
+import org.apache.isis.viewer.wicket.model.models.BookmarkableModel;
 import org.apache.isis.viewer.wicket.model.util.Strings;
 
 /**
@@ -122,6 +123,10 @@ public enum ComponentType {
      */
     ACTION,
     /**
+     * Bookmarked link to invoke an action
+     */
+    ACTION_LINK,
+    /**
      * A collection of entities (the value of)
      */
     COLLECTION_CONTENTS,
@@ -136,7 +141,11 @@ public enum ComponentType {
     /**
      * A void result from an action.
      */
-    VOID_RETURN, 
+    VOID_RETURN,
+    /**
+     * A list of {@link IsisModel}s, rendered as a list of links.
+     */
+    RECENT_PAGES, 
     /**
      * Place holder for a component used to represent an unknown model;
      * not used for matching, since the {@link ComponentFactory} implementation

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.css (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.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/actionlink/ActionLinkPanel.css?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.css&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.css Tue Sep 25 21:49:52 2012
@@ -17,15 +17,3 @@
  *  under the License.
  */
 
-package org.apache.isis.viewer.wicket.ui.pages;
-
-import org.apache.wicket.Page;
-
-/**
- * Used by {@link PageClassList} implementations to add pages into the registry.
- */
-public interface PageRegistrySpi {
-
-    public void registerPage(PageType pageType, Class<? extends Page> pageClass);
-
-}

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.html (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.html)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.html?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.html&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.html&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/entity/EntityPage.html (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.html Tue Sep 25 21:49:52 2012
@@ -17,20 +17,15 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"  
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"  
-      xml:lang="en"  
-      lang="en">
-	<wicket:head>
-		<wicket:link>
-			<link href="EntityPage.css" rel="stylesheet" type="text/css"/>
-		</wicket:link>
-	</wicket:head>
+<html>
 	<body>
-		<wicket:extend>
-			<div wicket:id="entity" class="entityPage">
-			</div>
-		</wicket:extend>
+		<wicket:panel>
+		     <span wicket:id="actionLinkWrapper" class="actionLinkWrapper">
+				<a href="#" wicket:id="actionLink">
+					<span wicket:id="actionTitle" class="actionTitle">[action title]</span>
+				</a>
+			</span>
+		</wicket:panel>
 	</body>
 </html>
+

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.java (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/icontitle/EntityIconAndTitlePanel.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/actionlink/ActionLinkPanel.java?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.java&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/icontitle/EntityIconAndTitlePanel.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/icontitle/EntityIconAndTitlePanel.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanel.java Tue Sep 25 21:49:52 2012
@@ -1,147 +1,114 @@
-/*
- *  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.blocks.icontitle;
-
-import java.io.InputStream;
-
-import images.Images;
-
-import com.google.inject.Inject;
-
-import org.apache.wicket.Page;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.IResource;
-import org.apache.wicket.request.resource.PackageResourceReference;
-import org.apache.wicket.request.resource.ResourceReference;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
-import org.apache.isis.viewer.wicket.ui.components.entity.blocks.action.EntityActionLinkFactory;
-import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
-import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
-import org.apache.isis.viewer.wicket.ui.pages.PageType;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.isis.viewer.wicket.ui.util.Links;
-
-/**
- * {@link PanelAbstract Panel} representing the icon and title of an entity,
- * as per the provided {@link EntityModel}.
- */
-public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
-
-    private static final long serialVersionUID = 1L;
-
-    private static final String ID_ENTITY_LINK_WRAPPER = "entityLinkWrapper";
-    private static final String ID_ENTITY_LINK = "entityLink";
-    private static final String ID_ENTITY_TITLE = "entityTitle";
-    private static final String ID_ENTITY_ICON = "entityImage";
-
-    private Label label;
-    private Image image;
-
-    public EntityIconAndTitlePanel(final String id, final EntityModel entityModel) {
-        super(id, entityModel);
-    }
-
-    /**
-     * For the {@link EntityActionLinkFactory}.
-     */
-    public EntityModel getEntityModel() {
-        return getModel();
-    }
-
-    @Override
-    protected void onBeforeRender() {
-        buildGui();
-        super.onBeforeRender();
-    }
-
-    private void buildGui() {
-        addOrReplaceLinkWrapper();
-    }
-
-    private void addOrReplaceLinkWrapper() {
-        final WebMarkupContainer entityLinkWrapper = addOrReplaceLinkWrapper(getModel());
-        addOrReplace(entityLinkWrapper);
-    }
-
-    private WebMarkupContainer addOrReplaceLinkWrapper(final EntityModel entityModel) {
-        final ObjectAdapter adapter = entityModel.getObject();
-
-        final PageParameters pageParameters = EntityModel.createPageParameters(adapter);
-        final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ENTITY);
-        final AbstractLink link = newLink(ID_ENTITY_LINK, pageClass, pageParameters);
-        
-        label = new Label(ID_ENTITY_TITLE, determineTitle());
-        link.add(label);
-
-        final ResourceReference imageResource = imageCache.resourceReferenceFor(adapter);
-        image = new Image(ID_ENTITY_ICON, imageResource) {
-            private static final long serialVersionUID = 1L;
-            @Override
-            protected boolean shouldAddAntiCacheParameter() {
-                return false;
-            }
-        };
-        link.addOrReplace(image);
-        
-        final WebMarkupContainer entityLinkWrapper = new WebMarkupContainer(ID_ENTITY_LINK_WRAPPER);
-        entityLinkWrapper.addOrReplace(link);
-        return entityLinkWrapper;
-    }
-
-    private String determineTitle() {
-        final ObjectAdapter adapter = getModel().getObject();
-         // TODO: i18n
-        return adapter != null ? adapter.titleString() : "(no object)";
-    }
-
-    private AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
-        return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
-    }
-
-    
-    // ///////////////////////////////////////////////////////////////////
-    // Convenience
-    // ///////////////////////////////////////////////////////////////////
-
-    protected PageClassRegistry getPageClassRegistry() {
-        final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor) getApplication();
-        return pcra.getPageClassRegistry();
-    }
-
-
-    // ///////////////////////////////////////////////
-    // Dependency Injection
-    // ///////////////////////////////////////////////
-
-    @Inject
-    private ImageResourceCache imageCache;
-
-    protected ImageResourceCache getImageCache() {
-        return imageCache;
-    }
-
-}
+/*
+ *  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.actionlink;
+
+import java.io.InputStream;
+
+import images.Images;
+
+import com.google.inject.Inject;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.PackageResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
+import org.apache.isis.viewer.wicket.model.models.PageType;
+import org.apache.isis.viewer.wicket.ui.components.entity.blocks.action.EntityActionLinkFactory;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+import org.apache.isis.viewer.wicket.ui.util.Links;
+
+/**
+ * {@link PanelAbstract Panel} representing the icon and title of an entity,
+ * as per the provided {@link EntityModel}.
+ */
+public class ActionLinkPanel extends PanelAbstract<ActionModel> {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String ID_ACTION_LINK_WRAPPER = "actionLinkWrapper";
+    private static final String ID_ACTION_LINK = "actionLink";
+    private static final String ID_ACTION_TITLE = "actionTitle";
+
+    private Label label;
+
+    public ActionLinkPanel(final String id, final ActionModel actionModel) {
+        super(id, actionModel);
+    }
+
+    @Override
+    protected void onBeforeRender() {
+        buildGui();
+        super.onBeforeRender();
+    }
+
+    private void buildGui() {
+        addOrReplaceLinkWrapper();
+    }
+
+    private void addOrReplaceLinkWrapper() {
+        final WebMarkupContainer entityLinkWrapper = addOrReplaceLinkWrapper(getModel());
+        addOrReplace(entityLinkWrapper);
+    }
+
+    private WebMarkupContainer addOrReplaceLinkWrapper(final ActionModel actionModel) {
+
+        final PageParameters pageParameters = actionModel.asPageParameters();
+        final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ACTION);
+        final AbstractLink link = newLink(ID_ACTION_LINK, pageClass, pageParameters);
+        
+        label = new Label(ID_ACTION_TITLE, determineTitle());
+        link.add(label);
+
+        final WebMarkupContainer actionLinkWrapper = new WebMarkupContainer(ID_ACTION_LINK_WRAPPER);
+        actionLinkWrapper.addOrReplace(link);
+        return actionLinkWrapper;
+    }
+
+    private String determineTitle() {
+        return getModel().getActionMemento().getAction().getId();
+    }
+
+    private AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
+        return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
+    }
+
+    
+    // ///////////////////////////////////////////////////////////////////
+    // Convenience
+    // ///////////////////////////////////////////////////////////////////
+
+    protected PageClassRegistry getPageClassRegistry() {
+        final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor) getApplication();
+        return pcra.getPageClassRegistry();
+    }
+
+}

Added: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanelFactory.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/actionlink/ActionLinkPanelFactory.java?rev=1390176&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanelFactory.java (added)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionlink/ActionLinkPanelFactory.java Tue Sep 25 21:49:52 2012
@@ -0,0 +1,59 @@
+/*
+ *  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.actionlink;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+
+import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.ComponentFactory;
+import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+
+/**
+ * {@link ComponentFactory} for {@link ActionLinkPanel}.
+ */
+public class ActionLinkPanelFactory extends ComponentFactoryAbstract {
+
+    private static final long serialVersionUID = 1L;
+
+    public ActionLinkPanelFactory() {
+        super(ComponentType.ACTION_LINK);
+    }
+
+    @Override
+    protected ApplicationAdvice appliesTo(IModel<?> model) {
+        if(!(model instanceof ActionModel)) {
+            return ApplicationAdvice.DOES_NOT_APPLY;
+        }
+        final ActionModel actionModel = (ActionModel) model;
+        final ActionSemantics.Of semantics = actionModel.getActionMemento().getAction().getSemantics();
+        return ApplicationAdvice.appliesIf(semantics == ActionSemantics.Of.SAFE);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final ActionModel actionModel = (ActionModel) model;
+        return new ActionLinkPanel(id, actionModel);
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.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/actions/ActionPanel.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actions/ActionPanel.java Tue Sep 25 21:49:52 2012
@@ -34,11 +34,14 @@ import org.apache.isis.viewer.wicket.mod
 import org.apache.isis.viewer.wicket.model.isis.PersistenceSessionProvider;
 import org.apache.isis.viewer.wicket.model.models.ActionExecutor;
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.BookmarkableModel;
+import org.apache.isis.viewer.wicket.model.models.BookmarkedPagesModel;
 import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.model.models.ValueModel;
 import org.apache.isis.viewer.wicket.ui.ComponentType;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
+import org.apache.isis.viewer.wicket.ui.pages.BookmarkedPagesModelProvider;
 import org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
 
@@ -94,6 +97,15 @@ public class ActionPanel extends PanelAb
         addOrReplace(new Label(ID_ACTION_NAME, Model.of(actionName)));
     }
 
+    protected void bookmarkPage(BookmarkableModel<?> model) {
+        getBookmarkedPagesModel().bookmarkPage(model);
+    }
+
+    private BookmarkedPagesModel getBookmarkedPagesModel() {
+        BookmarkedPagesModelProvider application = (BookmarkedPagesModelProvider) getApplication();
+        return application.getBookmarkedPagesModel();
+    }
+
     @Override
     public void executeActionAndProcessResults() {
 
@@ -114,6 +126,7 @@ public class ActionPanel extends PanelAb
 
             // executes the action
             ObjectAdapter resultAdapter = actionModel.getObject();
+            
             if(resultAdapter == null) {
                 // handle void methods
                 resultAdapter = targetAdapter;
@@ -121,6 +134,8 @@ public class ActionPanel extends PanelAb
 
             final ResultType resultType = ResultType.determineFor(resultAdapter);
             resultType.addResults(this, resultAdapter);
+            
+            bookmarkPage(actionModel);
 
         } catch(ConcurrencyException ex) {
             
@@ -134,6 +149,9 @@ public class ActionPanel extends PanelAb
             resultType.addResults(this, targetAdapter, ex);
 
             return;
+        } finally {
+            final ActionModel actionModel = getActionModel();
+            actionModel.clearArguments();
         }
     }
 

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuLinkFactory.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/appactions/cssmenu/AppActionsCssMenuLinkFactory.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuLinkFactory.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/appactions/cssmenu/AppActionsCssMenuLinkFactory.java Tue Sep 25 21:49:52 2012
@@ -28,11 +28,11 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.PageType;
 import org.apache.isis.viewer.wicket.model.util.Actions;
 import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuLinkFactory;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
-import org.apache.isis.viewer.wicket.ui.pages.PageType;
 import org.apache.isis.viewer.wicket.ui.util.Links;
 
 class AppActionsCssMenuLinkFactory implements CssMenuLinkFactory {

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.css (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.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/bookmarkedpages/BookmarkedPagesPanel.css?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.css&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.css Tue Sep 25 21:49:52 2012
@@ -1,31 +1,30 @@
-/*
- *  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.pages;
-
-import org.apache.wicket.Page;
-
-/**
- * Used by {@link PageClassList} implementations to add pages into the registry.
- */
-public interface PageRegistrySpi {
-
-    public void registerPage(PageType pageType, Class<? extends Page> pageClass);
-
-}
+/*
+ *  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.
+ */
+
+#bookmarkedPagesList {
+	font-size: smaller;
+}
+
+#bookmarkedPagesList span {
+	margin-right: 10px;
+}
+
+.bookmarkedPageItem {
+	display: inline;
+}

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.html (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.html)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.html?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.html&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.html&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/action/ActionPage.html (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.html Tue Sep 25 21:49:52 2012
@@ -1,38 +1,34 @@
-<?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.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"  
-      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"  
-      xml:lang="en"  
-      lang="en">
-	<wicket:head>
-		<wicket:link>
-			<link href="ActionPage.css" rel="stylesheet" type="text/css"/>
-		</wicket:link>
-	</wicket:head>
-	<body>
-		<wicket:extend>
-			<div class="actionPage">
-				<div wicket:id="action">
-				</div>
-			</div>
-		</wicket:extend>
-	</body>
-</html>
+<?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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"  
+      xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"  
+      xml:lang="en"  
+      lang="en">
+	<body>
+		<wicket:panel>
+			<ul id="bookmarkedPagesList">
+			  <li wicket:id="bookmarkedPageItem" class="bookmarkedPageItem">
+			  	<a href="#" wicket:id="bookmarkedPageLink"><span wicket:id="bookmarkedPageTitle">[link title]</span></a>
+		  	  </li>
+			</ul>
+		</wicket:panel>
+	</body>
+</html>

Added: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.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/bookmarkedpages/BookmarkedPagesPanel.java?rev=1390176&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java (added)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanel.java Tue Sep 25 21:49:52 2012
@@ -0,0 +1,75 @@
+/*
+ *  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.bookmarkedpages;
+
+import com.google.inject.Inject;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import org.apache.isis.viewer.wicket.model.mementos.PageParameterNames;
+import org.apache.isis.viewer.wicket.model.models.BookmarkedPagesModel;
+import org.apache.isis.viewer.wicket.model.models.PageType;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+import org.apache.isis.viewer.wicket.ui.util.Links;
+
+public class BookmarkedPagesPanel extends PanelAbstract<BookmarkedPagesModel> {
+
+    private static final long serialVersionUID = 1L;
+    
+    private static final String BOOKMARKED_PAGE_LINK = "bookmarkedPageLink";
+    private static final String BOOKMARKED_PAGE_ITEM = "bookmarkedPageItem";
+    private static final String BOOKMARKED_PAGE_TITLE = "bookmarkedPageTitle";
+
+    @Inject
+    private PageClassRegistry pageClassRegistry;
+
+    public BookmarkedPagesPanel(final String id, final BookmarkedPagesModel bookmarkedPagesModel) {
+        super(id, bookmarkedPagesModel);
+        buildGui();
+    }
+
+    private void buildGui() {
+        final BookmarkedPagesModel bookmarkedPagesModel = getModel();
+        final ListView<PageParameters> listView = new ListView<PageParameters>(BOOKMARKED_PAGE_ITEM, bookmarkedPagesModel) {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            protected void populateItem(ListItem<PageParameters> item) {
+                final PageParameters pageParameters = item.getModelObject();
+                
+                final PageType pageType = PageParameterNames.PAGE_TYPE.getEnumFrom(pageParameters, PageType.class);
+                final Class<? extends Page> pageClass = pageClassRegistry.getPageClass(pageType);
+                
+                final AbstractLink link = Links.newBookmarkablePageLink(BOOKMARKED_PAGE_LINK, pageParameters, pageClass);
+                link.add(new Label(BOOKMARKED_PAGE_TITLE, BookmarkedPagesModel.titleFrom(pageParameters)));
+                item.add(link);
+                link.setEnabled(!bookmarkedPagesModel.isCurrent(pageParameters));
+            }
+        };
+        add(listView);
+    }
+}

Copied: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanelFactory.java (from r1388737, incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.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/bookmarkedpages/BookmarkedPagesPanelFactory.java?p2=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanelFactory.java&p1=incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java&r1=1388737&r2=1390176&rev=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/about/AboutPage.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/bookmarkedpages/BookmarkedPagesPanelFactory.java Tue Sep 25 21:49:52 2012
@@ -1,44 +1,47 @@
-/*
- *  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.pages.about;
-
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-
-import org.apache.isis.viewer.wicket.model.models.AboutModel;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.pages.PageAbstract;
-
-/**
- * Web page representing the about page.
- */
-public class AboutPage extends PageAbstract {
-
-    public AboutPage() {
-        super(new PageParameters(), ComponentType.ABOUT);
-        final IModel<?> model = buildModel();
-        addChildComponents(model);
-    }
-
-    private IModel<?> buildModel() {
-        return new AboutModel();
-    }
-
-}
+/*
+ *  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.bookmarkedpages;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.model.IModel;
+
+import org.apache.isis.viewer.wicket.model.models.BookmarkedPagesModel;
+import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+
+public class BookmarkedPagesPanelFactory extends ComponentFactoryAbstract {
+
+    private static final long serialVersionUID = 1L;
+
+    public BookmarkedPagesPanelFactory() {
+        super(ComponentType.RECENT_PAGES);
+    }
+
+    @Override
+    public ApplicationAdvice appliesTo(final IModel<?> model) {
+        return appliesIf(model instanceof BookmarkedPagesModel);
+    }
+
+    @Override
+    public Component createComponent(final String id, final IModel<?> model) {
+        final BookmarkedPagesModel bookmarkedPagesModel = (BookmarkedPagesModel) model;
+        return new BookmarkedPagesPanel(id, bookmarkedPagesModel);
+    }
+}

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.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/entity/blocks/action/EntityActionLinkFactory.java?rev=1390176&r1=1390175&r2=1390176&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/blocks/action/EntityActionLinkFactory.java Tue Sep 25 21:49:52 2012
@@ -33,6 +33,7 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
 import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ActionModel;
+import org.apache.isis.viewer.wicket.model.models.PageType;
 import org.apache.isis.viewer.wicket.model.models.ActionModel.SingleResultsMode;
 import org.apache.isis.viewer.wicket.model.models.EntityModel;
 import org.apache.isis.viewer.wicket.model.util.Actions;
@@ -42,7 +43,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuLinkFactory;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
-import org.apache.isis.viewer.wicket.ui.pages.PageType;
 import org.apache.isis.viewer.wicket.ui.util.Links;
 
 public final class EntityActionLinkFactory implements CssMenuLinkFactory {



Mime
View raw message