incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1355094 - in /incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher: ErrorCollator.java view/display/LongFormView.java view/display/TableView.java
Date Thu, 28 Jun 2012 18:17:45 GMT
Author: rmatthews
Date: Thu Jun 28 18:17:44 2012
New Revision: 1355094

URL: http://svn.apache.org/viewvc?rev=1355094&view=rev
Log:
ISIS-162 - Improved linking from tables

Modified:
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/ErrorCollator.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/LongFormView.java
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/ErrorCollator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/ErrorCollator.java?rev=1355094&r1=1355093&r2=1355094&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/ErrorCollator.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/ErrorCollator.java
Thu Jun 28 18:17:44 2012
@@ -54,7 +54,8 @@ public class ErrorCollator {
     }
 
     public void exception(final Throwable exception) {
-        LOG.debug(exception.getMessage(), exception);
+        String messageText = exception.getMessage(); 
+        LOG.debug(messageText, exception); 
         try {
             debug.startSection("Exception");
             debug.appendException(exception);
@@ -63,7 +64,7 @@ public class ErrorCollator {
             debug.appendln("NOTE - an exception occurred while dumping an exception!");
             debug.appendException(e);
         }
-        message = exception.getMessage();
+        message = messageText == null ? exception.getClass().getName() : messageText; 
     }
         
     public DebugBuilder getDebug() {

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/LongFormView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/LongFormView.java?rev=1355094&r1=1355093&r2=1355094&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/LongFormView.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/LongFormView.java
Thu Jun 28 18:17:44 2012
@@ -53,7 +53,7 @@ public class LongFormView extends Abstra
             }
             final boolean isFieldEditable = field.isUsable(IsisContext.getAuthenticationSession(),
object).isAllowed();
             final String summary = "Table of elements in " + field.getName();
-            TableView.write(request, summary, object, field, collection, noColumns, fields,
isFieldEditable, showIconByDefault(), tableClass, rowClasses);
+            TableView.write(request, summary, object, field, collection, noColumns, fields,
isFieldEditable, showIconByDefault(), tableClass, rowClasses, linkedObject);
         } else {
             super.addField(request, object, field, linkedObject, showIcons);
         }

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java?rev=1355094&r1=1355093&r2=1355094&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
Thu Jun 28 18:17:44 2012
@@ -53,8 +53,22 @@ public class TableView extends AbstractT
         private final LinkedObject linkRow;
         private final int noColumns;
 
-        private SimpleTableBuilder(final String parent, final boolean includeHeader, final
boolean includeFooter, final String title, final int noColumns, final String[] headers, final
List<ObjectAssociation> fields, final boolean showTitle, final boolean showIcons, final
boolean showSelectOption,
-                final boolean showDeleteOption, final boolean showEditOption, final String
fieldName, final LinkedObject[] linkedFields, final LinkedObject linkRow) {
+        private SimpleTableBuilder(
+                final String parent,
+                final boolean includeHeader,
+                final boolean includeFooter,
+                final String title,
+                final int noColumns,
+                final String[] headers,
+                final List<ObjectAssociation> fields,
+                final boolean showTitle,
+                final boolean showIcons,
+                final boolean showSelectOption,
+                final boolean showDeleteOption,
+                final boolean showEditOption,
+                final String fieldName,
+                final LinkedObject[] linkedFields,
+                final LinkedObject linkRow) {
             this.parent = parent;
             this.includeHeader = includeHeader;
             this.includeFooter = includeFooter;
@@ -195,13 +209,25 @@ public class TableView extends AbstractT
     }
 
     @Override
-    protected TableContentWriter createRowBuilder(final Request request, final RequestContext
context, final String parent, final List<ObjectAssociation> allFields, final ObjectAdapter
collection) {
+    protected TableContentWriter createRowBuilder(
+            final Request request,
+            final RequestContext context,
+            final String parent,
+            final List<ObjectAssociation> allFields,
+            final ObjectAdapter collection) {
         final String fieldName = request.getOptionalProperty(FIELD);
         final String title = request.getOptionalProperty(FORM_TITLE);
         return rowBuilder(request, context, title, parent, fieldName, allFields, showIconByDefault());
     }
 
-    private static TableContentWriter rowBuilder(final Request request, final RequestContext
context, final String title, final String object, final String fieldName, final List<ObjectAssociation>
allFields, final boolean showIconByDefault) {
+    private static TableContentWriter rowBuilder(
+            final Request request,
+            final RequestContext context,
+            final String title,
+            final String object,
+            final String fieldName,
+            final List<ObjectAssociation> allFields,
+            final boolean showIconByDefault) {
         final String linkRowView = request.getOptionalProperty(LINK);
         final String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
         final String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
@@ -250,16 +276,28 @@ public class TableView extends AbstractT
 
         request.popBlockContent();
 
-        return new SimpleTableBuilder(object, includeHeader, includeFooter, title, noColumns,
headers, fields, showTitle, showIcons, showSelectOption, showDeleteOption, showEditOption,
fieldName, linkedFields, linkRow);
+        return new SimpleTableBuilder(object, includeHeader, includeFooter, title, noColumns,
headers, fields, showTitle,
+                showIcons, showSelectOption, showDeleteOption, showEditOption, fieldName,
linkedFields, linkRow);
     }
 
-    public static void write(final Request request, final String summary, final ObjectAdapter
object, final ObjectAssociation field, final ObjectAdapter collection, final int noColumns,
final List<ObjectAssociation> fields, final boolean linkAllFields, final boolean showIconByDefault,
-            final String tableClass, final String[] rowClasses) {
+    public static void write(
+            final Request request,
+            final String summary,
+            final ObjectAdapter object,
+            final ObjectAssociation field,
+            final ObjectAdapter collection,
+            final int noColumns,
+            final List<ObjectAssociation> fields,
+            final boolean linkAllFields,
+            final boolean showIconByDefault,
+            final String tableClass,
+            final String[] rowClasses,
+            LinkedObject linkedObject) {
         final LinkedObject[] linkedFields = new LinkedObject[fields.size()];
         if (linkAllFields) {
             for (int i = 0; i < linkedFields.length; i++) {
                 if (fields.get(i).isOneToOneAssociation()) {
-                    linkedFields[i] = new LinkedObject("_generic.shtml");
+                    linkedFields[i] = linkedObject == null ? new LinkedObject("_generic.shtml")
: linkedObject;  
                 }
             }
         }
@@ -274,7 +312,8 @@ public class TableView extends AbstractT
         }
         
         final RequestContext context = request.getContext();
-        final TableContentWriter rowBuilder = rowBuilder(request, context, null, context.mapObject(object,
Scope.REQUEST), field.getId(), fields, showIconByDefault);
+        final TableContentWriter rowBuilder = rowBuilder(request, context, null, context.mapObject(object,
Scope.REQUEST), field.getId(), fields, 
+                showIconByDefault);
         write(request, collection, summary, rowBuilder, null, null);
     }
 



Mime
View raw message