isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1084886 - in /incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher: ./ action/ context/ debug/ edit/ processor/ view/action/ view/debug/ view/edit/ view/simple/
Date Thu, 24 Mar 2011 09:42:41 GMT
Author: rmatthews
Date: Thu Mar 24 09:42:40 2011
New Revision: 1084886

URL: http://svn.apache.org/viewvc?rev=1084886&view=rev
Log:
Change names of Scimpi parameters in action and edit forms so they won't clash with names
of the object's fields. Prefixed them with an underscore (_).

Added a log level element that should allow you to change the log level from within a web
page - need to convince myself this will work consistently.

Improvements to debugging.

Added:
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java
  (with props)
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java
  (with props)
Modified:
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/Dispatcher.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/RequestContext.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugAction.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionButton.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionForm.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionLink.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Debug.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/Dispatcher.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/Dispatcher.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/Dispatcher.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/Dispatcher.java
Thu Mar 24 09:42:40 2011
@@ -56,6 +56,7 @@ import org.apache.isis.viewer.scimpi.dis
 import org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext.Scope;
 import org.apache.isis.viewer.scimpi.dispatcher.debug.DebugAction;
 import org.apache.isis.viewer.scimpi.dispatcher.debug.DebugWriter;
+import org.apache.isis.viewer.scimpi.dispatcher.debug.LogAction;
 import org.apache.isis.viewer.scimpi.dispatcher.edit.EditAction;
 import org.apache.isis.viewer.scimpi.dispatcher.edit.RemoveAction;
 import org.apache.isis.viewer.scimpi.dispatcher.logon.LogonAction;
