Author: keith Date: Sat Jul 19 01:20:46 2008 New Revision: 19622 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=19622
Log: Adding some JavaDoc comments to the Request Host Object Modified: trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/request/Request.java trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/system/SystemHostObject.java trunk/mashup/java/xdocs/sessionhostobject.html trunk/mashup/java/xdocs/systemhostobject.html Modified: trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/request/Request.java URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/request/Request.java?rev=19622&r1=19621&r2=19622&view=diff ============================================================================== --- trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/request/Request.java (original) +++ trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/request/Request.java Sat Jul 19 01:20:46 2008 @@ -39,10 +39,37 @@ return "Request"; } + /** + * <p/> + * This is a JavaScript Rhino host object aimed to provide information regarding the request it + * received and hence it consists of a set of readOnly properties. + * </p> + * <pre/> + * Example Usage: + * function securedUsingUTOverHTTPS() { + * system.log("This mashup was invoked by the following User : " + request.authenticatedUser ); + * system.log("This mashup was invoked from the following IP : " + request.remoteIP ); + * system.log("This mashup was invoked with the following URL : " + request.address ); + * } + * </pre> + */ public void jsConstructor() { persistenceManager = new PersistenceManager(); } + /** + * <p/> + * Appplicable to Mashups that are secured using scecurity scenario 1 + * (UsernameToken with Timestamp over HTTPS). This method will return the username of the user + * who called this mashup. + * </p> + * <p/> + * <pre> + * var authenticatedUser = system.authenticatedUser; + * </pre> + * + * @throws MashupFault Thrown in case any exceptions occur + */ public String jsGet_authenticatedUser() throws MashupFault { MessageContext messageContext = MessageContext.getCurrentMessageContext(); AxisService service = messageContext.getAxisService(); @@ -81,11 +108,35 @@ } } + /** + * <p/> + * Appplicable to Mashups that are secured using scecurity scenario 1 + * (UsernameToken with Timestamp over HTTPS). This method will return the username of the user + * who called this mashup. + * </p> + * <p/> + * <pre> + * var remoteIP = system.remoteIP; + * </pre> + * + * @throws MashupFault Thrown in case any exceptions occur + */ public String jsGet_remoteIP() throws MashupFault { MessageContext messageContext = MessageContext.getCurrentMessageContext(); return (String) messageContext.getProperty(MessageContext.REMOTE_ADDR); } + /** + * <p/> + * Returns the remoteIP that the request was made from. + * </p> + * <p/> + * <pre> + * var requestURL = system.address; + * </pre> + * + * @throws MashupFault Thrown in case any exceptions occur + */ public String jsGet_address() throws MashupFault { MessageContext messageContext = MessageContext.getCurrentMessageContext(); return messageContext.getTo().getAddress(); Modified: trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/system/SystemHostObject.java URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/system/SystemHostObject.java?rev=19622&r1=19621&r2=19622&view=diff ============================================================================== --- trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/system/SystemHostObject.java (original) +++ trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/system/SystemHostObject.java Sat Jul 19 01:20:46 2008 @@ -68,11 +68,6 @@ * This is a JavaScript Rhino host object aimed to provide a set of system * specific utility functions to the javascript service developers. * </p> - * <p/> - * For more information refer to <a - * href="http://www.wso2.org/wiki/display/mashup/System+Host+Object">JavaScript - * System Host Object</a>. - * </p> */ public class SystemHostObject extends ScriptableObject { Modified: trunk/mashup/java/xdocs/sessionhostobject.html URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/xdocs/sessionhostobject.html?rev=19622&r1=19621&r2=19622&view=diff ============================================================================== --- trunk/mashup/java/xdocs/sessionhostobject.html (original) +++ trunk/mashup/java/xdocs/sessionhostobject.html Sat Jul 19 01:20:46 2008 @@ -29,7 +29,7 @@ object is global and thus does not need to be instantiated explicitly.</p> <h3>1.1 Example</h3> <div class="code"> -<pre>this.serviceName = "ApplicationScopeService";<br>this.scope="application";<br>var key = "number";<br>function putValue(param){<br> session.put(key,2);<br> return <success/>;<br>}<br><br>function getValue(param){<br> number = session.get(key);<br> return <number>{number}</number>;<br>}<br><br>function removeValue(param){<br> number = session.remove(key);<br> return <success/>;<br>}<br><br>function clearSession(param){<br> session.clear();<br> return <success/>;<br>}</pre> +<pre>this.serviceName = "ApplicationScopeService";<br>this.scope="application";<br>var key = "number";<br>function putValue(param){<br> session.put(key,2);<br> return <success/>;<br>}<br><br>function getValue(param){<br> number = session.get(key);<br> return <number>{number}</number>;<br>}<br><br>function removeValue(param){<br> number = session.remove(key);<br> return <success/>;<br>}<br><br>function clearSession(param){<br> session.clear();<br> return <success/>;<br>}</pre> </div> <h3>2.0 Session Object</h3> <p>Session scope for a deployed mashup can be given using the Modified: trunk/mashup/java/xdocs/systemhostobject.html URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/xdocs/systemhostobject.html?rev=19622&r1=19621&r2=19622&view=diff ============================================================================== --- trunk/mashup/java/xdocs/systemhostobject.html (original) +++ trunk/mashup/java/xdocs/systemhostobject.html Sat Jul 19 01:20:46 2008 @@ -29,7 +29,7 @@ object is global and thus does not need to be instantiated explicitly.</p> <h3>1.1 Example</h3> <div class="code"> -<pre>system.include("concatscript.js");<br>function add(first, last) {<br> system.log(system.localHostName);<br> //waits for 1 second<br> system.wait(1000);<br> // concat is a function in the included concatscript.js javascript<br> var answer = concat(first,last);<br> // Send a notification to the Desk tray specifying the answer<br> system.notifyMonitor("Result of concaternating" + first + " and " + last", answer);<br> return answer;<br>}</pre> +<pre>system.include("concatscript.js");<br>function add(first, last) {<br> system.log(system.localHostName);<br> //waits for 1 second<br> system.wait(1000);<br> // concat is a function in the included concatscript.js javascript<br> var answer = concat(first,last);<br> // Send a notification to the Desk tray specifying the answer<br> system.notifyMonitor("Result of concaternating" + first + " and " + last", answer);<br> return answer;<br>}</pre> </div> <h3>2.0 System Object</h3> <h3>2.1 System Object Interface</h3> _______________________________________________ Mashup-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev
