incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1075013 - in /incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer: html/ resources/ resources/objects/ resources/objects/actions/
Date Sun, 27 Feb 2011 09:47:52 GMT
Author: danhaywood
Date: Sun Feb 27 09:47:52 2011
New Revision: 1075013

URL: http://svn.apache.org/viewvc?rev=1075013&view=rev
Log:
ISIS-81: committing contributed changed from Vangjel Stavro

Modified:
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/HtmlClass.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/XhtmlTemplate.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/ObjectResourceImpl.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/TableColumnNakedObjectAssociationModifyAbstract.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/actions/TableColumnNakedObjectActionInvoke.java

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/HtmlClass.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/HtmlClass.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/HtmlClass.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/HtmlClass.java
Sun Feb 27 09:47:52 2011
@@ -28,12 +28,15 @@ public final class HtmlClass {
     public static final String ROLE = "nof-role";
 
     public static final String TITLE = "nof-title";
+    public static final String OBJECT = "nof-object";
     public static final String OID = "nof-oid";
     public static final String ACTION_RESULT = "nof-action-result";
 
     public static final String VISIBLE = "nof-visible";
     public static final String USABLE = "nof-usable";
     public static final String VALID = "nof-valid";
+    
+    public static final String OBJECT_SPECS = "nof-object-specs";
 
     private HtmlClass() {}
 

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/XhtmlTemplate.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/XhtmlTemplate.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/XhtmlTemplate.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/html/XhtmlTemplate.java
Sun Feb 27 09:47:52 2011
@@ -73,7 +73,14 @@ public class XhtmlTemplate {
         }
         return this;
     }