@@ -428,6 +429,7 @@ public class Dispatcher {
         addAction(new RemoveAction());
         addAction(new LogonAction());
         addAction(new LogoutAction());
+        addAction(new LogAction());
 
         String configFile = getParameter("config");
         if (configFile != null) {

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/action/ActionAction.java
Thu Mar 24 09:42:40 2011
@@ -61,12 +61,12 @@ public class ActionAction implements Act
      */
     @Override
     public void process(RequestContext context) throws IOException {
-        String objectId = context.getParameter(OBJECT);
-        String version = context.getParameter(VERSION);
-        String methodName = context.getParameter(METHOD);
-        String override = context.getParameter(RESULT_OVERRIDE);
-        String resultName = context.getParameter(RESULT_NAME);
-        String message = context.getParameter(MESSAGE);
+        String objectId = context.getParameter("_" + OBJECT);
+        String version = context.getParameter("_" + VERSION);
+        String methodName = context.getParameter("_" + METHOD);
+        String override = context.getParameter("_" + RESULT_OVERRIDE);
+        String resultName = context.getParameter("_" + RESULT_NAME);
+        String message = context.getParameter("_" + MESSAGE);
         resultName = resultName == null ? RequestContext.RESULT : resultName;
         
         FormState entryState = null;
@@ -106,7 +106,7 @@ public class ActionAction implements Act
             } else    */         
             if (entryState.isValid()) {
                 boolean hasResult = invokeMethod(context, resultName, object, action, entryState);
-                String view = context.getParameter(hasResult ? VIEW : VOID);
+                String view = context.getParameter(hasResult ? "_" + VIEW : "_" + VOID);
                 
              //   context.clearVariables(Scope.REQUEST);
 
@@ -144,7 +144,7 @@ public class ActionAction implements Act
                 }
                 */
                 
-                String view = context.getParameter(ERRORS);
+                String view = context.getParameter("_" + ERRORS);
                 context.setRequestPath(view, Dispatcher.ACTION);
                 
                 MessageBroker messageBroker = IsisContext.getMessageBroker();
@@ -166,7 +166,7 @@ public class ActionAction implements Act
                 context.addVariable(RequestContext.ERROR, error, Scope.REQUEST);
             }
             
-            String view = context.getParameter(ERRORS);
+            String view = context.getParameter("_" + ERRORS);
             context.setRequestPath(view, Dispatcher.ACTION);
             
             
@@ -187,7 +187,7 @@ public class ActionAction implements Act
             FormState entryState) {
 
         ObjectAdapter[] parameters = getParameters(action, entryState);
-        String scopeName = context.getParameter(SCOPE);
+        String scopeName = context.getParameter("_" + SCOPE);
         Scope scope = RequestContext.scope(scopeName, Scope.REQUEST);
         return MethodsUtils.runMethod(context, action, object, parameters, variable, scope);
     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/DefaultOidObjectMapping.java
Thu Mar 24 09:42:40 2011
@@ -104,7 +104,7 @@ public class DefaultOidObjectMapping imp
             if (oid instanceof AggregatedOid) {
                 AggregatedOid aoid = (AggregatedOid) oid;
                 Oid parentOid = aoid.getParentOid();
-               String fieldName = aoid.getFieldName();
+                String fieldName = aoid.getId();
                 int element = -1; // aoid.getElement();
                 
                 object = IsisContext.getPersistenceSession().getAdapterManager().getAdapterFor(parentOid);

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/RequestContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/RequestContext.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/RequestContext.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/context/RequestContext.java
Thu Mar 24 09:42:40 2011
@@ -196,8 +196,12 @@ public abstract class RequestContext {
             ObjectAdapter aggregatedAdapter = null;
             outer: for (ObjectAssociation association : parentObject.getSpecification().getAssociations())
{
                 if (association.getSpecification().isAggregated()) {
+                    ObjectAdapter objectAdapter = association.get(parentObject);
+                    if (objectAdapter == null) {
+                        continue;
+                    }
                     if (association.isOneToManyAssociation()) {
-                        ObjectAdapter coll = association.get(parentObject);
+                        ObjectAdapter coll = objectAdapter;
                         CollectionFacet facet = coll.getSpecification().getFacet(CollectionFacet.class);
                         for (ObjectAdapter element : facet.iterable(coll)) {
                             if (element.getOid().equals(aggregatedOid)) {
@@ -206,8 +210,8 @@ public abstract class RequestContext {
                             }
                         }
                     } else {
-                        if (association.get(parentObject).getOid().equals(aggregatedOid))
{
-                            aggregatedAdapter = association.get(parentObject);
+                        if (objectAdapter.getOid().equals(aggregatedOid)) {
+                            aggregatedAdapter = objectAdapter;
                             break;
                         }
                     }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugAction.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugAction.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/DebugAction.java
Thu Mar 24 09:42:40 2011
@@ -27,20 +27,14 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
-import org.apache.isis.applib.filter.Filter;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.debug.DebugString;
 import org.apache.isis.core.commons.debug.DebuggableWithTitle;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.spec.ActionType;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
 import org.apache.isis.runtimes.dflt.runtime.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.util.Dump;
 import org.apache.isis.viewer.scimpi.dispatcher.Action;

Added: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java?rev=1084886&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java
(added)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java
Thu Mar 24 09:42:40 2011
@@ -0,0 +1,70 @@
+/*
+ *  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.scimpi.dispatcher.debug;
+
+import java.io.IOException;
+
+import org.apache.isis.core.commons.authentication.AuthenticationSession;
+import org.apache.isis.core.commons.debug.DebugBuilder;
+import org.apache.isis.viewer.scimpi.dispatcher.Action;
+import org.apache.isis.viewer.scimpi.dispatcher.NotLoggedInException;
+import org.apache.isis.viewer.scimpi.dispatcher.context.RequestContext;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+
+public class LogAction implements Action {
+
+    private static final Logger LOG = Logger.getLogger(LogAction.class);
+
+    public void process(RequestContext context) throws IOException {
+
+        AuthenticationSession session = context.getSession();
+        if (session == null) {
+            throw new NotLoggedInException();
+        }
+
+        
+        String levelName = (String) context.getVariable("level");
+        
+        Level level = Level.toLevel(levelName);
+        boolean changeLogged = false;
+        if (Level.INFO.isGreaterOrEqual(LogManager.getRootLogger().getLevel())) {
+            LOG.info("log level changed to " + level);
+            changeLogged  = true;
+        }
+        LogManager.getRootLogger().setLevel(level);
+        if (!changeLogged) {
+            LOG.info("log level changed to " + level);
+        }
+        String view = (String) context.getVariable("view");
+        context.setRequestPath(view);
+        
+    }
+
+    public String getName() {
+        return "log";
+    }
+
+    public void init() {}
+
+    public void debug(DebugBuilder debug) {}
+
+}

Propchange: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/debug/LogAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/edit/EditAction.java
Thu Mar 24 09:42:40 2011
@@ -60,12 +60,12 @@ public class EditAction implements Actio
         }
         
         try {
-            String objectId = context.getParameter(OBJECT);
-            String version = context.getParameter(VERSION);
-            String resultName = context.getParameter(RESULT_NAME);
+            String objectId = context.getParameter("_" + OBJECT);
+            String version = context.getParameter("_" + VERSION);
+            String resultName = context.getParameter("_" + RESULT_NAME);
             resultName = resultName == null ? RequestContext.RESULT : resultName;
-            String override = context.getParameter(RESULT_OVERRIDE);
-            String message = context.getParameter(MESSAGE);
+            String override = context.getParameter("_" + RESULT_OVERRIDE);
+            String message = context.getParameter("_" + MESSAGE);
             
             ObjectAdapter adapter = context.getMappedObject(objectId);
             
@@ -118,7 +118,7 @@ public class EditAction implements Actio
                 IsisContext.getMessageBroker().addMessage("The " + adapter.getSpecification().getSingularName()
+ " was edited " +
                 		"by another user (" + adapterVersion.getUser() +  "). Please  make your
changes based on their changes.");
 
-                String view = context.getParameter(ERRORS);
+                String view = context.getParameter("_" + ERRORS);
                 context.setRequestPath(view, Dispatcher.EDIT);
                 
                 entryState.setForm(objectId);
@@ -136,7 +136,7 @@ public class EditAction implements Actio
                     context.unmapObject(adapter, Scope.REQUEST);
                 }
 
-                String view = context.getParameter(VIEW);
+                String view = context.getParameter("_" + VIEW);
 
                 String id = context.mapObject(adapter, Scope.REQUEST);
                 context.addVariable(resultName, id, Scope.REQUEST);
@@ -163,7 +163,7 @@ public class EditAction implements Actio
                 }
 
             } else {
-                String view = context.getParameter(ERRORS);
+                String view = context.getParameter("_" + ERRORS);
                 context.setRequestPath(view, Dispatcher.EDIT);
                 
                 entryState.setForm(objectId);

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/processor/ProcessorLookup.java
Thu Mar 24 09:42:40 2011
@@ -40,6 +40,7 @@ import org.apache.isis.viewer.scimpi.dis
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.DebugAccessCheck;
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.DebuggerLink;
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.Diagnostics;
+import org.apache.isis.viewer.scimpi.dispatcher.view.debug.LogLevel;
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.Members;
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.PrintAuthorizationClause;
 import org.apache.isis.viewer.scimpi.dispatcher.view.debug.ShowDebug;
@@ -146,6 +147,7 @@ public class ProcessorLookup {
         addElementProcessor(new IncludeField());
         addElementProcessor(new InitializeFromCookie());
         addElementProcessor(new InitializeFromResult());
+        addElementProcessor(new LogLevel());
         addElementProcessor(new Logon());
         addElementProcessor(new LongFormView());
         addElementProcessor(new LinkField());

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionButton.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionButton.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionButton.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionButton.java
Thu Mar 24 09:42:40 2011
@@ -142,38 +142,38 @@ public class ActionButton extends Abstra
         String classSegment = "class=\"" + (className == null ? "action in-line" : className)
+ "\"";
         request.appendHtml("\n<form " + idSegment + classSegment + " action=\"action.app\"
method=\"post\">\n");
         if (objectId == null) {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + OBJECT + "\" value=\""
+ 
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + OBJECT + "\"
value=\"" + 
                     context.getVariable(RequestContext.RESULT) + "\" />\n");
         } else {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + OBJECT + "\" value=\""
+ objectId + "\" />\n");
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + OBJECT + "\"
value=\"" + objectId + "\" />\n");
         }
-        request.appendHtml("  <input type=\"hidden\" name=\"" + VERSION + "\" value=\""
+ version + "\" />\n");
+        request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + VERSION + "\" value=\""
+ version + "\" />\n");
         if (scope != null) {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + SCOPE + "\" value=\""
+ scope + "\" />\n");
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + SCOPE + "\"
value=\"" + scope + "\" />\n");
         }
-        request.appendHtml("  <input type=\"hidden\" name=\"" + METHOD + "\" value=\""
+ action.getId() + "\" />\n");
+        request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + METHOD + "\" value=\""
+ action.getId() + "\" />\n");
         if (forwardResultTo != null) {
             forwardResultTo = context.fullFilePath(forwardResultTo);
-            request.appendHtml("  <input type=\"hidden\" name=\"" + VIEW + "\" value=\""
+ forwardResultTo + "\" />\n");
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + VIEW + "\" value=\""
+ forwardResultTo + "\" />\n");
         }
         if (forwardErrorTo == null) {
             forwardErrorTo = request.getContext().getResourceFile();
         }
         forwardErrorTo = context.fullFilePath(forwardErrorTo);
-        request.appendHtml("  <input type=\"hidden\" name=\"" + ERRORS + "\" value=\""
+ forwardErrorTo + "\" />\n");
+        request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + ERRORS + "\" value=\""
+ forwardErrorTo + "\" />\n");
         if (forwardVoidTo == null) {
             forwardVoidTo = request.getContext().getResourceFile();
         }
         forwardVoidTo = context.fullFilePath(forwardVoidTo);
-        request.appendHtml("  <input type=\"hidden\" name=\"" + VOID + "\" value=\"" +
forwardVoidTo + "\" />\n");
+        request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + VOID + "\" value=\""
+ forwardVoidTo + "\" />\n");
         if (variable != null) {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + RESULT_NAME + "\"
value=\"" + variable + "\" />\n");
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + RESULT_NAME
+ "\" value=\"" + variable + "\" />\n");
         }
         if (resultOverride != null) {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + RESULT_OVERRIDE +
"\" value=\"" + resultOverride + "\" />\n");            
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + RESULT_OVERRIDE
+ "\" value=\"" + resultOverride + "\" />\n");            
         }
         if (completionMessage != null) {
-            request.appendHtml("  <input type=\"hidden\" name=\"" + MESSAGE + "\" value=\""
+ completionMessage + "\" />\n");                        
+            request.appendHtml("  <input type=\"hidden\" name=\"" + "_" + MESSAGE + "\"
value=\"" + completionMessage + "\" />\n");                        
         }
 
         for (int i = 0; i < parameters.length; i++) {

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionForm.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionForm.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionForm.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionForm.java
Thu Mar 24 09:42:40 2011
@@ -102,17 +102,17 @@ public class ActionForm extends Abstract
         String voidView = context.fullFilePath(parameterObject.forwardVoidTo == null ? context.getResourceFile()
                 : parameterObject.forwardVoidTo);
         HiddenInputField[] hiddenFields = new HiddenInputField[] {
-                new HiddenInputField(OBJECT, objectId),
-                new HiddenInputField(VERSION, version),
-                new HiddenInputField(METHOD, parameterObject.methodName),
-                parameterObject.forwardResultTo == null ? null : new HiddenInputField(VIEW,
context
+                new HiddenInputField("_" + OBJECT, objectId),
+                new HiddenInputField("_" + VERSION, version),
+                new HiddenInputField("_" + METHOD, parameterObject.methodName),
+                parameterObject.forwardResultTo == null ? null : new HiddenInputField("_"
+ VIEW, context
                         .fullFilePath(parameterObject.forwardResultTo)),
-                new HiddenInputField(VOID, voidView),
-                new HiddenInputField(ERRORS, errorView),
-                parameterObject.completionMessage == null ? null : new HiddenInputField(MESSAGE,
parameterObject.completionMessage),
-                parameterObject.scope == null ? null : new HiddenInputField(SCOPE, parameterObject.scope),
-                parameterObject.resultOverride == null ? null : new HiddenInputField(RESULT_OVERRIDE,
parameterObject.resultOverride),
-                parameterObject.resultName == null ? null : new HiddenInputField(RESULT_NAME,
parameterObject.resultName),
+                new HiddenInputField("_" + VOID, voidView),
+                new HiddenInputField("_" + ERRORS, errorView),
+                parameterObject.completionMessage == null ? null : new HiddenInputField("_"
+ MESSAGE, parameterObject.completionMessage),
+                parameterObject.scope == null ? null : new HiddenInputField("_" + SCOPE,
parameterObject.scope),
+                parameterObject.resultOverride == null ? null : new HiddenInputField("_"
+ RESULT_OVERRIDE, parameterObject.resultOverride),
+                parameterObject.resultName == null ? null : new HiddenInputField("_" + RESULT_NAME,
parameterObject.resultName),
                 parameterObject.resultName == null ? null : new HiddenInputField(RequestContext.RESULT,
(String) request
                         .getContext().getVariable(RequestContext.RESULT)) };
 

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionLink.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionLink.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionLink.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/action/ActionLink.java
Thu Mar 24 09:42:40 2011
@@ -48,8 +48,8 @@ public class ActionLink extends Abstract
         String completionMessage = request.getOptionalProperty(MESSAGE);
         
         // TODO need a mechanism for globally dealing with encoding; then use the new encode
method
-        String confirmSegment = confirm == null ? "" : "&amp;" + CONFIRM + "=" + URLEncoder.encode(confirm);
-        String messageSegment = completionMessage == null ? "" : "&amp;" + MESSAGE +
"=" + URLEncoder.encode(completionMessage);
+        String confirmSegment = confirm == null ? "" : "&amp;" + "_" + CONFIRM + "="
+ URLEncoder.encode(confirm);
+        String messageSegment = completionMessage == null ? "" : "&amp;" + "_" + MESSAGE
+ "=" + URLEncoder.encode(completionMessage);
 
         RequestContext context = request.getContext();
         ObjectAdapter object = MethodsUtils.findObject(context, objectId);
@@ -93,10 +93,10 @@ public class ActionLink extends Abstract
         }
         
         String interactionParamters = context.encodedInteractionParameters();
-        String forwardResultSegment = forwardResultTo == null ? "" :  "&amp;" + VIEW
+ "=" + context.fullFilePath(forwardResultTo);
+        String forwardResultSegment = forwardResultTo == null ? "" :  "&amp;" + "_" +
VIEW + "=" + context.fullFilePath(forwardResultTo);
         String voidView = context.fullFilePath(forwardVoidTo == null ? context.getResourceFile()
: forwardVoidTo);
-        String forwardVoidSegment = "&amp;" + VOID + "=" + voidView;
-        request.appendHtml("<a href=\"action.app?" + OBJECT + "=" + objectId + "&amp;"
+ VERSION + "=" + version + "&amp;" + METHOD + "=" + method
+        String forwardVoidSegment = "&amp;" + "_" + VOID + "=" + voidView;
+        request.appendHtml("<a href=\"action.app?" + "_" + OBJECT + "=" + objectId + "&amp;"
+ "_" + VERSION + "=" + version + "&amp;" + "_" + METHOD + "=" + method
                 + forwardResultSegment + forwardVoidSegment + resultNameSegment + parameterSegment
+ scopeSegment + confirmSegment + messageSegment + interactionParamters + "\">");
         request.appendHtml(text);
         request.appendHtml("</a>");

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Debug.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Debug.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Debug.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Debug.java
Thu Mar 24 09:42:40 2011
@@ -78,8 +78,10 @@ public class Debug extends AbstractEleme
                 displayContext(request);
              } else if (type.equals("specifications")) {
                 listSpecifications(request);
-            } else if (type.equals("specification")) {
-                specification(request);
+             } else if (type.equals("specification-for")) {
+                 specificationFor(request);
+             } else if (type.equals("specification")) {
+                 specification(request);
 
                 
                 
@@ -137,10 +139,20 @@ public class Debug extends AbstractEleme
 
         }
     }
-
+    
+    protected void specificationFor(Request request) {
+        String id = request.getOptionalProperty(VALUE);
+        ObjectAdapter object = request.getContext().getMappedObjectOrResult(id);
+        specification(request, object.getSpecification());
+    }
+    
     protected void specification(Request request) {
         String name = request.getOptionalProperty(VALUE);
         ObjectSpecification spec = getSpecificationLoader().loadSpecification(name);
+        specification(request, spec);
+    }
+
+    private void specification(Request request, ObjectSpecification spec) {
         request.appendHtml("<h1>Specification - " + spec.getFullIdentifier() + "</h1>");
         DebugBuilder debug = new DebugHtmlString();
         specification(spec, debug);

Added: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java?rev=1084886&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java
(added)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java
Thu Mar 24 09:42:40 2011
@@ -0,0 +1,60 @@
+/*
+ *  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.scimpi.dispatcher.view.debug;
+
+import org.apache.isis.viewer.scimpi.dispatcher.AbstractElementProcessor;
+import org.apache.isis.viewer.scimpi.dispatcher.processor.Request;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+
+
+public class LogLevel extends AbstractElementProcessor {
+    
+    @Override
+    public void process(Request request) {
+        
+        String view = request.getOptionalProperty(VIEW, request.getViewPath());
+        view = request.getContext().fullFilePath(view);
+        Level level = LogManager.getRootLogger().getLevel();
+        boolean showSelector = request.isRequested(SHOW_SELECT, true);
+        if (showSelector) {
+            request.appendHtml("<form action=\"log.app\" type=\"post\" >");
+            request.appendHtml("<input type=\"hidden\" name=\"view\" value=\"" + view
+ "\" />");
+            request.appendHtml("<select name=\"level\">");
+            for(Level l : new Level[]{ Level.OFF, Level.FATAL, Level.ERROR, Level.WARN, Level.INFO,
Level.DEBUG, Level.TRACE }) {
+                String settings = level + "\"" + (level == l ? " selected=\"selected\" "
: "");
+                request.appendHtml("<option " + settings + ">" + l + "</option>");
+            }
+            request.appendHtml("<input type=\"submit\" value=\"Change Level\" />");
+            request.appendHtml("</select>");
+            request.appendHtml("</form>");
+        } else {
+            request.appendHtml(level.toString());
+        }
+    }
+   
+    @Override
+    public String getName() {
+        return "log-level";
+    }
+
+}
+

Propchange: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/LogLevel.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/EditObject.java
Thu Mar 24 09:42:40 2011
@@ -122,14 +122,14 @@ public class EditObject extends Abstract
 
         String errorView = context.fullFilePath(forwardErrorTo == null ? context.getResourceFile()
: forwardErrorTo);
         List<HiddenInputField> hiddenFields = new ArrayList<HiddenInputField>();
-        hiddenFields.add(new HiddenInputField(OBJECT, actualObjectId));
-        hiddenFields.add(new HiddenInputField(VERSION, version));
-        hiddenFields.add(completionMessage == null ? null : new HiddenInputField(MESSAGE,
completionMessage));
-        hiddenFields.add(forwardEditedTo == null ? null : new HiddenInputField(VIEW, context.fullFilePath(forwardEditedTo)));
-        hiddenFields.add(new HiddenInputField(ERRORS, errorView));
-        hiddenFields.add(variable == null ? null : new HiddenInputField(RESULT_NAME, variable));
-        hiddenFields.add(resultOverride == null ? null : new HiddenInputField(RESULT_OVERRIDE,
resultOverride));
-        hiddenFields.add(scope == null ? null : new HiddenInputField(SCOPE, scope));
+        hiddenFields.add(new HiddenInputField("_" + OBJECT, actualObjectId));
+        hiddenFields.add(new HiddenInputField("_" + VERSION, version));
+        hiddenFields.add(completionMessage == null ? null : new HiddenInputField("_" + MESSAGE,
completionMessage));
+        hiddenFields.add(forwardEditedTo == null ? null : new HiddenInputField("_" + VIEW,
context.fullFilePath(forwardEditedTo)));
+        hiddenFields.add(new HiddenInputField("_" + ERRORS, errorView));
+        hiddenFields.add(variable == null ? null : new HiddenInputField("_" + RESULT_NAME,
variable));
+        hiddenFields.add(resultOverride == null ? null : new HiddenInputField("_" + RESULT_OVERRIDE,
resultOverride));
+        hiddenFields.add(scope == null ? null : new HiddenInputField("_" + SCOPE, scope));
 
         if (object.isTransient()) {
             // restore transient details
@@ -207,8 +207,10 @@ public class EditObject extends Abstract
                 formField.setDescription(usable.getReason());
             }
             formField.setEditable(isEditable);
-            boolean notVisible = field.isVisible(session, object).isVetoed() || (!includeUnusableFields
&& usable.isAllowed());
-            if (notVisible) {
+            boolean hiddenField = field.isVisible(session, object).isVetoed();
+            boolean unusable = usable.isVetoed();
+            boolean hideAsUnusable = unusable && !includeUnusableFields;
+            if (hiddenField || hideAsUnusable) {
                 formField.setHidden(true);
             }
         }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java?rev=1084886&r1=1084885&r2=1084886&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/simple/AbstractConditionalBlock.java
Thu Mar 24 09:42:40 2011
@@ -36,7 +36,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.runtimes.dflt.runtime.context.IsisContext;
 import org.apache.isis.viewer.scimpi.dispatcher.AbstractElementProcessor;
 import org.apache.isis.viewer.scimpi.dispatcher.ScimpiException;
-import org.apache.isis.viewer.scimpi.dispatcher.action.Attributes;
 import org.apache.isis.viewer.scimpi.dispatcher.processor.Request;
 import org.apache.isis.viewer.scimpi.dispatcher.util.MethodsUtils;
 



Mime
View raw message