[Ils-source] r1577 - in trunk/webapp/api: auth/session/close auth/session/open user/get

scribe at crosswire.org scribe at crosswire.org
Sun Jun 3 06:01:55 MST 2018


Author: scribe
Date: 2018-06-03 06:01:55 -0700 (Sun, 03 Jun 2018)
New Revision: 1577

Modified:
   trunk/webapp/api/auth/session/close/index.jsp
   trunk/webapp/api/auth/session/open/index.jsp
   trunk/webapp/api/user/get/index.jsp
Log:
updated to better work for ILS


Modified: trunk/webapp/api/auth/session/close/index.jsp
===================================================================
--- trunk/webapp/api/auth/session/close/index.jsp	2018-06-03 12:51:58 UTC (rev 1576)
+++ trunk/webapp/api/auth/session/close/index.jsp	2018-06-03 13:01:55 UTC (rev 1577)
@@ -4,7 +4,6 @@
 <%@ page import="org.crosswire.webtools.RightsAndRoles.User" %>
 
 <%
-    if (request.getParameter("help") == null) {
         String format = request.getParameter("format");
         User   user   = RightsAndRoles.getInstance().getCurrentUser(request, response);
         if (user != null && format == null) { format = user.getDefaultFormat(); }
@@ -35,18 +34,4 @@
             }
         }
         return;
-    }
 %>
-<html>
-<body>
-<h1>auth/session/close</h1>
-<p>Close a session</p>
-<h3>Parameters</h3>
-<table border="1">
-    <tr>
-        <td><b>ilsSession</b></td>
-        <td>session hash given from auth/session/open</td>
-    </tr>
-</table>
-</body>
-</html>

Modified: trunk/webapp/api/auth/session/open/index.jsp
===================================================================
--- trunk/webapp/api/auth/session/open/index.jsp	2018-06-03 12:51:58 UTC (rev 1576)
+++ trunk/webapp/api/auth/session/open/index.jsp	2018-06-03 13:01:55 UTC (rev 1577)
@@ -1,6 +1,7 @@
 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
 <%@ page trimDirectiveWhitespaces="true" %>
 <%@ page import="org.crosswire.webtools.RightsAndRoles" %>
+<%@ page import="com.resolutions.ils.ILSRightsAndRoles" %>
 <%@ page import="org.apache.log4j.Logger" %>
 <%@ page import="org.crosswire.webtools.Serializer" %>
 <%@ page import="org.crosswire.webtools.annotation.Description" %>
@@ -13,13 +14,13 @@
 <%@ page import="com.resolutions.ils.data.Company" %>
 
 <%!
-	static String sessionKeyName = RightsAndRoles.getInstance().sessionKeyName;
+	static String sessionKeyName = ILSRightsAndRoles.sessionKeyName;
 	static Logger logger = Logger.getLogger("session/open");
 
     @Description(value = "Authenticate to the system and establish a session.  NOTE: In an effort to keep login credentials out of webserver logs, this method only accepts POST with no query string", name = "auth/session/open")
     public static class MyParameters extends ILSParameters<MyParameters> {
     	@NotNull
-        @Description(value = "user name")
+        @Description(value = "login user name")
     	public String user_name;
         @NotNull
         @Description(value = "password")

Modified: trunk/webapp/api/user/get/index.jsp
===================================================================
--- trunk/webapp/api/user/get/index.jsp	2018-06-03 12:51:58 UTC (rev 1576)
+++ trunk/webapp/api/user/get/index.jsp	2018-06-03 13:01:55 UTC (rev 1577)
@@ -6,6 +6,8 @@
 <%@ page import="org.crosswire.webtools.Serializer" %>
 <%@ page import="com.resolutions.ils.ILSParameters" %>
 <%@ page import="com.resolutions.ils.data.UserProfile" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.ArrayList" %>
 
 <%!
 	@Description(value = "Retrieve a user profile record", name = "user/get")
@@ -39,7 +41,7 @@
 		protected String[] getExamples() {
 		    return new String[] {
 			    "get userProfileID " + getILSSession().getUserID() + ": <a href=\"?userProfileID=" + getILSSession().getUserID() +"\">user/get/?userProfileID= "+ getILSSession().getUserID() + "</a>",
-			    "get userLoginID " + getILSSession().getUserName() + " with extra group information: <a href=\"?userProfileID=" + getILSSession().getUserID() +"&detail=extra\">user/get/?userProfileID= "+ getILSSession().getUserID() + "&detail=extra</a>",
+			    "get user loginID " + getILSSession().getUserName() + " with extra group information: <a href=\"?loginID=" + getILSSession().getUserName() +"&detail=extra\">user/get/?loginID="+ getILSSession().getUserName() + "&detail=extra</a>",
 		    };
 		}
 		protected String[] getReturns() { return new String[] {
@@ -68,8 +70,13 @@
 			params.addError(-103, "User Profile not found.");
 		}
 		else {
+			// To facilitate results of multiple UserProfiles in the future
+			// our response is an array
+			List<UserProfile> results = new ArrayList<UserProfile>();
+			results.add(foundUserProfile);
+
 params.getLogger().info("detaillevel: " + params.detailLevel);
-			Serializer.output(response, out, params, foundUserProfile, null, params.detailLevel);
+			Serializer.output(response, out, params, results, null, params.detailLevel);
 			return;
 		}
 	}




More information about the Ils-source mailing list