[java-identity-provider COMMIT] in /trunk/idp-conf/src: main/resources/system/flows/local-storage/local-storage-read-...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 1 16:48:56 EDT 2015


Author: tzeller
Date: Mon Jun  1 16:48:55 2015
New Revision: 7545

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7545&view=rev
Log:
IDP-594 Some work on the local storage read flow, make the item key a variable.

Modified:
    trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-read-flow.xml
    trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.js
    trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.vm
    trunk/idp-conf/src/test/resources/flows/test/local-storage/read/local-storage-read-test-flow.xml
    trunk/idp-conf/src/test/resources/flows/test/local-storage/write/local-storage-write-test-flow.xml
    trunk/idp-conf/src/test/resources/views-test/local-storage-test/local-storage-display.vm

Modified: trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-read-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-read-flow.xml?rev=7545&r1=7544&r2=7545&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-read-flow.xml	(original)
+++ trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-read-flow.xml	Mon Jun  1 16:48:55 2015
@@ -5,13 +5,19 @@
     <!-- Rudimentary impediment to direct execution of subflow. -->
     <input name="calledAsSubflow" type="boolean" required="true" />
 
+    <!-- The key of the item read from local storage. -->
+    <input name="localStorageKey" type="string" required="true" />
+
     <view-state id="LocalStorageRead" view="/local-storage/local-storage-read">
         <transition to="proceed" />
     </view-state>
 
     <end-state id="proceed">
-        <output name="localStorage" value="requestParameters.shib_idp_ls" />
-        <output name="localStorageSupport" value="requestParameters.shib_idp_ls_support" />
+        <output name="localStorageException" value="requestParameters.shib_idp_ls_exception" />
+        <output name="localStorageSuccess" value="requestParameters.shib_idp_ls_success" />
+        <output name="localStorageSupported" value="requestParameters.shib_idp_ls_supported" />
+        <output name="localStorageValue" value="requestParameters.shib_idp_ls_value" />
+        <output name="localStorageVersion" value="requestParameters.shib_idp_ls_version" />
     </end-state> 
 
 </flow>

Modified: trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.js
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.js?rev=7545&r1=7544&r2=7545&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.js	(original)
+++ trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.js	Mon Jun  1 16:48:55 2015
@@ -1,15 +1,23 @@
-function readLocalStorageAndSubmit() {
+function readLocalStorageAndSubmit(key) {
     var localStorageSupported = isLocalStorageSupported();
-    document.form1["shib_idp_ls_support"].value = localStorageSupported;
+    document.form1["shib_idp_ls_supported"].value = localStorageSupported;
     if (localStorageSupported) {
-        document.form1["shib_idp_ls"].value = localStorage.getItem("shib_idp_ls");
+        var success;
+        try {
+            document.form1["shib_idp_ls_value"].value = localStorage.getItem(key);
+            success = "true";
+        } catch (e) {
+            success = "false";
+            document.form1["shib_idp_ls_exception"].value = e;
+        }
+        document.form1["shib_idp_ls_success"].value = success;
     }
     document.form1.submit();
 }
 function isLocalStorageSupported() {
     try {
-        localStorage.setItem("testKey", "testValue");
-        localStorage.removeItem("testKey");
+        localStorage.setItem("shib_idp_ls_test", "shib_idp_ls_test");
+        localStorage.removeItem("shib_idp_ls_test");
         return true;
     } catch (e) {
         return false;

Modified: trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.vm?rev=7545&r1=7544&r2=7545&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.vm	(original)
+++ trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-read.vm	Mon Jun  1 16:48:55 2015
@@ -9,7 +9,7 @@
             #include( "local-storage/local-storage-read.js" )
         </script>
     </head>
-    <body onload="readLocalStorageAndSubmit()">
+    <body onload="readLocalStorageAndSubmit('$localStorageKey')">
         <noscript>
             <p>
                 <strong>Note:</strong>
@@ -19,8 +19,11 @@

[... 165 lines stripped ...]


More information about the commits mailing list