incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1055940 - in /incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher: Dispatcher.java view/debug/Diagnostics.java view/edit/EditObject.java view/edit/FieldFactory.java
Date Thu, 06 Jan 2011 17:04:33 GMT
Author: rmatthews
Date: Thu Jan  6 17:04:33 2011
New Revision: 1055940

URL: http://svn.apache.org/viewvc?rev=1055940&view=rev
Log:
Fixed indication of mandatory fields on action forms

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/view/debug/Diagnostics.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/edit/FieldFactory.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=1055940&r1=1055939&r2=1055940&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 Jan  6 17:04:33 2011
@@ -108,6 +108,8 @@ public class Dispatcher {
                 IsisContext.getPersistenceSession().getTransactionManager().endTransaction();
             }
         } catch (Throwable e) {
+           LOG.error(e.getMessage(), e);
+            
             DebugString error = new DebugString();
             
             List<String> messages =  IsisContext.getMessageBroker().getMessages();

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java?rev=1055940&r1=1055939&r2=1055940&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
Thu Jan  6 17:04:33 2011
@@ -28,18 +28,25 @@ import org.apache.isis.viewer.scimpi.dis
 public class Diagnostics extends AbstractElementProcessor {
 
     public void process(Request request) {
-        if (request.getContext().getDebug() == RequestContext.Debug.ON) {
+        boolean isForced = request.isRequested("force");
+        boolean isExcludeVariables = request.isRequested("exclude-variables");
+        boolean isExcludeProcessing = request.isRequested("exclude-processing");
+        if (isForced || request.getContext().getDebug() == RequestContext.Debug.ON) {
             RequestContext context = request.getContext();
             request.appendHtml("<div class=\"debug\">");
-            request.appendHtml("<a class=\"option\" target=\"debug\" href=\"debug.app\">Object</a>");
             request.appendHtml("<pre>");  
             request.appendHtml("URI:  " + context.getUri());
             request.appendHtml("\n");
             request.appendHtml("File: " + context.fullFilePath(context.getResourceFile()));
-            request.appendHtml("\n\n");
-            context.append(request, "variables");
-            request.appendHtml("\n\n"); 
-            request.appendHtml(request.getContext().getDebugTrace());      
+            if (!isExcludeVariables) {
+                request.appendHtml("\n\n");
+                request.appendHtml("<a class=\"option\" target=\"debug\" href=\"debug.app\">Object</a>");
+                context.append(request, "variables");
+            }
+            if (!isExcludeProcessing) {
+                request.appendHtml("\n\n"); 
+                request.appendHtml(request.getContext().getDebugTrace());      
+            }
             request.appendHtml("</pre>");
             request.appendHtml("</div>");
         }

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=1055940&r1=1055939&r2=1055940&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 Jan  6 17:04:33 2011
@@ -131,7 +131,7 @@ public class EditObject extends Abstract
             AuthenticationSession session = IsisContext.getAuthenticationSession();
             if (field.isVisible(session, object).isAllowed() && (includeUnusableFields
|| field.isUsable(session, object).isAllowed())) {
                 ObjectAdapter[] options = field.getChoices(object);
-                FieldFactory.initializeField(context, object, field, options, !field.isMandatory(),
includeUnusableFields, formField);
+                FieldFactory.initializeField(context, object, field, options, field.isMandatory(),
includeUnusableFields, formField);
                 
                 Consent usable = field.isUsable(session, object);
                 boolean isEditable = true;

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java?rev=1055940&r1=1055939&r2=1055940&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/edit/FieldFactory.java
Thu Jan  6 17:04:33 2011
@@ -39,13 +39,13 @@ public class FieldFactory {
         ObjectAdapter object,
         ObjectFeature param,
         ObjectAdapter[] optionsForParameter,
-        boolean isOptional,
+        boolean isRequired,
         boolean includeUnusableFields,
         InputField field) {
 
         field.setLabel(param.getName());
         field.setDescription(param.getDescription());
-        field.setRequired(!isOptional);
+        field.setRequired(isRequired);
         field.setHidden(false);
 
         if (param.getSpecification().getFacet(ParseableFacet.class) != null) {



Mime
View raw message