You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/02/21 17:53:52 UTC

[1/2] git commit: ISIS-645: fixing localization issue for XmlSnapshotService

Repository: isis
Updated Branches:
  refs/heads/master 10880ef07 -> b4ee8405f


ISIS-645: fixing localization issue for XmlSnapshotService


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/29657d4a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/29657d4a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/29657d4a

Branch: refs/heads/master
Commit: 29657d4a3c255be41c0ea01e880dde30f9230020
Parents: 10880ef
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Feb 21 16:24:13 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Feb 21 16:24:13 2014 +0000

----------------------------------------------------------------------
 .../xmlsnapshot/XmlSnapshotServiceAbstract.java |  3 +-
 .../XmlSnapshotServiceAbstractTest.java         | 72 +++++++++++++-------
 2 files changed, 51 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/29657d4a/core/applib/src/main/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstract.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstract.java b/core/applib/src/main/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstract.java
index 4f3a5f8..b61339c 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstract.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstract.java
@@ -19,6 +19,7 @@ package org.apache.isis.applib.services.xmlsnapshot;
 import java.io.StringReader;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.util.Locale;
 
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Transformer;
@@ -71,7 +72,7 @@ public abstract class XmlSnapshotServiceAbstract implements XmlSnapshotService {
         }
         if("isis:LocalDate".equals(dataType)) {
             final String str = getChildTextValue(chldEl);
-            final DateTimeFormatter forPattern = DateTimeFormat.forPattern("dd-MMM-yyyy");
+            final DateTimeFormatter forPattern = DateTimeFormat.forPattern("dd-MMM-yyyy").withLocale(Locale.ENGLISH);
             return (T)forPattern.parseLocalDate(str);
         }
         if("isis:Byte".equals(dataType)) {

http://git-wip-us.apache.org/repos/asf/isis/blob/29657d4a/core/applib/src/test/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstractTest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstractTest.java b/core/applib/src/test/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstractTest.java
index d1561f1..8379ce7 100644
--- a/core/applib/src/test/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstractTest.java
+++ b/core/applib/src/test/java/org/apache/isis/applib/services/xmlsnapshot/XmlSnapshotServiceAbstractTest.java
@@ -23,10 +23,12 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URL;
 import java.nio.charset.Charset;
+import java.util.Locale;
 
 import com.google.common.io.Resources;
 
 import org.joda.time.LocalDate;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.w3c.dom.Document;
@@ -36,41 +38,65 @@ public class XmlSnapshotServiceAbstractTest {
 
     private XmlSnapshotServiceAbstract xmlSnapshotService;
     private String xmlStr;
-
+    
     @Before
     public void setUp() throws Exception {
         URL resource = Resources.getResource(XmlSnapshotServiceAbstractTest.class, "XmlSnapshotServiceAbstractTest.xml");
         xmlStr = Resources.toString(resource, Charset.forName("UTF-8"));
         
         xmlSnapshotService = new XmlSnapshotServiceForUnitTesting();
+        
     }
 
+    
     @Test
     public void test() {
 
-        Document xmlDoc = xmlSnapshotService.asDocument(xmlStr);
-        Element rootEl = xmlDoc.getDocumentElement();
+        Locale locale = Locale.getDefault();
         
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someString", String.class), is("OXF"));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someLocalDate", LocalDate.class), is(new LocalDate(2013,4,1)));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someBigDecimal", BigDecimal.class), is(new BigDecimal("123456789012345678901234567890.12345678")));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someBigInteger", BigInteger.class), is(new BigInteger("12345678901234567890123456789012345678")));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someInteger", Integer.class), is(new Integer(123456789)));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someLong", Long.class), is(new Long(1234567890123456789L)));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someShort", Short.class), is(new Short((short)12345)));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someByte", Byte.class), is(new Byte((byte)123)));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someBoolean", Boolean.class), is(Boolean.TRUE));
-        assertThat(
-                xmlSnapshotService.getChildElementValue(rootEl, "app:someBoolean2", Boolean.class), is(Boolean.FALSE));
+        Locale[] locales = new Locale[]{Locale.getDefault(), lookupLocale("en", "US"), lookupLocale("en", "GB"), lookupLocale("es", "ES")};
+        for (Locale eachLocal : locales) {
+            try {
+
+                Locale.setDefault(eachLocal);
+
+                Document xmlDoc = xmlSnapshotService.asDocument(xmlStr);
+                Element rootEl = xmlDoc.getDocumentElement();
+                
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someString", String.class), is("OXF"));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someLocalDate", LocalDate.class), is(new LocalDate(2013,4,1)));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someBigDecimal", BigDecimal.class), is(new BigDecimal("123456789012345678901234567890.12345678")));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someBigInteger", BigInteger.class), is(new BigInteger("12345678901234567890123456789012345678")));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someInteger", Integer.class), is(new Integer(123456789)));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someLong", Long.class), is(new Long(1234567890123456789L)));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someShort", Short.class), is(new Short((short)12345)));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someByte", Byte.class), is(new Byte((byte)123)));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someBoolean", Boolean.class), is(Boolean.TRUE));
+                assertThat(
+                        xmlSnapshotService.getChildElementValue(rootEl, "app:someBoolean2", Boolean.class), is(Boolean.FALSE));
+            } finally {
+                Locale.setDefault(locale);
+            }
+        }
+    }
+
+    private static Locale lookupLocale(String language, String country) {
+        Locale[] availableLocales = Locale.getAvailableLocales();
+        for (Locale locale : availableLocales) {
+            if(locale.getCountry().equals(country) && locale.getLanguage().equals(language)) {
+                return locale;
+            }
+        }
+        throw new IllegalArgumentException("no such locale:" + language + "_" + country);
     }
 
     