-
+    
+    public Element appendToDiv(final Element div, final Element... elements){
+    	for (final Element element: elements){
+    		div.appendChild(element);
+    	}
+    	return div;
+    }
+    
 	public Document getDocument() {
 		Document document = new Document(html);
 		return document;

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java
Sun Feb 27 09:47:52 2011
@@ -141,7 +141,11 @@ public abstract class ResourceAbstract {
         div.appendChild(ul);
 		return div;
 	}
-    
+	
+	protected Element div(final String htmlClassAttribute){
+		return xhtmlRenderer.div(htmlClassAttribute);
+	}
+	
     protected Element asDivTableFacets(final FacetHolder facetHolder, final String pathPrefix)
{
         final Element div = xhtmlRenderer.div_p("Facets", HtmlClass.FACETS);
         final List<Facet> rows = ListUtils.toList(facetHolder.getFacets(FacetFilters.ANY));
@@ -187,6 +191,7 @@ public abstract class ResourceAbstract {
         final String oidStr = getOidStr(nakedObject);
 
         final Element div = new Element("div");
+        div.addAttribute(new Attribute("class", HtmlClass.OBJECT_SPECS));
         final Element table = new Element("table");
         table.addAttribute(new Attribute("border", "1"));
         div.appendChild(table);

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/ObjectResourceImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/ObjectResourceImpl.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/ObjectResourceImpl.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/ObjectResourceImpl.java
Sun Feb 27 09:47:52 2011
@@ -82,22 +82,30 @@ public class ObjectResourceImpl extends 
         
         xhtml.appendToBody(asDivNofSession());
         xhtml.appendToBody(resourcesDiv());
+        
+        // object div
+        final Element objectDiv = div(HtmlClass.OBJECT);
+        xhtml.appendToBody(objectDiv);
 
         // title & Oid
-        final Element div = asDivTableObjectDetails(nakedObject);
-        xhtml.appendToBody(div);
+        final Element objectSpecsDiv = asDivTableObjectDetails(nakedObject);
+        xhtml.appendToDiv(objectDiv, objectSpecsDiv);
+        //xhtml.appendToBody(div);
 
         // properties (in line table)
         final Element propertiesTableEl = asDivTableProperties(getSession(), nakedObject);
-        xhtml.appendToBody(propertiesTableEl);
+        xhtml.appendToDiv(objectDiv, propertiesTableEl);
+        //xhtml.appendToBody(propertiesTableEl);
 
         // collections
         final Element collectionsDivEl = asDivTableCollections(getSession(), nakedObject);
-        xhtml.appendToBody(collectionsDivEl);
+        xhtml.appendToDiv(objectDiv, collectionsDivEl);
+        //xhtml.appendToBody(collectionsDivEl);
 
         // actions
         final Element actionsDivEl = asDivTableActions(getSession(), nakedObject);
-        xhtml.appendToBody(actionsDivEl);
+        xhtml.appendToDiv(objectDiv, actionsDivEl);
+        //xhtml.appendToBody(actionsDivEl);
 
         return xhtml.toXML();
     }

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/TableColumnNakedObjectAssociationModifyAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/TableColumnNakedObjectAssociationModifyAbstract.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/TableColumnNakedObjectAssociationModifyAbstract.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/TableColumnNakedObjectAssociationModifyAbstract.java
Sun Feb 27 09:47:52 2011
@@ -56,23 +56,26 @@ public abstract class TableColumnNakedOb
     private Element form(final T association) {
         final String associationId = association.getId();
         final String formName = getFormNamePrefix() + associationId;
-        final Element form = xhtmlRenderer.form(formName, getHtmlClassAttribute());
-
+        final Element form = xhtmlRenderer.form(formName, getHtmlClassAttribute());     
  
+        form.addAttribute(new Attribute("class", associationId));
+        
         final String inputFieldName = "proposedValue";
         if (inputField) {
             final Element inputValue = new Element("input");
             inputValue.addAttribute(new Attribute("type", "value"));
-            inputValue.addAttribute(new Attribute("name", inputFieldName));
+            inputValue.addAttribute(new Attribute("name", inputFieldName));            
             form.appendChild(inputValue);
         }
 
         final Element inputButton = new Element("input");
         inputButton.addAttribute(new Attribute("type", "button"));
-        inputButton.addAttribute(new Attribute("value", getFormButtonLabel()));
+        inputButton.addAttribute(new Attribute("value", getFormButtonLabel()));        
         final String servletContextName = getContextPath();
         final String url = MessageFormat.format("{0}/object/{1}", servletContextName, getOidStr());
         inputButton.addAttribute(new Attribute("onclick", invokeJavascript(url, associationId,
inputFieldName)));
+        
         form.appendChild(inputButton);
+        form.addAttribute(new Attribute("action", url));
 
         return form;
     }

Modified: incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/actions/TableColumnNakedObjectActionInvoke.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/actions/TableColumnNakedObjectActionInvoke.java?rev=1075013&r1=1075012&r2=1075013&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/actions/TableColumnNakedObjectActionInvoke.java
(original)
+++ incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/objects/actions/TableColumnNakedObjectActionInvoke.java
Sun Feb 27 09:47:52 2011
@@ -45,7 +45,7 @@ public final class TableColumnNakedObjec
 
         final Element form = xhtmlRenderer.form(formName, HtmlClass.ACTION);
         form.addAttribute(new Attribute("method", "POST"));
-        form.addAttribute(new Attribute("action", uri));
+        form.addAttribute(new Attribute("action", uri));        
 
         renderInputFieldsForParameters(parameters, form);
 
@@ -60,12 +60,13 @@ public final class TableColumnNakedObjec
             final String inputFieldName = INPUT_FIELD_NAME_PREFIX + i;
 
             final Element inputLabel = new Element("p");
-            inputLabel.appendChild(parameter.getName());
+            inputLabel.appendChild(parameter.getName());           
             form.appendChild(inputLabel);
 
             final Element inputValue = new Element("input");
             inputValue.addAttribute(new Attribute("type", "value"));
             inputValue.addAttribute(new Attribute("name", inputFieldName));
+            inputValue.addAttribute(new Attribute("class", parameter.getName()));
             form.appendChild(inputValue);
         }
     }



Mime
View raw message