|
Modified: ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java (original) +++ ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java Fri Jan 15 21:00:23 2010 @@ -157,9 +157,9 @@ UtilProperties.setPropertyValue(startupProperties, "Language", "XuiLabels" + suffix); } if (suffix.equals("_zh")) { // TODO maybe needed for other languages using non Latin alphabet http://en.wikipedia.org/wiki/Alphabet#Types - UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles" + suffix + ".xml"); // For the moment only a Chinese StyleFile is provided + UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles" + suffix + ".xml"); // For the moment only a Chinese StyleFile is provided } else { - UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles.xml"); // Languages using Latin alphabet + UtilProperties.setPropertyValue(startupProperties, "StyleFile", "posstyles.xml"); // Languages using Latin alphabet } frame.setVisible(true); frame.getContentPane().add(this); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/MethodContext.java Fri Jan 15 21:00:23 2010 @@ -280,7 +280,7 @@ public Authorization getAuthz() { return this.authz; } - + public Security getSecurity() { return this.security; } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java Fri Jan 15 21:00:23 2010 @@ -57,7 +57,7 @@ public static final String module = CallService.class.getName(); public static final String resource = "MiniLangErrorUiLabels"; - + protected String serviceName; protected ContextAccessor<Map<String, Object>> inMapAcsr; protected String includeUserLoginStr; @@ -316,14 +316,14 @@ String successSuffixStr = successSuffix.getMessage(methodContext.getLoader(), methodContext); String messagePrefixStr = messagePrefix.getMessage(methodContext.getLoader(), methodContext); String messageSuffixStr = messageSuffix.getMessage(methodContext.getLoader(), methodContext); - + String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, errorPrefixStr, errorSuffixStr); if (UtilValidate.isNotEmpty(errorMessage)) { errorMessage += UtilProperties.getMessage(resource, "simpleMethod.error_show_service_name", UtilMisc.toMap("serviceName", serviceName, "methodName", simpleMethod.getMethodName()), locale); if (methodContext.getMethodType() == MethodContext.EVENT) { methodContext.putEnv(simpleMethod.getEventErrorMessageName(), errorMessage); } else if (methodContext.getMethodType() == MethodContext.SERVICE) { - ServiceUtil.addErrors(UtilMisc.<String, String>getListFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageListName()), + ServiceUtil.addErrors(UtilMisc.<String, String>getListFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageListName()), UtilMisc.<String, String, Object>getMapFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageMapName()), result); // the old way, makes a mess of messages passed up the stack: methodContext.putEnv(simpleMethod.getServiceErrorMessageName(), errorMessage); Debug.logError(new Exception(errorMessage), module); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/HasPermissionCondition.java Fri Jan 15 21:00:23 2010 @@ -74,7 +74,7 @@ } } else { // run hasPermission - if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { + if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { runSubOps = true; } } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java Fri Jan 15 21:00:23 2010 @@ -106,7 +106,7 @@ } ModelEntity modelEntity = delegator.getModelEntity(entityName); - + // create whereEntityCondition from whereCondition EntityCondition whereEntityCondition = null; if (this.whereCondition != null) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/CheckPermission.java Fri Jan 15 21:00:23 2010 @@ -104,7 +104,7 @@ // if no user is logged in, treat as if the user does not have permission: do not run subops GenericValue userLogin = methodContext.getUserLogin(); if (userLogin != null) { - Authorization authz = methodContext.getAuthz(); + Authorization authz = methodContext.getAuthz(); Security security = methodContext.getSecurity(); if (this.permissionInfo.hasPermission(methodContext, userLogin, authz, security)) { hasPermission = true; @@ -183,7 +183,7 @@ return security.hasEntityPermission(permission, action, userLogin); } else { // run hasPermission - return authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap()); + return authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap()); } } } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/ifops/IfHasPermission.java Fri Jan 15 21:00:23 2010 @@ -92,7 +92,7 @@ } } else { // run hasPermission - if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { + if (authz.hasPermission(userLogin.getString("userLoginId"), permission, methodContext.getEnvMap())) { runSubOps = true; } } Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java Fri Jan 15 21:00:23 2010 @@ -131,7 +131,7 @@ * @see org.ofbiz.security.Security#hasEntityPermission(java.lang.String, java.lang.String, javax.servlet.http.HttpSession) */ public boolean hasEntityPermission(String entity, String action, HttpSession session) { - if (session == null) { + if (session == null) { return false; } GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java Fri Jan 15 21:00:23 2010 @@ -31,67 +31,67 @@ import org.ofbiz.base.util.string.FlexibleStringExpander; public abstract class AbstractAuthorization implements Authorization { - + private static final String module = AbstractAuthorization.class.getName(); - + /** * Used to manage Auto-Grant permissions for the current "request" */ private static ThreadLocal<List<String>> autoGrant = new ThreadLocal<List<String>>(); private static ThreadLocal<String> origPermission = new ThreadLocal<String>(); private static ThreadLocal<String> uid = new ThreadLocal<String>(); - + private static final String[] basePermissions = { "access", "create", "read", "update", "delete" }; - + /** * Checks to see if the user has a static permission - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public abstract boolean hasStaticPermission(String userId, String permission, Map<String, ? extends Object> context); - + /** * Locates the Dynamic Access implementation for the permissions and invokes it - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public abstract boolean hasDynamicPermission(String userId, String permission, Map<String, ? extends Object> context); - + /** * Obtains a list of permissions auto-granted by the given permission - * + * * @param userId the user's userId * @param permission the expanded permission string * @param context name/value pairs used for permission lookup * @return a List of permission strings to auto-grant the user */ public abstract List<String> getAutoGrantPermissions(String userId, String permission, Map<String, ? extends Object> context); - + /** * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission * values for each match. * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example - * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} - * + * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} + * * NOTE: the regular expression can only be part of the base permission (before the first colon) - * + * * @param userId the user's userId - * @param permissionRegexp permission string containing regexp in the base position + * @param permissionRegexp permission string containing regexp in the base position * @param expanded true if the permission string is already expanded, false if it will contain ${} context values * @return a map of allowed or disallowed permissions */ public Map<String, Boolean> findMatchingPermission(String userId, String permissionRegexp, Map<String, ? extends Object> context) { Map<String, Boolean> resultMap = FastMap.newInstance(); - + String regexp = permissionRegexp.substring(0, permissionRegexp.indexOf(":")); String permStr = permissionRegexp.substring(permissionRegexp.indexOf(":")); - + Pattern p = Pattern.compile("^" + regexp + ":.*$"); for (String base : basePermissions) { Matcher m = p.matcher(base + permStr); @@ -102,19 +102,19 @@ } return resultMap; } - + /** * Test to see if the specified user has permission - * + * * @param userId the user's userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context) { // expand the permission string String expandedPermission = FlexibleStringExpander.expandString(permission, context); - + // verify the ThreadLocal data; make sure it isn't stale (from a thread pool) String threadUid = uid.get(); if (threadUid != null && !userId.equals(threadUid)) { @@ -123,7 +123,7 @@ uid.remove(); threadUid = null; } - + // set the tracking values on thread local boolean initialCall = false; if (UtilValidate.isEmpty(threadUid)) { @@ -131,12 +131,12 @@ uid.set(userId); initialCall = true; } - + // split the permission string; so we can walk up the levels String[] permSplit = expandedPermission.split(":"); StringBuilder joined = new StringBuilder(); int index = 1; - + if (permSplit != null && permSplit.length > 1) { if (Debug.verboseOn()) Debug.logVerbose("Security 2.0 schema found -- walking tree : " + expandedPermission, module); // start walking @@ -146,7 +146,7 @@ joined.append(":"); } joined.append(perm); - + // first check auto-granted permissions List<String> grantedPerms = autoGrant.get(); if (UtilValidate.isNotEmpty(grantedPerms)) { @@ -160,7 +160,7 @@ } } } - + // next check static permission if (hasStaticPermission(userId, joined.toString(), context)) { // permission granted @@ -170,7 +170,7 @@ } index++; } - + // finally check dynamic permission (outside the loop) String threadPerm = origPermission.get(); if (initialCall || !permission.equals(threadPerm)) { @@ -189,27 +189,27 @@ } return false; } - - protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map<String, ? extends Object> context) { + + protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map<String, ? extends Object> context) { List<String> granted = getAutoGrantPermissions(userId, expandedPermission, context); if (UtilValidate.isNotEmpty(granted)) { List<String> alreadyGranted = autoGrant.get(); if (alreadyGranted == null) { alreadyGranted = FastList.newInstance(); } - + // expand the auto-grant permissions for (String toGrant : granted) { - if (UtilValidate.isNotEmpty(toGrant)) { + if (UtilValidate.isNotEmpty(toGrant)) { String grantExpanded = FlexibleStringExpander.expandString(toGrant, context); if (Debug.verboseOn()) Debug.logVerbose("Adding auto-grant permission -- " + grantExpanded, module); - alreadyGranted.add(grantExpanded); + alreadyGranted.add(grantExpanded); } } - autoGrant.set(granted); + autoGrant.set(granted); } } - + /** * Used to clear the values set in ThreadLocal * -- needed when thread pools are used which do not handle clearing between requests @@ -217,6 +217,6 @@ public static void clearThreadLocal() { origPermission.remove(); autoGrant.remove(); - uid.remove(); + uid.remove(); } } Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/Authorization.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/Authorization.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/Authorization.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/Authorization.java Fri Jan 15 21:00:23 2010 @@ -28,42 +28,42 @@ /** * Test to see if the specified user has permission - * + * * @param userId the user's userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context); - + /** * Test to see if the specified user has permission - * + * * @param session HttpSession used to obtain the userId * @param permission the raw permission string - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return true if the user has permission */ public boolean hasPermission(HttpSession session, String permission, Map<String, ? extends Object> context); - + /** * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission * values for each match. * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example - * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} - * + * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} + * * NOTE: the regular expression can only be part of the base permission (before the first colon) - * + * * @param userId the user's userId * @param permissionRegexp permission string containing regexp in the base position - * @param context name/value pairs used for permission lookup + * @param context name/value pairs used for permission lookup * @return Map containing each permission as the key and a boolean if the permission is granted */ public Map<String, Boolean> findMatchingPermission(String userId, String permissionRegexp, Map<String, ? extends Object> context); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccess.java Fri Jan 15 21:00:23 2010 @@ -26,7 +26,7 @@ /** * Processes the dynamic permission check - * + * * @param userId the user's userId * @param permission the raw permission string * @param context name/value pairs needed for permission lookup @@ -39,10 +39,10 @@ * @return permission name */ public String getPermissionName(); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessFactory.java Fri Jan 15 21:00:23 2010 @@ -30,18 +30,18 @@ import org.ofbiz.entity.Delegator; public class DynamicAccessFactory { - + /** * Cache to store the DynamicAccess implementations */ private static UtilCache<String,DynamicAccessHandler> dynamicAccessHandlerCache = UtilCache.createUtilCache("security.DynamicAccessHandlerCache"); private static final String module = DynamicAccessFactory.class.getName(); - + public static DynamicAccessHandler getDynamicAccessHandler(Delegator delegator, String accessString) { if (dynamicAccessHandlerCache.size() == 0) { // should always be at least 1 loadAccessHandlers(delegator); } - + Set<? extends String> patterns = dynamicAccessHandlerCache.getCacheLineKeys(); for (String pattern : patterns) { if (!pattern.equals("*")) { // ignore the default pattern for now @@ -50,14 +50,14 @@ Matcher m = p.matcher(accessString); if (m.find()) { Debug.logInfo("Pattern [" + pattern + "] matched -- " + accessString, module); - return dynamicAccessHandlerCache.get(pattern); + return dynamicAccessHandlerCache.get(pattern); } } } - + return dynamicAccessHandlerCache.get("*"); } - + private static void loadAccessHandlers(Delegator delegator) { Iterator<DynamicAccessHandler> it = ServiceRegistry.lookupProviders(DynamicAccessHandler.class, DynamicAccessFactory.class.getClassLoader()); while (it.hasNext()) { @@ -66,7 +66,7 @@ dynamicAccessHandlerCache.put(handler.getPattern(), handler); } } - + @SuppressWarnings("unchecked") public static DynamicAccess loadDynamicAccessObject(Delegator delegator, String accessString) { DynamicAccess da = null; @@ -80,20 +80,20 @@ Debug.logError(e, module); return null; } - + if (clazz != null) { try { da = clazz.newInstance(); da.setDelegator(delegator); } catch (InstantiationException e) { Debug.logError(e, module); - return null; + return null; } catch (IllegalAccessException e) { Debug.logError(e, module); - return null; + return null; } } - + return da; } } Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/DynamicAccessHandler.java Fri Jan 15 21:00:23 2010 @@ -23,10 +23,10 @@ import org.ofbiz.entity.Delegator; public interface DynamicAccessHandler { - + /** * Method invoked to call the DynamicAccess implementation - * + * * @param accessString Access string for the permission * @param userId the user's userId * @param permission the raw permission string @@ -34,19 +34,19 @@ * @return the value returned from the DynamicAccess implementation */ public boolean handleDynamicAccess(String accessString, String userId, String permission, Map<String, ? extends Object> context); - + /** - * Returns the handlers matching pattern. - * Example: ^service:(.*)$ + * Returns the handlers matching pattern. + * Example: ^service:(.*)$ * Example: (^.*\.groovy$) - * + * * @return String containing the pattern this handler will control */ public String getPattern(); - + /** * Method for injecting the delegator object - * + * * @param delegator the Delegator object to use for the Authorization implementation */ public void setDelegator(Delegator delegator); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/GroovyDaHandler.java Fri Jan 15 21:00:23 2010 @@ -31,7 +31,7 @@ private static final String module = GroovyDaHandler.class.getName(); protected Delegator delegator; - + public String getPattern() { return "(^.*\\.groovy$)"; } @@ -43,18 +43,18 @@ bindings.put("permission", permission); bindings.put("userId", userId); bindings.put("permissionContext", context); - + Debug.log("Attempting to call groovy script : " + accessString, module); Object result = null; - + if (accessString.startsWith("component://")) { - // loaded using the OFBiz location API + // loaded using the OFBiz location API try { result = GroovyUtil.runScriptAtLocation(accessString, bindings); } catch (GeneralException e) { Debug.logWarning(e, module); } - + } else { // try the standard class path String classpathString = accessString.substring(0, accessString.lastIndexOf(".")); @@ -64,18 +64,18 @@ Debug.logWarning(e, module); } } - + // parse the result if (result != null && (result instanceof Boolean)) { return (Boolean) result; } else { Debug.logWarning("Groovy DynamicAccess implementation did not return a boolean [" + accessString + "]", module); } - + return false; } public void setDelegator(Delegator delegator) { - this.delegator = delegator; - } + this.delegator = delegator; + } } Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/da/ObjectDaHandler.java Fri Jan 15 21:00:23 2010 @@ -26,13 +26,13 @@ public class ObjectDaHandler implements DynamicAccessHandler { private static UtilCache<String,DynamicAccess> dynamicAccessCache = UtilCache.createUtilCache("security.DynamicAccessCache"); - + protected Delegator delegator; - + public void setDelegator(Delegator delegator) { - this.delegator = delegator; + this.delegator = delegator; } - + public String getPattern() { // returns "*" as a fall back pattern (catch all) // if no other handler comes back this handler will catch @@ -46,17 +46,17 @@ } return false; } - + private DynamicAccess getDynamicAccessObject(String name) { DynamicAccess da = dynamicAccessCache.get(name); - + if (da == null) { da = DynamicAccessFactory.loadDynamicAccessObject(delegator, name); if (da != null) { dynamicAccessCache.put(name, da); } } - + return da; - } + } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java Fri Jan 15 21:00:23 2010 @@ -252,7 +252,7 @@ public Authorization getAuthorization() { return dispatcher.getAuthorization(); } - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericAbstractDispatcher.java Fri Jan 15 21:00:23 2010 @@ -221,11 +221,11 @@ /** * @see org.ofbiz.service.LocalDispatcher#getAuthorization() - */ + */ public Authorization getAuthorization() { return dispatcher.getAuthorization(); } - + /** * @see org.ofbiz.service.LocalDispatcher#getSecurity() */ Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/LocalDispatcher.java Fri Jan 15 21:00:23 2010 @@ -324,7 +324,7 @@ * @return Authorization object associated with this dispatcher */ public Authorization getAuthorization(); - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java Fri Jan 15 21:00:23 2010 @@ -136,15 +136,15 @@ public String getMode() { return this.mode; } - + public String getEntityName() { return this.entityName; } - + public String getFieldName() { return this.fieldName; } - + public boolean getInternal() { return this.internal; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Fri Jan 15 21:00:23 2010 @@ -1205,7 +1205,7 @@ throw new WSDLException("can not create WSDL", module); } def.setTypes(this.getTypes(document, def)); - + // set the IN parameters Input input = def.createInput(); Set<String> inParam = this.getInParamNames(); @@ -1325,7 +1325,7 @@ SOAPOperation soapOperation = new SOAPOperationImpl(); // soapAction should be set to the location of the SOAP URI, or Visual Studio won't construct the correct SOAP message - soapOperation.setSoapActionURI(locationURI); + soapOperation.setSoapActionURI(locationURI); // this is the RPC/literal style. See http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ // this parameter is necessary or Apache Synapse won't recognize the WSDL soapOperation.setStyle("rpc"); @@ -1350,7 +1350,7 @@ service.addPort(port); def.addService(service); } - + public Types getTypes(Document document, Definition def) { Types types = def.createTypes(); /* Schema */ @@ -1360,7 +1360,7 @@ /*-----------------------------------*/ /*--------- Standard Objects --------*/ /*-----------------------------------*/ - + /* std-String Element */ Element stdStringElement = document.createElement("xsd:element"); stdStringElement.setAttribute("name", "std-String"); @@ -1442,7 +1442,7 @@ /*-----------------------------------*/ /*----------- SQL Objects -----------*/ /*-----------------------------------*/ - + /* sql-Timestamp Element */ Element sqlTimestampElement = document.createElement("xsd:element"); sqlTimestampElement.setAttribute("name", "sql-Timestamp"); @@ -1480,7 +1480,7 @@ /*-----------------------------------*/ /*----------- List Objects -----------*/ /*-----------------------------------*/ - + /* col-ArrayList Element */ Element colArrayListElement = document.createElement("xsd:element"); colArrayListElement.setAttribute("name", "col-ArrayList"); @@ -1516,11 +1516,11 @@ colCollectionElement.setAttribute("name", "col-Collection"); colCollectionElement.setAttribute("type", "tns:col-Collection"); schema.appendChild(colCollectionElement); - + /*-----------------------------------*/ /*----------- Map Objects -----------*/ /*-----------------------------------*/ - + /* map-TreeMap Element */ Element mapTreeMapElement = document.createElement("xsd:element"); mapTreeMapElement.setAttribute("name", "map-TreeMap"); @@ -1590,7 +1590,7 @@ /*-----------------------------------*/ /*----------- Custom Objects -----------*/ /*-----------------------------------*/ - + /* cus-obj Element */ Element cusObjElement = document.createElement("xsd:element"); cusObjElement.setAttribute("name", "cus-obj"); @@ -1604,7 +1604,7 @@ /*-----------------------------------*/ /*---------- Complex Types ----------*/ /*-----------------------------------*/ - + /* map-Map Complex Type */ Element mapMapComplexType = document.createElement("xsd:complexType"); mapMapComplexType.setAttribute("name", "map-Map"); @@ -1774,7 +1774,7 @@ mapValueComplexType25.setAttribute("maxOccurs", "1"); mapValueComplexType0.appendChild(mapValueComplexType25); schema.appendChild(mapValueComplexType); - + /* col-Collection Complex Type */ Element colCollectionComplexType = document.createElement("xsd:complexType"); colCollectionComplexType.setAttribute("name", "col-Collection"); @@ -1906,7 +1906,7 @@ colCollectionComplexType25.setAttribute("maxOccurs", "unbounded"); colCollectionComplexType0.appendChild(colCollectionComplexType25); schema.appendChild(colCollectionComplexType); - + types.setDocumentationElement(schema); return types; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java Fri Jan 15 21:00:23 2010 @@ -807,7 +807,7 @@ public Authorization getAuthorization() { return this.authz; } - + /** * Gets the Security object associated with this dispatcher * @return Security object associated with this dispatcher Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java Fri Jan 15 21:00:23 2010 @@ -76,11 +76,11 @@ /** A little short-cut method to check to see if a service was successful (neither error or failed) */ public static boolean isSuccess(Map<String, ? extends Object> results) { if (ServiceUtil.isError(results) || ServiceUtil.isFailure(results)) { - return false; + return false; } return true; } - + /** A small routine used all over to improve code efficiency, make a result map with the message and the error response code */ public static Map<String, Object> returnError(String errorMessage) { return returnProblem(ModelService.RESPOND_ERROR, errorMessage, null, null, null); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java Fri Jan 15 21:00:23 2010 @@ -189,7 +189,7 @@ return false; } } - + @Override public String toString() { return "ServiceEcaRule:" + this.serviceName + ":" + this.eventName + ":runOnError=" + this.runOnError + ":runOnFailure=" + this.runOnFailure + ":enabled=" + this.enabled + ":conditions=" + this.conditions + ":actionsAndSets=" + this.actionsAndSets; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java Fri Jan 15 21:00:23 2010 @@ -81,7 +81,7 @@ } else if (UtilValidate.isNotEmpty(this.envName) && context.get(this.envName) != null) { newValue = this.format((String) context.get(this.envName), context); } - + if (newValue != null) { if (UtilValidate.isNotEmpty(this.mapName)) { valueMap.put(this.fieldName, newValue); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java Fri Jan 15 21:00:23 2010 @@ -82,10 +82,10 @@ Delegator delegator = dispatcher.getDelegator(); if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); - + ServiceClient client = null; QName serviceName = null; - + try { client = new ServiceClient(); Options options = new Options(); @@ -95,19 +95,19 @@ } catch (AxisFault e) { throw new GenericServiceException("RPC service error", e); } - + List<ModelParam> inModelParamList = modelService.getInModelParamList(); - + if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module); - + if (UtilValidate.isNotEmpty(modelService.nameSpace)) { serviceName = new QName(modelService.nameSpace, modelService.invoke); } else { serviceName = new QName(modelService.invoke); } - + int i = 0; - + Map<String, Object> parameterMap = FastMap.newInstance(); for (ModelParam p: inModelParamList) { if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ") - " + i, module); @@ -120,7 +120,7 @@ } OMElement parameterSer = null; - + try { String xmlParameters = XmlSerializer.serialize(parameterMap); XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlParameters)); @@ -129,7 +129,7 @@ } catch (Exception e) { Debug.logError(e, module); } - + Map<String, Object> results = null; try { OMFactory factory = OMAbstractFactory.getOMFactory(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/StandardJavaEngine.java Fri Jan 15 21:00:23 2010 @@ -100,7 +100,7 @@ result = m.invoke(null, dctx, context); } else { result = m.invoke(c.newInstance(), dctx, context); - } + } } catch (ClassNotFoundException cnfe) { throw new GenericServiceException("Cannot find service [" + modelService.name + "] location class", cnfe); } catch (NoSuchMethodException nsme) { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/AbstractJob.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/AbstractJob.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/AbstractJob.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/AbstractJob.java Fri Jan 15 21:00:23 2010 @@ -77,7 +77,7 @@ * Executes the Job. */ public abstract void exec() throws InvalidJobException; - + public boolean isQueued() { return queued; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobInvoker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobInvoker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobInvoker.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobInvoker.java Fri Jan 15 21:00:23 2010 @@ -216,7 +216,7 @@ this.thread.interrupt(); this.thread = null; } - + public synchronized void run() { while (run) { Job job = jp.next(); @@ -270,7 +270,7 @@ // increment the count count++; if (Debug.verboseOn()) Debug.logVerbose("Invoker: " + thread.getName() + " (" + count + ") total.", module); - + // reset thread local security AbstractAuthorization.clearThreadLocal(); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Fri Jan 15 21:00:23 2010 @@ -82,7 +82,7 @@ jp = new JobPoller(this, enabled); JobManager.registeredManagers.put(delegator.getDelegatorName(), this); } - + public static JobManager getInstance(Delegator delegator, boolean enabled) { JobManager jm = JobManager.registeredManagers.get(delegator.getDelegatorName()); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Fri Jan 15 21:00:23 2010 @@ -315,7 +315,7 @@ long messageSize = message.getSize(); if (message instanceof MimeMessage && messageSize >= maxSize) { Debug.logWarning("Message from: " + message.getFrom()[0] + "not received, too big, size:" + messageSize + " cannot be more than " + maxSize + " bytes", module); - + // set the message as read so it doesn't continue to try to process; but don't delete it message.setFlag(Flags.Flag.SEEN, true); } else { @@ -323,14 +323,14 @@ if (Debug.verboseOn()) Debug.logVerbose("Message from " + UtilMisc.toListArray(message.getFrom()) + " with subject [" + message.getSubject() + "] has been processed." , module); message.setFlag(Flags.Flag.SEEN, true); if (Debug.verboseOn()) Debug.logVerbose("Message [" + message.getSubject() + "] is marked seen", module); - + // delete the message after processing if (deleteMail) { if (Debug.verboseOn()) Debug.logVerbose("Message [" + message.getSubject() + "] is being deleted", module); message.setFlag(Flags.Flag.DELETED, true); } } - } + } } // expunge and close the folder Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java Fri Jan 15 21:00:23 2010 @@ -76,14 +76,14 @@ public void setMessage(MimeMessage message) { if (message != null) { // serialize the message - this.message = message; + this.message = message; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { message.writeTo(baos); baos.flush(); serializedBytes = baos.toByteArray(); this.contentType = message.getContentType(); - + // see if this is a multi-part message Object content = message.getContent(); if (content instanceof Multipart) { @@ -121,7 +121,7 @@ } return message; } - + public String getFirstHeader(String header) { String[] headers = getHeader(header); if (headers != null && headers.length > 0) { @@ -139,67 +139,67 @@ return null; } } - + public Address[] getFrom() { MimeMessage message = getMessage(); try { return message.getFrom(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getTo() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.TO); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getCc() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.CC); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Address[] getBcc() { MimeMessage message = getMessage(); try { return message.getRecipients(MimeMessage.RecipientType.BCC); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public String getSubject() { MimeMessage message = getMessage(); try { return message.getSubject(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public String getMessageId() { MimeMessage message = getMessage(); try { return message.getMessageID(); } catch (MessagingException e) { Debug.logError(e, module); - return null; + return null; } } - + public Timestamp getSentDate() { MimeMessage message = getMessage(); try { @@ -209,7 +209,7 @@ return null; } } - + public Timestamp getReceivedDate() { MimeMessage message = getMessage(); try { @@ -219,15 +219,15 @@ return null; } } - + public String getContentType() { return contentType; } - + public int getMainPartCount() { return this.parts; } - + public int getSubPartCount(int index) { BodyPart part = getPart(Integer.toString(index)); try { @@ -242,10 +242,10 @@ return -1; } } - + public List<String> getAttachmentIndexes() { - List<String> attachments = FastList.newInstance(); - if (getMainPartCount() == 0) { // single part message (no attachments) + List<String> attachments = FastList.newInstance(); + if (getMainPartCount() == 0) { // single part message (no attachments) return attachments; } else { for (int i = 0; i < getMainPartCount(); i++) { @@ -253,23 +253,23 @@ String idx = Integer.toString(i); if (subPartCount > 0) { for (int si = 0; si < subPartCount; si++) { - String sidx = idx + "." + Integer.toString(si); + String sidx = idx + "." + Integer.toString(si); if (getPartDisposition(sidx) != null && (getPartDisposition(sidx).equals(Part.ATTACHMENT) || getPartDisposition(sidx).equals(Part.INLINE))) { - attachments.add(sidx); + attachments.add(sidx); } } - } else { + } else { if (getPartDisposition(idx) != null && (getPartDisposition(idx).equals(Part.ATTACHMENT) || getPartDisposition(idx).equals(Part.INLINE))) { - attachments.add(idx); + attachments.add(idx); } } } return attachments; } } - + public String getMessageBody() { MimeMessage message = getMessage(); if (getMainPartCount() == 0) { // single part message @@ -278,7 +278,7 @@ return getContentText(content); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } else { // multi-part message StringBuffer body = new StringBuffer(); @@ -290,7 +290,7 @@ String sidx = idx + "." + Integer.toString(si); if (getPartContentType(sidx) != null && getPartContentType(sidx).toLowerCase().startsWith("text")) { if (getPartDisposition(sidx) == null || getPartDisposition(sidx).equals(Part.INLINE)) { - body.append(getPartText(sidx)).append("\n"); + body.append(getPartText(sidx)).append("\n"); } } } @@ -298,15 +298,15 @@ if (getPartContentType(idx) != null && getPartContentType(idx).toLowerCase().startsWith("text")) { // make sure the part isn't an attachment if (getPartDisposition(idx) == null || getPartDisposition(idx).equals(Part.INLINE)) { - body.append(getPartText(idx)).append("\n"); + body.append(getPartText(idx)).append("\n"); } } } } return body.toString(); - } + } } - + public String getMessageBodyContentType() { String contentType = getContentType(); if (contentType != null && contentType.toLowerCase().startsWith("text")) { @@ -320,7 +320,7 @@ String sidx = idx + "." + Integer.toString(si); if (getPartContentType(sidx) != null && getPartContentType(sidx).toLowerCase().startsWith("text")) { if (getPartDisposition(sidx) == null || getPartDisposition(sidx).equals(Part.INLINE)) { - return getPartContentType(sidx); + return getPartContentType(sidx); } } } @@ -328,7 +328,7 @@ if (getPartContentType(idx) != null && getPartContentType(idx).toLowerCase().startsWith("text")) { // make sure the part isn't an attachment if (getPartDisposition(idx) == null || getPartDisposition(idx).equals(Part.INLINE)) { - return getPartContentType(idx); + return getPartContentType(idx); } } } @@ -336,21 +336,21 @@ } return "text/html"; } - + public String getMessageRawText() { MimeMessage message = getMessage(); try { return getTextFromStream(message.getInputStream()); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } - - public String getPartDescription(String index) { + + public String getPartDescription(String index) { BodyPart part = getPart(index); if (part != null) { - try { + try { return part.getDescription(); } catch (MessagingException e) { Debug.logError(e, module); @@ -358,13 +358,13 @@ } } else { return null; - } + } } - - public String getPartContentType(String index) { + + public String getPartContentType(String index) { BodyPart part = getPart(index); if (part != null) { - try { + try { return part.getContentType(); } catch (MessagingException e) { Debug.logError(e, module); @@ -372,9 +372,9 @@ } } else { return null; - } + } } - + public String getPartDisposition(String index) { BodyPart part = getPart(index); if (part != null) { @@ -388,7 +388,7 @@ return null; } } - + public String getPartFilename(String index) { BodyPart part = getPart(index); if (part != null) { @@ -402,23 +402,23 @@ return null; } } - + public ByteBuffer getPartByteBuffer(String index) { BodyPart part = getPart(index); - if (part != null) { + if (part != null) { try { InputStream stream = part.getInputStream(); return getByteBufferFromStream(stream); } catch (Exception e) { Debug.logError(e, module); return null; - } + } } else { return null; - } + } } - - public String getPartText(String index) { + + public String getPartText(String index) { BodyPart part = getPart(index); if (part != null) { try { @@ -431,8 +431,8 @@ return null; } } - - public String getPartRawText(String index) { + + public String getPartRawText(String index) { BodyPart part = getPart(index); if (part != null) { try { @@ -445,15 +445,15 @@ return null; } } - + public BodyPart getPart(String indexStr) { - int mainIndex, subIndex; + int mainIndex, subIndex; try { if (indexStr.indexOf(".") == -1) { mainIndex = Integer.parseInt(indexStr); subIndex = -1; } else { - String[] indexSplit = indexStr.split("\\."); + String[] indexSplit = indexStr.split("\\."); mainIndex = Integer.parseInt(indexSplit[0]); subIndex = Integer.parseInt(indexSplit[1]); } @@ -464,7 +464,7 @@ Debug.logError(e, "Illegal index string format. Should be part 'dot' subpart: " + indexStr, module); return null; } - + if (getMainPartCount() > 0 && getMainPartCount() > mainIndex) { MimeMessage message = this.getMessage(); try { @@ -495,7 +495,7 @@ return null; } } - + protected String getContentText(Object content) { if (content == null) return null; if (content instanceof String) { @@ -507,14 +507,14 @@ return getTextFromStream(((Message) content).getInputStream()); } catch (Exception e) { Debug.logError(e, module); - return null; + return null; } } else { Debug.logWarning("Content was not a string or a stream; no known handler -- " + content.toString(), module); return null; } } - + protected String getTextFromStream(InputStream stream) { StringBuilder builder = new StringBuilder(); byte[] buffer = new byte[4096]; @@ -528,11 +528,11 @@ } return builder.toString(); } - + protected ByteBuffer getByteBufferFromStream(InputStream stream) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; - try { + try { for (int n; (n = stream.read(buffer)) != -1;) { baos.write(buffer, 0, n); } @@ -540,7 +540,7 @@ Debug.logError(e, module); return null; } - + return ByteBuffer.wrap(baos.toByteArray()); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java Fri Jan 15 21:00:23 2010 @@ -43,11 +43,11 @@ * javolution.jar * jdbm.jar * log4j.jar - * + * * Copy the truststore file framework/base/config/ofbizrmi-truststore.jks to the client - * + * * Run the client specifying the path to the client truststore: -Djavax.net.ssl.trustStore=ofbizrmi-truststore.jks - * + * */ public class ExampleRemoteClient { Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java Fri Jan 15 21:00:23 2010 @@ -11,14 +11,14 @@ import org.ofbiz.service.testtools.OFBizTestCase; public class ServiceSOAPTests extends OFBizTestCase { - + public final static String module = ServiceSOAPTests.class.getName(); public ServiceSOAPTests(String name) { // TODO Auto-generated constructor stub super(name); } - + public void testSOAPSimpleService() throws Exception { Map<String, Object> serviceContext = FastMap.newInstance(); serviceContext.put("defaultValue", new Double("123.4567")); @@ -26,7 +26,7 @@ Map<String, Object> results = dispatcher.runSync("testSoapSimple", serviceContext); String resp = (String) results.get("resp"); } - + public void testSOAPService() throws Exception { Map<String, Object> serviceContext = FastMap.newInstance(); GenericValue testing = delegator.makeValue("Testing"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/testtools/OFBizTestCase.java Fri Jan 15 21:00:23 2010 @@ -25,7 +25,7 @@ public class OFBizTestCase extends EntityTestCase { protected LocalDispatcher dispatcher = null; - + public LocalDispatcher getDispatcher() { return dispatcher; } Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Main.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Main.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Main.java (original) +++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Main.java Fri Jan 15 21:00:23 2010 @@ -22,13 +22,13 @@ import java.util.Map; public final class Main { - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { Planner<?, ?, ?, ?, ?, ?, ?> planner = new DebugPlanner(); - List<SQLStatement<?>> statements = new Parser(System.in).SQLFile(); + List<SQLStatement<?>> statements = new Parser(System.in).SQLFile(); for (SQLStatement<?> statement: statements) { run(statement, planner); } - } + } private static final void run(SQLStatement statement, Planner planner) { System.err.println(statement); Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/ModelTestSuite.java Fri Jan 15 21:00:23 2010 @@ -66,7 +66,7 @@ this.originalDispatcherName = mainElement.getAttribute("dispatcher-name"); if (UtilValidate.isEmpty(this.originalDispatcherName)) this.originalDispatcherName = "test-dispatcher"; - + String uniqueSuffix = "-" + RandomStringUtils.randomAlphanumeric(10); this.delegator = DelegatorFactory.getDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix); @@ -150,12 +150,12 @@ Delegator getDelegator() { return this.delegator; } - + List<Test> getTestList() { return testList; } - - + + public TestSuite makeTestSuite() { TestSuite suite = new TestSuite(); suite.setName(this.getSuiteName()); @@ -166,7 +166,7 @@ return suite; } - + private void prepareTest(Test test) { if (test instanceof TestSuite) { Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Fri Jan 15 21:00:23 2010 @@ -244,7 +244,7 @@ } else { return test.getClass().getName(); } - + } } } Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/VerifySeleniumSetups.java Fri Jan 15 21:00:23 2010 @@ -42,9 +42,9 @@ } - /* prepare lib for selenium test + /* prepare lib for selenium test * Check & download selenium-server.jar from http://downloads.sourceforge.net/seleniumxml/selenium-server-1.0-SNAPSHOT-20081126.jar?use_mirror= - * Check a change use HTTP as the default at file framework/webapp/config/url.properties + * Check a change use HTTP as the default at file framework/webapp/config/url.properties * Check correct the config/seleniumXml.properties and firefox path */ @@ -54,7 +54,7 @@ Map<String,Object> msgMap = FastMap.newInstance(); Properties urlProps = null; try{ - /* Check and down load selenium-server.jar */ + /* Check and down load selenium-server.jar */ File file = new File(libPath); URL url = new URL(urlSite); URLConnection connection = url.openConnection(); Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoader.java Fri Jan 15 21:00:23 2010 @@ -40,15 +40,15 @@ private SeleniumXml parent; private SeleniumXml currentTest; private List<Element> children; - + private int currentRowIndx; - - + + //Objects initialized from csvreader script. private PyDictionary fieldNameMap; private PyList dataList; private PyList fieldNames; - + public DataLoader(String file, String iterations, SeleniumXml parent, List<Element> children) { super(); this.file = file; @@ -66,7 +66,7 @@ Map<String, Object> map = FastMap.newInstance(); map.put("file", this.file); interp.set("params", map); - + interp.exec("from csvreader import CSVReader"); String cmd = "reader = CSVReader('" + this.file + "')"; interp.exec(cmd); @@ -75,17 +75,17 @@ this.fieldNameMap = (PyDictionary) interp.eval("reader.fieldNameMap"); //interp.execfile("c:/dev/ag/seleniumxml/plugins/csvreader.py"); //interp.execfile("c:/dev/ag/seleniumxml/plugins/TestCSVReader.py"); - + //Now get output from script //this.dataList = (PyArray) map.get("dataList"); //this.fieldNames = (PyDictionary) map.get("fieldNames"); - + } - + private void next() { this.currentRowIndx = (this.currentRowIndx + 1) % this.dataList.__len__(); } - + private void loadData() { int size = this.fieldNames.__len__(); @@ -98,9 +98,9 @@ PyObject value = valueList.__getitem__(convIndx); this.currentTest.addParam((String) name.__tojava__(String.class), (String) value.__tojava__(String.class)); } - + } - + public void runTest() throws TestCaseException { //Depending on the iteration instruction repeat the following until complete @@ -110,13 +110,13 @@ if(iter == -1) { iter = this.dataList.__len__(); } - + this.currentTest = new SeleniumXml(this.parent); for( int i=0; i<iter; i++) { loadData(); currentTest.runCommands(this.children); next(); } - + } } Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoop.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoop.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoop.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/DataLoop.java Fri Jan 15 21:00:23 2010 @@ -40,16 +40,16 @@ private SeleniumXml parent; private SeleniumXml currentTest; private List<Element> children; - + private int currentRowIndx; - + public DataLoop(String dataListName, SeleniumXml parent, List<Element> children) { super(); this.dataListName = dataListName; this.parent = parent; this.children = children; } - + public void runTest() throws TestCaseException { this.currentTest = new SeleniumXml(this.parent); Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/GroovyRunner.java Fri Jan 15 21:00:23 2010 @@ -41,10 +41,10 @@ private String urlName; private SeleniumXml parent; private SeleniumXml currentTest; - + private int currentRowIndx; - - + + public GroovyRunner(String urlName, SeleniumXml parent) { super(); this.urlName = urlName; @@ -68,8 +68,8 @@ } catch(IOException e) { System.out.println("Scriptrunner, runTest, IOException error: " + e.getMessage()); } - - + + } - + } Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/InitJython.java Fri Jan 15 21:00:23 2010 @@ -35,44 +35,44 @@ public class InitJython { // public Logger logger = Logger.getLogger(InitJython.class.getName()); - + private static PythonInterpreter SINGLETON; - + /** Only allow creation through the factory method */ protected InitJython() { // logger.setLevel(Level.DEBUG); - } - + } + /** - * getInterpreter initializes the Python environment the first time. It then issues a + * getInterpreter initializes the Python environment the first time. It then issues a * new Interpreter for each request. * @return PythonInterpreter */ public static PythonInterpreter getInterpreter() { - + if (SINGLETON == null) { synchronized (InitJython.class) { Properties props = System.getProperties(); //String ofbizHome = props.getProperty("ofbiz.home"); - + Properties pyProps = new Properties(); - + if( props.getProperty("python.home") == null) { //pyProps.setProperty("python.home", "c:/devtools/jython2.2rc2"); pyProps.setProperty("python.home", "c:/devtools/Python24"); - } - + } + //Debug.logInfo(props.toString(), module); ClassLoader loader = Thread.currentThread().getContextClassLoader(); PySystemState.initialize(props, pyProps, new String[0], loader); - + SINGLETON = new PythonInterpreter(); - - SINGLETON.exec("import sys"); - SINGLETON.exec("sys.path.append(\"c:/dev/ag/seleniumXml/plugins\")"); + + SINGLETON.exec("import sys"); + SINGLETON.exec("sys.path.append(\"c:/dev/ag/seleniumXml/plugins\")"); } } - + return SINGLETON; } } Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/JythonRunner.java Fri Jan 15 21:00:23 2010 @@ -30,10 +30,10 @@ private String urlName; private SeleniumXml parent; private SeleniumXml currentTest; - + private int currentRowIndx; - - + + public JythonRunner(String urlName, SeleniumXml parent) { super(); this.urlName = urlName; @@ -43,7 +43,7 @@ public void runTest() { PythonInterpreter interp = InitJython.getInterpreter(); - + Map<String, Object> map = this.parent.getMap(); map.put("url", this.urlName); try { @@ -55,8 +55,8 @@ } catch(IOException e) { System.out.println("Scriptrunner, runTest, IOException error: " + e.getMessage()); } - - + + } - + } Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/seleniumxml/RemoteRequest.java Fri Jan 15 21:00:23 2010 @@ -63,20 +63,20 @@ public static final String module = RemoteRequest.class.getName(); - /** + /** * The default parameters. * Instantiated in {@link #setup setup}. - */ + */ private static HttpParams defaultParameters = null; - + /** * The scheme registry. * Instantiated in {@link #setup setup}. - */ + */ private static SchemeRegistry supportedSchemes; final private static String JsonHandleMode = "JSON_HANDLE"; final private static String HttpHandleMode = "HTTP_HANDLE"; - + private SeleniumXml parent; private SeleniumXml currentTest; private List <Element>children; @@ -85,18 +85,18 @@ private String requestUrl; private String host; private String responseHandlerMode; - + //Login-As parameters private String loginAsUrl; private String loginAsUserParam; private String loginAsPasswordParam; - + private int currentRowIndx; - + static { - + supportedSchemes = new SchemeRegistry(); - + // Register the "http" protocol scheme, it is required // by the default operator to look up socket factories. SocketFactory sf = PlainSocketFactory.getSocketFactory(); @@ -112,18 +112,18 @@ } public RemoteRequest(SeleniumXml parent, List<Element> children, List<Element> loginAs, String requestUrl, String hostString, String responseHandlerMode) { - + this(parent, children, requestUrl, hostString, responseHandlerMode); if(loginAs != null && !loginAs.isEmpty()) { Element elem = loginAs.get(0); - + this.loginAsUserParam = elem.getAttributeValue("username-param"); this.loginAsPasswordParam = elem.getAttributeValue("password-param"); this.loginAsUrl = elem.getAttributeValue("url"); - + } } - + public RemoteRequest(SeleniumXml parent, List<Element> children, String requestUrl, String hostString, String responseHandlerMode) { super(); this.parent = parent; @@ -137,7 +137,7 @@ } private void initData() { - + this.inMap = FastMap.newInstance(); this.outMap = FastMap.newInstance(); String nm, name, value, fieldName = null; @@ -145,7 +145,7 @@ nm = elem.getName(); if (nm.equals("param-in")) { name = elem.getAttributeValue("name"); - value = this.parent.replaceParam(elem.getAttributeValue("value")); + value = this.parent.replaceParam(elem.getAttributeValue("value")); System.out.println("RemoteRequest, param-in, name: " + name + ", value: " + value); this.inMap.put(name, value); } else if (nm.equals("param-out")) { @@ -159,7 +159,7 @@ } return; } - + public void runTest() { ClientConnectionManager ccm = @@ -180,17 +180,17 @@ // Create a local instance of cookie store CookieStore cookieStore = new BasicCookieStore(); localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore); - + Header sessionHeader = null; - + if(this.loginAsUrl != null ) { - + String loginAsUri = this.host + this.loginAsUrl; String loginAsParamString = "?" + this.loginAsUserParam + "&" + this.loginAsPasswordParam; - + HttpGet req2 = new HttpGet ( loginAsUri + loginAsParamString ); System.out.println("loginAsUrl:" + loginAsUri + loginAsParamString); - + req2.setHeader("Connection","Keep-Alive"); HttpResponse rsp = client.execute(req2, localContext); @@ -208,7 +208,7 @@ for (int i = 0; i < cookies.size(); i++) { System.out.println("Local cookie(0): " + cookies.get(i)); } - } + } //String paramString2 = "USERNAME=" + this.parent.getUserName() // + "&PASSWORD=" + this.parent.getPassword(); //String thisUri2 = this.host + "/eng/control/login?" + paramString2; @@ -227,20 +227,20 @@ // System.out.println(headers[i]); // System.out.println(hdr.getName() + " : " + hdr.getValue()); //} - + //List<Cookie> cookies = cookieStore.getCookies(); //System.out.println("cookies.size(): " + cookies.size()); //for (int i = 0; i < cookies.size(); i++) { // System.out.println("Local cookie(0): " + cookies.get(i)); //} if (HttpHandleMode.equals(this.responseHandlerMode)) { - + } else { responseHandler = new JsonResponseHandler(this); } - + String paramString = urlEncodeArgs(this.inMap, false); - + String thisUri = null; if(sessionHeader != null) { String sessionHeaderValue = sessionHeader.getValue(); @@ -259,7 +259,7 @@ //String thisUri = this.host + this.requestUrl + ";jsessionid=" + sessionId + "?" + paramString; //String thisUri = this.host + this.requestUrl + "?" + paramString; System.out.println("thisUri: " + thisUri); - + HttpGet req = new HttpGet ( thisUri ); if(sessionHeader != null) { req.setHeader(sessionHeader); @@ -301,19 +301,19 @@ } return; } - + private void login(DefaultHttpClient client, BasicHttpContext localContext) throws IOException{ - + String paramString = "USERNAME=" + this.parent.getUserName() + "&PASSWORD=" + this.parent.getPassword(); String thisUri = this.host + "/eng/control/login?" + paramString; HttpGet req = new HttpGet ( thisUri ); req.setHeader("Connection","Keep-Alive"); client.execute(req, localContext); - - //client.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), + + //client.getCredentialsProvider().setCredentials(new AuthScope("localhost", 8080), // new UsernamePasswordCredentials(this.parent.getUserName(), this.parent.getPassword())); - + return; } /** URL Encodes a Map of arguements */ @@ -356,18 +356,18 @@ } return buf.toString(); } - + public class JsonResponseHandler extends BasicResponseHandler { - + private RemoteRequest parentRemoteRequest; - + public JsonResponseHandler(RemoteRequest parentRemoteRequest) { super(); this.parentRemoteRequest = parentRemoteRequest; } - public String handleResponse(org.apache.http.HttpResponse response) + public String handleResponse(org.apache.http.HttpResponse response) throws HttpResponseException, IOException { - + String bodyString = super.handleResponse(response); JSONObject jsonObject = null; try { @@ -388,6 +388,6 @@ } return bodyString; } - + } } |
| Free forum by Nabble | Edit this page |