[2/2] git commit: ISIS-695: CSS fixes

Posted by da...@apache.org.
ISIS-695: CSS fixes

- align icons in tables
- align toggle box (IE9 fix)


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/b4ee8405
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/b4ee8405
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/b4ee8405

Branch: refs/heads/master
Commit: b4ee8405fed570b686efcf35f359f68ed3146fa7
Parents: 29657d4
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Feb 21 16:53:29 2014 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Feb 21 16:53:29 2014 +0000

----------------------------------------------------------------------
 .../ajaxtable/CollectionContentsAsAjaxTablePanel.css         | 1 -
 .../components/widgets/checkbox/ContainedToggleboxPanel.html | 2 +-
 .../org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css  | 8 ++++++++
 3 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/b4ee8405/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.css
index 5d67e80..37acdbe 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.css
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.css
@@ -171,7 +171,6 @@
 }
 
 .collectionContentsAsAjaxTablePanel table.contents .entityLinkSelect2Panel .entityImage {
-	vertical-align:text-bottom;
 	padding-right:6px;
 }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/b4ee8405/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/checkbox/ContainedToggleboxPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/checkbox/ContainedToggleboxPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/checkbox/ContainedToggleboxPanel.html
index 5e95e66..3491ab6 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/checkbox/ContainedToggleboxPanel.html
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/checkbox/ContainedToggleboxPanel.html
@@ -21,7 +21,7 @@
 	<body>
 		<wicket:panel>
 			<span wicket:id="container" class="containedToggleboxPanel">
-				<form wicket:id="form">
+				<form wicket:id="form" class="containedToggleboxPanelForm">
 					<input type="checkbox" wicket:id="togglebox" />
 				</form>
 			</span>

http://git-wip-us.apache.org/repos/asf/isis/blob/b4ee8405/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css
index ad09e87..8d0cf78 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.css
@@ -969,3 +969,11 @@ zero clipboard
     background-repeat: no-repeat;
     cursor: pointer;
 }
+
+
+/**
+for some reason the containedToggleboxPanel.css is not being picked up...
+*/
+.containedToggleboxPanel .containedToggleboxPanelForm {
+    display: inline;
+}
\ No newline at end of file