[java-identity-provider COMMIT] in /trunk/idp-conf/src: main/resources/system/flows/local-storage/local-storage-write...
noreply at shibboleth.net
noreply at shibboleth.net
Tue May 26 17:45:36 EDT 2015
Author: tzeller
Date: Tue May 26 17:45:35 2015
New Revision: 7535
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7535&view=rev
Log:
IDP-594 Some work on local storage write subflow. Parameterize the item key and value. Return boolean representing success as well as exception.
Modified:
trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-write-flow.xml
trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.js
trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.vm
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.js
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-write-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-write-flow.xml?rev=7535&r1=7534&r2=7535&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-write-flow.xml (original)
+++ trunk/idp-conf/src/main/resources/system/flows/local-storage/local-storage-write-flow.xml Tue May 26 17:45:35 2015
@@ -5,13 +5,17 @@
<!-- Rudimentary impediment to direct execution of subflow. -->
<input name="calledAsSubflow" type="boolean" required="true" />
- <!-- The value to be written to local storage. -->
+ <!-- The key and value of the item written to local storage. -->
+ <input name="localStorageKey" type="string" required="true" />
<input name="localStorageValue" type="string" required="true" />
<view-state id="LocalStorageWrite" view="/local-storage/local-storage-write">
<transition on="formSubmitted" to="proceed" />
</view-state>
- <end-state id="proceed" />
+ <end-state id="proceed">
+ <output name="localStorageSuccess" value="requestParameters.shib_idp_ls_success" />
+ <output name="localStorageException" value="requestParameters.shib_idp_ls_exception" />
+ </end-state>
</flow>
Modified: trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.js
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.js?rev=7535&r1=7534&r2=7535&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.js (original)
+++ trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.js Tue May 26 17:45:35 2015
@@ -1,5 +1,12 @@
-// TODO use setItem
-function writeLocalStorageAndSubmit() {
- localStorage["shib_idp_ls"] = document.form1["shib_idp_ls"].value;
+function writeLocalStorageAndSubmit(key, value) {
+ var success;
+ try {
+ localStorage.setItem(key, value);
+ 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();
}
Modified: trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.vm?rev=7535&r1=7534&r2=7535&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.vm (original)
+++ trunk/idp-conf/src/main/resources/system/views/local-storage/local-storage-write.vm Tue May 26 17:45:35 2015
@@ -9,7 +9,7 @@
#include( "local-storage/local-storage-write.js" )
</script>
</head>
- <body onload="writeLocalStorageAndSubmit()">
+ <body onload="writeLocalStorageAndSubmit('$localStorageKey', '$localStorageValue')">
<noscript>
<p>
<strong>Note:</strong>
@@ -19,7 +19,8 @@
</noscript>
<form name="form1" action="${flowExecutionUrl}&_eventId=formSubmitted" method="post">
<div>
- <input name="shib_idp_ls" value="$localStorageValue" />
+ <input name="shib_idp_ls_success" />
+ <input name="shib_idp_ls_exception" />
</div>
<noscript>
<div>
Modified: trunk/idp-conf/src/test/resources/flows/test/local-storage/write/local-storage-write-test-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/test/resources/flows/test/local-storage/write/local-storage-write-test-flow.xml?rev=7535&r1=7534&r2=7535&view=diff
==============================================================================
[... 121 lines stripped ...]
More information about the commits
mailing list