changeset 1243:f79e6b8cde0c

Improved security package javadoc description * netx/net/sourceforge/jnlp/security/package-info.java: fixed linguistic issues in graph, added title, added description of implementing RememberableDialog
author Jiri Vanek <jvanek@redhat.com>
date Tue, 16 Jun 2015 10:37:09 +0200
parents cedb9509df43
children e2583f1178ce
files ChangeLog netx/net/sourceforge/jnlp/security/package-info.java
diffstat 2 files changed, 29 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 15 12:44:41 2015 +0200
+++ b/ChangeLog	Tue Jun 16 10:37:09 2015 +0200
@@ -1,3 +1,9 @@
+2015-06-16  Jiri Vanek  <jvanek@redhat.com>
+
+	Improved security package javadoc description
+	* netx/net/sourceforge/jnlp/security/package-info.java: fixed linguistic
+	issues in graph, added title, added description of implementing RememberableDialog
+
 2015-06-12  Jiri Vanek  <jvanek@redhat.com>
 
 	Updated NEWS, added javadoc fo security package. Added changelog entry for last commit
--- a/netx/net/sourceforge/jnlp/security/package-info.java	Mon Jun 15 12:44:41 2015 +0200
+++ b/netx/net/sourceforge/jnlp/security/package-info.java	Tue Jun 16 10:37:09 2015 +0200
@@ -31,6 +31,9 @@
 obligated to do so. If you do not wish to do so, delete this exception
 statement from your version.*/
 /**
+ *package generally about showing various security prompts
+ *<h3>Following diagram shows how dialog is handled when some application/appelt needs to show it</h3>
+ *
  *<pre>
         ITW-thread(s)               | dialogs-thread                                                                                                                                  X
                                     |                                                                                                                                                 X
@@ -50,12 +53,12 @@
           getUserResponse(lock lock)|                |                                                                                                                              | X
                                     |            create instance of dialogue                                                                                                        | X
                                     |                |                                                                                                                              | X
-                                    |            acording to type of dialogue, create and place panel  (this is important, panel is keeper of rememberable decission)               | X
+                                    |            according to type of dialogue, create and place panel  (this is important, panel is keeper of rememberable decision)               | X
                                     |                |                                                                                                                              | X
-                                    |            if panel is instance of RememberableDialogue                                                                                       | X
+                                    |            if panel is instance of RememberableDialog                                                                                         | X
                                     |              else                        then                                                                                                 | X
                                     |                |                          |                                                                                                   | X
-                                    |                |                         check whether this applet+action was already stored and pernamently remembered in .appletSecurity    | X
+                                    |                |                         check whether this applet+action was already stored and permanently remembered in .appletSecurity    | X
                                     |                |                          no                                                                        yes                       | X
                                     |                |<-------------------------|                                                                          |                        | X
                                     |                |                                                                                                     |                        | X
@@ -63,24 +66,36 @@
                                     |                |                                                                                                     |                        | X
                                     |                |                                                                                                     |                        | X
                                     |            add closing and disposing listener(s) to button(s)                                                        |                        | X
-                                    |                |     * set return value to listner?                                                                  |                        | X
+                                    |                |     * set return value to listener?                                                                 |                        | X
                                     |                |                                                                                                     |                        | X
-                                    |                      accordingo to set value, set default selected button?                                           |                        | X
+                                    |                      according to set value, set default selected button?                                            |                        | X
                                     |                |                                                                                                     |                        | X
                                     |            if his applet+action was already stored in .appletSecurity include text approved/denyed and when          |                        | X
                                     |                |                                                                                                     |                        | X
-                                    |            wait for user to click buttton or close dialogue                                                          |                        | X
+                                    |            wait for user to click button or close dialogue                                                          |                        | X
                                     |                |                                                                                                     |                        | X
                                     |                --> set selected value (via listener?) to message, dispose dialog -> <- set stored value to message <-|                        | X
                                     |                                                                                    |                                                          | X
-                                    |                    if panel is instance of RememberableDialogue crate new, update old(date/decission,jars...) record in .appletSecurity       | X
+                                    |                    if panel is instance of RememberableDialogue crate new, update old(date/decision,jars...) record in .appletSecurity        | X
                                     |                                                                                    |                                                          | X
-            | <------------------------------------------------------------------------------------------< unlock lock of this messge  >--------------------------------------------| X
+            | <------------------------------------------------------------------------------------------< unlock lock of this message  >--------------------------------------------| X
   read result from message          |                                                                                                                                                 X
             |                       |                                                                                                                                                 X
    continue accordingly             |                                                                                                                                                 X
                                                                                                                                                                                       X
 
  *</pre>
+ *
+ *<h3>How to make your dialog to be remembered</h3>
+ *<li>make your extension of SecurityPanel implementing RememberableDialog:
+ *<blockquote>
+ * <li>  RememberPanelResult getRemeberAction - if your dialogue uses RememberPanel, then you get RememberPanelResult for free
+ * <li>  DialogResult getValue() - what your dialogue actually returns. If it is some simple Yes, No.. Then you can use existing types in dialogresults package. If it handles something more complex, you can inspire yourself in AccessWarningPaneComplexReturn
+ * <li>  JNLPFile getFile() - ok, file keeps all needed to identify applet/app, so it is a must.
+ * <li>  DialogResult readValue(String s) - the dialog must be able to read answer from String, which is supplied to it via engine. If you use some PrimitivesSubset extension, then it is mostly only static call its factory creator from String.
+ *</blockquote>
+ *This should be all. The value your type writeValue to file, is then stored under Key, which is your extension of SecurityPanel implementing RememberableDialog name
+ *
+ *
  */
 package net.sourceforge.jnlp.security;