diff --git a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java index 03ac5abe81b..35cd9076fdb 100644 --- a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java +++ b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxResponse.java @@ -60,20 +60,12 @@ public WOResponse generateResponse() { String originalSenderID = _context.senderID(); _context._setSenderID(""); try { - CharSequence content; - //AK: don't ask... - // MS: 5.3 vs 5.4 field type of _content - if (((Object)_content) instanceof StringBuffer) { - content = (StringBuffer)(Object)_content; - ERXKeyValueCodingUtilities.takePrivateValueForKey(this, new StringBuffer(), "_content"); - } else { - content = (StringBuilder)(Object) _content; - ERXKeyValueCodingUtilities.takePrivateValueForKey(this, new StringBuilder(), "_content"); - } + CharSequence originalContent = _content; + _content = new StringBuilder(); NSMutableDictionary userInfo = AjaxUtils.mutableUserInfo(_request); userInfo.setObjectForKey(Boolean.TRUE, AjaxResponse.AJAX_UPDATE_PASS); WOActionResults woactionresults = WOApplication.application().invokeAction(_request, _context); - _content.append(content); + _content.append(originalContent); if (_responseAppenders != null) { Enumeration responseAppendersEnum = _responseAppenders.objectEnumerator(); while (responseAppendersEnum.hasMoreElements()) { @@ -81,16 +73,8 @@ public WOResponse generateResponse() { responseAppender.appendToResponse(this, _context); } } - int length; - if (((Object)_content) instanceof StringBuffer) { - StringBuffer buffer = (StringBuffer)(Object)_content; - length = buffer.length(); - } else { - StringBuilder builder = (StringBuilder)(Object) _content; - length = builder.length(); - } - if (length == 0) { - setStatus(HTTP_STATUS_INTERNAL_ERROR); + if (_contentLength() == 0) { + setStatus(HTTP_STATUS_INTERNAL_ERROR); Ajax.log.warn("You performed an Ajax update, but no response was generated. A common cause of this is that you spelled your updateContainerID wrong. You specified a container ID '" + AjaxUpdateContainer.updateContainerID(_request) + "'."); } } diff --git a/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java b/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java index a18ba6709fb..9dc276bf919 100644 --- a/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java +++ b/Frameworks/Ajax/ERCoolComponents/Sources/er/coolcomponents/CCSubmitLink.java @@ -51,22 +51,19 @@ public CCSubmitLink(WOContext context) { super(context); } - @SuppressWarnings("deprecation") + @Override public WOActionResults invokeAction(WORequest request, WOContext context) { String formValue = (String) request.formValueForKey(fieldName()); if (fieldName().equals(formValue)) { // Tell context that an action was performed. If this is // not done, the form's default action will be called also. // *note* Uses undocumented method of WOContext. - // - // deprecated call required to maintain WO5.3 compatibility. - // change to context.setActionInvoked(true) once move to - // WO5.4+ is complete -davidleber context.setActionInvoked(true); } return super.invokeAction(request, context); } + @Override public void appendToResponse(WOResponse response, WOContext context) { // Check if the link is in a form so we know if we need to // use the link and a hidden field to submit the form. diff --git a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java index 98e4d1a380d..4abf7788fdb 100644 --- a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java +++ b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirectAction.java @@ -241,14 +241,8 @@ public NSDictionary primaryKeyFromRequest(EOEditingContext ec, String entityName public WOComponent previousPageFromRequest() { String cid = context().request().stringFormValueForKey(contextIDKey); - if(cid == null) return context().page(); - WOComponent comp = session().restorePageForContextID(cid); - // (ak) we need to put the component to sleep again - // Michael Bushkov: WO5.4.3 tracks all awakened components so no need to call this manually - if(comp != null && !ERXApplication.isWO54()) { - comp._sleepInContext(comp.context()); - } - return comp; + if (cid == null) return context().page(); + return session().restorePageForContextID(cid); } public String keyPathFromRequest() { diff --git a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java index 5e1f30c1c0f..0c137151a74 100644 --- a/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java +++ b/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WModel.java @@ -741,19 +741,6 @@ protected void uniqueQualifiers(NSArray rules) { } } - //AK: this is probably never called in WO > 5.2 - public Vector modelFilesInBundles () { - Vector modelFiles = super.modelFilesInBundles(); - if (!_hasAddedExtraModelFiles) { - NSArray additionalModelURLs = additionalModelURLs(); - for (URL url : additionalModelURLs) { - modelFiles.add(url.getFile()); - } - _hasAddedExtraModelFiles = true; - } - return modelFiles; - } - private boolean _hasAddedExtraModelFiles=false; /** diff --git a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java index caf5e06fc15..e0d5ab7a3fa 100644 --- a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java +++ b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXEntity.java @@ -80,7 +80,7 @@ public EOAttribute anyAttributeNamed(String name) { * @see com.webobjects.eoaccess.EOEntity#hasExternalName() * @since 5.4.1 */ - //@Override introduced with 5.4.1 + @Override public boolean hasExternalName() { // (ldeck) radar://6592526 fix for 5.4.3 regression which assumed that any parent entity that is abstract has no external name! return externalName() != null && externalName().trim().length() > 0; diff --git a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java index 84b7e0c0257..2b08f8cae4c 100644 --- a/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java +++ b/Frameworks/Core/ERExtensions/Sources/com/webobjects/eoaccess/ERXModel.java @@ -67,36 +67,11 @@ * @author ldeck */ public class ERXModel extends EOModel { - public static Object _ERXGlobalModelLock; + // Expose EOModel._EOGlobalModelLock so that ERXModelGroup can lock on it + public static Object _ERXGlobalModelLock = EOModel._EOGlobalModelLock; private static final Logger log = Logger.getLogger(ERXModel.class); - static { - // Expose EOModel._EOGlobalModelLock so that ERXModelGroup can lock on it - try { - _ERXGlobalModelLock = EOModel._EOGlobalModelLock; - } - catch (NoSuchFieldError e) { - // MS: It just so happens that this occurs really early on in the startup process, and this API changed in WO 5.3 vs WO 5.4. We catch this - // failure explicitly and give the user a slightly better error message. - try { - String eomodelLockClassName = EOModel.class.getDeclaredField("_EOGlobalModelLock").getType().getSimpleName(); - if ("ReentrantLock".equals(eomodelLockClassName)) { - throw new RuntimeException("You're using WebObjects 5.4 with the WebObjects 5.3 version of Project Wonder. You need to download the 5.4 version of Project Wonder for your application to work properly."); - } - else if ("NSRecursiveLock".equals(eomodelLockClassName)) { - throw new RuntimeException("You're using WebObjects 5.3 with the WebObjects 5.4 version of Project Wonder. You need to download the 5.3 version of Project Wonder for your application to work properly."); - } - else { - throw new RuntimeException("You have the wrong version of Project Wonder for the version of WebObjects that you're using. You need to download the appropriate version of Project Wonder for your application to work properly."); - } - } - catch (NoSuchFieldException e2) { - throw e; - } - } - - } /** * Utility to add attributes to the prototype cache. As the attributes are chosen by name, replace already * existing ones. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java index fdcfff418fa..74ca240718e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/ERXExtensions.java @@ -376,33 +376,6 @@ public void configureAdaptorContext(NSNotification n) { ERXExtensions.configureAdaptorContext(); } - /** - * This method is called every time a session times - * out. It allows us to release references to all the - * editing contexts that were created when that particular - * session was active. - * Not used in WO 5.2+ - * @param n notification that contains the session ID. - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public void sessionDidTimeOut(NSNotification n) { - String sessionID=(String)n.object(); - ERXExtensions.sessionDidTimeOut(sessionID); - } - - /** - * This is needed for WO pre-5.2 when ec's were not - * retained by their eos. Not called in 5.2+ systems. - * @param n notification posted when an ec is created - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public void editingContextDidCreate(NSNotification n) { - EOEditingContext ec = (EOEditingContext)n.object(); - ERXExtensions.retainEditingContextForCurrentSession(ec); - } - /** * This method is called for the following notification * {@link EOSharedEditingContext#DefaultSharedEditingContextWasInitializedNotification} @@ -517,73 +490,6 @@ public static void setAdaptorLogging(boolean onOff) { adaptorEnabled = targetState; } - /** - * Retaining the editing contexts explicitly until the session that was active - * when they were created goes away - * this hopefully will go some way towards avoiding the 'attempted to send' - * message to EO whose EditingContext is gone. Only used in pre-5.2 systems. - */ - @Deprecated - private static NSMutableDictionary _editingContextsPerSession; - - /** - * This method is called when a session times out. - * Calling this method will release references to - * all editing contexts that were created when this - * session was active. This method is only called in - * pre-WO 5.2 versions of WebObjects. - * @param sessionID of the session that timed out - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public static void sessionDidTimeOut(String sessionID) { - if (sessionID != null) { - if (_editingContextsPerSession != null) { - if (_log.isDebugEnabled()) { - NSArray a=(NSArray)_editingContextsPerSession.objectForKey(sessionID); - _log.debug("Session "+sessionID+" is timing out "); - _log.debug("Found "+ ((a == null) ? 0 : a.count()) + " editing context(s)"); - } - NSArray ecs = (NSArray)_editingContextsPerSession.removeObjectForKey(sessionID); - // Just helping things along. - if (ecs != null && ecs.count() > 0) { - for (Enumeration ecEnumerator = ecs.objectEnumerator(); ecEnumerator.hasMoreElements();) { - ((EOEditingContext)ecEnumerator.nextElement()).dispose(); - } - } - } - } - } - - /** - * Retains an editing context for the current session. This is only needed or - * used for versions of WO pre-5.2. If you use ERXEC to create your editing - * contexts then you never need to call this method yourself. - * @param ec to be retained. - * @deprecated not needed anymore in WO 5.4 - */ - @Deprecated - public static void retainEditingContextForCurrentSession(EOEditingContext ec) { - WOSession s= ERXSession.session(); - if (s != null) { - if (_editingContextsPerSession == null) { - _editingContextsPerSession = new NSMutableDictionary(); - } - NSMutableArray a = (NSMutableArray)_editingContextsPerSession.objectForKey(s.sessionID()); - if (a == null) { - a = new NSMutableArray(); - _editingContextsPerSession.setObjectForKey(a, s.sessionID()); - if (_log.isDebugEnabled()) - _log.debug("Creating array for "+s.sessionID()); - } - a.addObject(ec); - if (_log.isDebugEnabled()) - _log.debug("Added new ec to array for "+s.sessionID()); - } else if (_log.isDebugEnabled()) { - _log.debug("Editing Context created with null session."); - } - } - /** * Removes all of the HTML tags from a given string. * Note: this is a very simplistic implementation diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index 8fca86961b1..3753d394e81 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -160,9 +160,6 @@ * @property er.extensions.ERXApplication.allowMultipleDevInstances */ public abstract class ERXApplication extends ERXAjaxApplication implements ERXGracefulShutdown.GracefulApplication { - - private static Boolean isWO54 = null; - /** logging support */ public static final Logger log = Logger.getLogger(ERXApplication.class); @@ -490,10 +487,7 @@ else if (fixedJar.matches(projectPattern) || fixedJar.matches(".*?/erfoundation. jarLibs += jar + File.pathSeparator; } String bundle = jar.replaceAll(".*?[/\\\\](\\w+)\\.framework.*", "$1"); - String excludes = "(JavaVM)"; - if (isWO54()) { - excludes = "(JavaVM|JavaWebServicesSupport|JavaEODistribution|JavaWebServicesGeneration|JavaWebServicesClient)"; - } + String excludes = "(JavaVM|JavaWebServicesSupport|JavaEODistribution|JavaWebServicesGeneration|JavaWebServicesClient)"; if (bundle.matches("^\\w+$") && !bundle.matches(excludes)) { String info = jar.replaceAll("(.*?[/\\\\]\\w+\\.framework/Resources/).*", "$1Info.plist"); if (new File(info).exists()) { @@ -649,9 +643,6 @@ private NSBundle mainBundle() { * * @param n */ - - - public void bundleDidLoad(NSNotification n) { NSBundle bundle = (NSBundle) n.object(); if (allFrameworks.contains(bundle.name())) { @@ -1048,19 +1039,6 @@ public static void setup(String[] argv) { ClassLoader loader = AppClassLoader.getAppClassLoader(); Thread.currentThread().setContextClassLoader(loader); } - if (!ERXApplication.isWO54()) { - Class arrayClass = NSMutableArray.class; - try { - Field f = arrayClass.getField("ERX_MARKER"); - } - catch (NoSuchFieldException e) { - System.err.println("No ERX_MARKER field in NSMutableArray found. \nThis means your class path is incorrect. Adjust it so that ERExtensions come before JavaFoundation."); - System.exit(1); - } - catch (Exception e) { - e.printStackTrace(); - } - } ERXConfigurationManager.defaultManager().setCommandLineArguments(argv); ERXFrameworkPrincipal.setUpFrameworkPrincipalClass(ERXExtensions.class); // NSPropertiesCoordinator.loadProperties(); @@ -1076,19 +1054,10 @@ public static void setup(String[] argv) { public void installPatches() { ERXPatcher.installPatches(); if (contextClassName().equals("WOContext")) { - if (ERXApplication.isWO54()) { - setContextClassName("ERXWOContext54"); - } - else { - setContextClassName(ERXWOContext.class.getName()); - } + setContextClassName(ERXWOContext.class.getName()); } if (contextClassName().equals("WOServletContext") || contextClassName().equals("com.webobjects.jspservlet.WOServletContext")) { - if (ERXApplication.isWO54()) { - setContextClassName("ERXWOServletContext54"); - } else { - setContextClassName(ERXWOServletContext.class.getName()); - } + setContextClassName(ERXWOServletContext.class.getName()); } ERXPatcher.setClassForName(ERXWOForm.class, "WOForm"); @@ -1109,23 +1078,6 @@ public void installPatches() { } // ERXPatcher.setClassForName(ERXSubmitButton.class, "WOSubmitButton"); - - // Fix for 3190479 URI encoding should always be UTF8 - // See http://www.w3.org/International/O-URL-code.html - // For WO 5.1.x users, please comment this statement to compile. - com.webobjects.appserver._private.WOURLEncoder.WO_URL_ENCODING = CharEncoding.UTF_8; - - // WO 5.1 specific patches - if (ERXProperties.webObjectsVersionAsDouble() < 5.2d) { - // ERXWOText contains a patch for WOText to not include the value - // attribute (#2948062). Fixed in WO 5.2 - ERXPatcher.setClassForName(ERXWOText.class, "WOText"); - - } - // ERXWOFileUpload returns a better warning than throwing a - // ClassCastException. - // Fixed in WO 5.2 - // ERXPatcher.setClassForName(ERXWOFileUpload.class, "WOFileUpload"); } @Override @@ -1474,7 +1426,7 @@ public void run() { * Creates the request object for this loop. Calls _createRequest(). For WO * 5.3. */ - @SuppressWarnings("all") // Suppress @Override warning for 5.4 + @Deprecated public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo) { return _createRequest(aMethod, aURL, anHTTPVersion, someHeaders, aContent, someInfo); } @@ -1483,8 +1435,7 @@ public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion * Creates the request object for this loop. Calls _createRequest(). For WO * 5.4. */ - @SuppressWarnings("all") - // Suppress @Override warning for 5.3 + @Override public WORequest createRequest(String method, String aurl, String anHTTPVersion, Map> someHeaders, NSData content, Map someInfo) { return _createRequest(method, aurl, anHTTPVersion, (someHeaders != null ? new NSDictionary(someHeaders, true) : null), content, (someInfo != null ? new NSDictionary(someInfo, true) : null)); } @@ -1850,6 +1801,7 @@ public WOResponse reportException(Throwable exception, WOContext context, NSDict */ // NOTE: if you use WO 5.1, comment out this method, otherwise it won't // compile. + // CHECKME this was created for WO 5.2, do we still need this for 5.4.3? @Override public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance) { WOContext context = actionInstance != null ? actionInstance.context() : null; @@ -2286,18 +2238,11 @@ public boolean useSessionStoreDeadlockDetection() { * Returns true if this app is running in WO 5.4. * * @return true if this app is running in WO 5.4 + * @deprecated Wonder is used with WO 5.4 only */ + @Deprecated public static boolean isWO54() { - if (ERXApplication.isWO54 == null) { - try { - Method getWebObjectsVersionMethod = WOApplication.class.getMethod("getWebObjectsVersion", new Class[0]); - ERXApplication.isWO54 = Boolean.TRUE; - } - catch (Exception e) { - ERXApplication.isWO54 = Boolean.FALSE; - } - } - return ERXApplication.isWO54.booleanValue(); + return true; } /** @@ -2863,7 +2808,7 @@ public void setDebugEnabledForComponent(boolean debugEnabled, String componentNa * Returns whether or not binding debugging is enabled for the given component * * @param componentName the component name - * @return whether or not binding debugging is enabled for the given componen + * @return whether or not binding debugging is enabled for the given component */ public boolean debugEnabledForComponent(String componentName) { return _debugComponents.containsObject(componentName); @@ -2881,7 +2826,7 @@ public void clearDebugEnabledForAllComponents() { * @return the request handler key for ajax. */ public static String erAjaxRequestHandlerKey() { - return ERXApplication.isWO54() ? "ja": "ajax"; + return "ja"; } /** diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java index 65d4acc707b..d4d527797d1 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXDirectActionRequestHandler.java @@ -76,6 +76,7 @@ public WOResponse handleRequest(WORequest request) { if (ERXWOResponseCache.sharedInstance().isEnabled()) { try { // Caching scheme for 5.2 applications. Will uncomment once we are building 5.2 only ERExtensions + // CHECKME Object[] actionClassAndName = getRequestActionClassAndNameForPath(getRequestHandlerPathForRequest(request)); //Object[] actionClassAndName = null; if (actionClassAndName != null && actionClassAndName.length == 3) { @@ -110,7 +111,7 @@ public WOResponse handleRequest(WORequest request) { if (app.sessionStore().restoreSessionWithID(request.sessionID(), request) == null) { response = generateRequestRefusal(request); // AK: should be a permanent redirect, as the session is gone for good. - // However, the adaptor checks explictely on 302 so we return that... + // However, the adaptor checks explicitly on 302 so we return that... // It shouldn't matter which instance we go to now. response.setStatus(302); } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java index 7b159f0c99a..5e353939ec1 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXResourceManager.java @@ -172,8 +172,7 @@ public String urlForResourceNamed(String name, String bundleName, NSArraytrue if value should be escaped - */ - // REMOVEME as of WO5.4.3 this seems not necessary anymore - @Override - public void _appendTagAttributeAndValue(String name, String value, boolean escape) { - if (value != null) { - super._appendTagAttributeAndValue(name, value, escape); - } - } - /** * Overridden to not call super if trying to download an attachment * to IE. diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSecureDefaultAdaptor.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSecureDefaultAdaptor.java index ae241a8cf93..04ce9db033c 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSecureDefaultAdaptor.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSecureDefaultAdaptor.java @@ -5,7 +5,6 @@ import java.net.URL; import com.webobjects.appserver.WOApplication; -import com.webobjects.appserver._private.WODefaultAdaptor; import com.webobjects.appserver._private.WOProperties; import com.webobjects.foundation.NSBundle; import com.webobjects.foundation.NSDictionary; @@ -32,12 +31,7 @@ public ERXSecureDefaultAdaptor(String name, NSDictionary parameters) { // port number was selected! if (parameters != null && Integer.valueOf(0).equals(parameters.objectForKey(WOProperties._PortKey))) { try { - Field listenSocketField; - if (ERXApplication.isWO54()) { - listenSocketField = Class.forName("com.webobjects.appserver._private.WOClassicAdaptor").getDeclaredField("_listenSocket"); - } else { - listenSocketField = WODefaultAdaptor.class.getDeclaredField("_listenSocket"); - } + Field listenSocketField = Class.forName("com.webobjects.appserver._private.WOClassicAdaptor").getDeclaredField("_listenSocket"); listenSocketField.setAccessible(true); ServerSocket socket = (ServerSocket) listenSocketField.get(this); int localPort = socket.getLocalPort(); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSession.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSession.java index 75f93d14de9..fa5863f6fc0 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSession.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXSession.java @@ -747,23 +747,10 @@ public static boolean useHttpOnlySessionCookies() { } protected void _convertSessionCookiesToSecure(WOResponse response) { - if(storesIDsInCookies() && !ERXRequest._isSecureDisabled()) { + if (storesIDsInCookies() && !ERXRequest._isSecureDisabled()) { for (WOCookie cookie : response.cookies()) { - String sessionIdKey; - String instanceIdKey; - if (ERXApplication.isWO54()) { - try { - sessionIdKey = (String)WOApplication.class.getMethod("sessionIdKey").invoke(WOApplication.application()); - instanceIdKey = (String)WOApplication.class.getMethod("instanceIdKey").invoke(WOApplication.application()); - } - catch (Throwable e) { - throw new NSForwardException(e); - } - } - else { - sessionIdKey = WORequest.SessionIDKey; - instanceIdKey = WORequest.InstanceKey; - } + String sessionIdKey = application().sessionIdKey(); + String instanceIdKey = application().instanceIdKey(); String cookieName = cookie.name(); if (sessionIdKey.equals(cookieName) || instanceIdKey.equals(cookieName)) { cookie.setIsSecure(true); @@ -775,21 +762,8 @@ protected void _convertSessionCookiesToSecure(WOResponse response) { protected void _convertSessionCookiesToHttpOnly(final WOResponse response) { if (storesIDsInCookies()) { for (WOCookie cookie : response.cookies()) { - String sessionIdKey; - String instanceIdKey; - if (ERXApplication.isWO54()) { - try { - sessionIdKey = (String) WOApplication.class.getMethod("sessionIdKey").invoke( - WOApplication.application()); - instanceIdKey = (String) WOApplication.class.getMethod("instanceIdKey").invoke( - WOApplication.application()); - } catch (Throwable e) { - throw new NSForwardException(e); - } - } else { - sessionIdKey = WORequest.SessionIDKey; - instanceIdKey = WORequest.InstanceKey; - } + String sessionIdKey = application().sessionIdKey(); + String instanceIdKey = application().instanceIdKey(); String cookieName = cookie.name(); if (sessionIdKey.equals(cookieName) || instanceIdKey.equals(cookieName)) { cookie.setIsHttpOnly(true); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext.java index 7b4cd22f9ef..808c251951e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext.java @@ -245,10 +245,14 @@ protected String _postprocessURL(String url) { @Override public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean secure) { _preprocessURL(); - String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, secure); - if (!ERXApplication.isWO54()) { - url = _postprocessURL(url); - } + return super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, secure); + } + + @Override + public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean isSecure, int somePort) { + _preprocessURL(); + String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, isSecure, somePort); + url = _postprocessURL(url); return url; } @@ -486,23 +490,11 @@ public static String toSafeElementID(String elementID) { * @param secure * whether or not the URL should be HTTPS * @return the URL to the given direct action + * @deprecated use non-static {@link #_directActionURL(String, NSDictionary, boolean, int, boolean)} instead */ + @Deprecated public static String _directActionURL(WOContext context, String actionName, NSDictionary queryParams, boolean secure) { - try { - String directActionURL; - if (ERXApplication.isWO54()) { - Method _directActionURLMethod = context.getClass().getMethod("_directActionURL", new Class[] { String.class, NSDictionary.class, boolean.class, int.class, boolean.class }); - directActionURL = (String) _directActionURLMethod.invoke(context, new Object[] { actionName, queryParams, Boolean.valueOf(secure), Integer.valueOf(0), Boolean.FALSE }); - } - else { - Method _directActionURLMethod = context.getClass().getMethod("_directActionURL", new Class[] { String.class, NSDictionary.class, boolean.class }); - directActionURL = (String) _directActionURLMethod.invoke(context, new Object[] { actionName, queryParams, Boolean.valueOf(secure) }); - } - return directActionURL; - } - catch (Exception e) { - throw new NSForwardException(e); - } + return context._directActionURL(actionName, queryParams, secure, 0, false); } /** diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext54.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext54.java index fd07dd06406..a396639bb72 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext54.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOContext54.java @@ -2,16 +2,12 @@ import com.webobjects.appserver.WORequest; +/** + * @deprecated use {@link ERXWOContext} instead + */ +@Deprecated public class ERXWOContext54 extends ERXWOContext { public ERXWOContext54(WORequest worequest) { super(worequest); } - - @Override - public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean isSecure, int somePort) { - _preprocessURL(); - String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, isSecure, somePort); - url = _postprocessURL(url); - return url; - } } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext.java index 892caae94de..a85240d5523 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext.java @@ -6,8 +6,9 @@ import er.extensions.foundation.ERXMutableUserInfoHolderInterface; -/** Replacement of WOServletContext. - * This subclass is installed when the frameworks loads. +/** + * Replacement of WOServletContext. + * This subclass is installed when the frameworks loads. */ public class ERXWOServletContext extends WOServletContext implements ERXMutableUserInfoHolderInterface { public ERXWOServletContext(WORequest worequest) { @@ -15,24 +16,24 @@ public ERXWOServletContext(WORequest worequest) { } /** - * Overridden to support rewritten urls via {@link ERXApplication#_rewriteURL(String)}. - * @return the (optionally) rewritten url - */ - public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean secure) { - String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, secure); - if (!ERXApplication.isWO54()) { - url = ERXApplication.erxApplication()._rewriteURL(url); - } - return url; - } + * @return the (optionally) rewritten url. + */ + @Override + public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean isSecure, int somePort) { + String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, isSecure, somePort); + url = ERXApplication.erxApplication()._rewriteURL(url); + return url; + } protected NSMutableDictionary mutableUserInfo; + public NSMutableDictionary mutableUserInfo() { if(mutableUserInfo == null) { mutableUserInfo = new NSMutableDictionary(); } return mutableUserInfo; } + public void setMutableUserInfo(NSMutableDictionary userInfo) { mutableUserInfo = userInfo; } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext54.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext54.java index f1ac708585d..2f7bca23ff2 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext54.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXWOServletContext54.java @@ -1,6 +1,3 @@ -/** - * - */ package er.extensions.appserver; import com.webobjects.appserver.WORequest; @@ -9,20 +6,11 @@ * Overridden to allow WO54 servlet deployments to utilise {@link ERXApplication#_rewriteURL(String)}. * * @author ldeck + * @deprecated use {@link ERXWOServletContext} instead */ +@Deprecated public class ERXWOServletContext54 extends ERXWOServletContext { - public ERXWOServletContext54(WORequest request) { super(request); } - - /** - * @return the (optionally) rewritten url. - */ - public String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean isSecure, int somePort) { - String url = super._urlWithRequestHandlerKey(requestHandlerKey, requestHandlerPath, queryString, isSecure, somePort); - url = ERXApplication.erxApplication()._rewriteURL(url); - return url; - } - } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java index 01c4ae5603d..b372877ddad 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ajax/ERXAjaxContext.java @@ -29,7 +29,7 @@ public ERXAjaxContext(WORequest request) { super(request); } - // @Override no override for 5.4/5.3 compatibility + @Override public boolean wasFormSubmitted() { return _wasFormSubmitted(); } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXDynamicURL.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXDynamicURL.java index 2637e78a864..5db59ad6139 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXDynamicURL.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/ERXDynamicURL.java @@ -1,17 +1,17 @@ package er.extensions.components; +import com.webobjects.appserver.WODynamicURL; import com.webobjects.foundation._NSDelegate; -import er.extensions.appserver.ERXApplication; - /** * 5.3/5.4-safe wrapper around a WODynamicURL (which changed classes). * * @author mschrag + * @deprecated use {@link WODynamicURL} instead */ +@Deprecated public class ERXDynamicURL { private _NSDelegate _delegate; - private Object _dynamicUrl; /** * Construct an ERXDynamicURL. @@ -19,19 +19,7 @@ public class ERXDynamicURL { * @param dynamicUrl a WODynamicURL (either from the 5.3 or the 5.4 package) */ public ERXDynamicURL(Object dynamicUrl) { - try { - if (ERXApplication.isWO54()) { - _delegate = new _NSDelegate(Class.forName("com.webobjects.appserver.WODynamicURL")); - } - else { - _delegate = new _NSDelegate(Class.forName("com.webobjects.appserver._private.WODynamicURL")); - } - _dynamicUrl = dynamicUrl; - _delegate.setDelegate(_dynamicUrl); - } - catch (Throwable t) { - throw new RuntimeException("Failed to create ERXDynamicURL.", t); - } + _delegate = new _NSDelegate(WODynamicURL.class, dynamicUrl); } /** diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXHyperlink.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXHyperlink.java index 4dbdab53ffb..604d9fd9a82 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXHyperlink.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXHyperlink.java @@ -59,7 +59,7 @@ public ERXHyperlink(String arg0, NSDictionary arg1, WOElement arg2) { } /** - * Overriden to perform the logging, propagating the action to subelements and returning the + * Overridden to perform the logging, propagating the action to subelements and returning the * current page if an empty page is returned from super. */ public WOActionResults invokeAction(WORequest request, WOContext context) { @@ -81,24 +81,10 @@ public WOActionResults invokeAction(WORequest request, WOContext context) { } @Override - public void appendAttributesToResponse(final WOResponse woresponse, WOContext wocontext) { - if(!ERXApplication.isWO54() && _href != null && _href.valueInComponent(wocontext.component()) != null) { - // AK: for whatever reason, WO double-quotes the '&' when you use the HREF binding, - // so you end up with x=1&amp;y=2 instead of x=1&y=2 - // setting escape to false fixes this (one could argue the escape is needed in the first place) - // This is a pretty inefficient method, but at least it's correct - WOResponse response = new WOResponse() { - public void appendContentHTMLAttributeValue(String s) { - super.appendContentString(s); - } - }; - super.appendAttributesToResponse(response, wocontext); - woresponse.appendContentString(response.contentString()); - } else { - super.appendAttributesToResponse(woresponse, wocontext); - } - if(defaultNoFollow && _action != null) { - woresponse.appendContentString(" rel=\"nofollow\""); + public void appendAttributesToResponse(final WOResponse response, WOContext context) { + super.appendAttributesToResponse(response, context); + if (defaultNoFollow && _action != null) { + response.appendContentString(" rel=\"nofollow\""); } } } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXSubmitButton.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXSubmitButton.java index 9933edfd94b..c596ac6342f 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXSubmitButton.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXSubmitButton.java @@ -99,22 +99,8 @@ public ERXSubmitButton(String arg0, NSDictionary nsdictio _action = _associations.removeObjectForKey("action"); _actionClass = _associations.removeObjectForKey("actionClass"); _directActionName = _associations.removeObjectForKey("directActionName"); - - // hack for 5.4 - if (ERXApplication.isWO54()) { - _class = (WOAssociation) nsdictionary.valueForKey("class"); - } - else { - _class = _associations.removeObjectForKey("class"); - } - - // hack for 5.4 - if (ERXApplication.isWO54()) { - _id = (WOAssociation) nsdictionary.valueForKey("id"); - } - else { - _id = _associations.removeObjectForKey("id"); - } + _class = (WOAssociation) nsdictionary.valueForKey("class"); + _id = (WOAssociation) nsdictionary.valueForKey("id"); if(_action != null && _action.isValueConstant()) throw new WODynamicElementCreationException("<" + getClass().getName() + ">'action' is a constant."); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java index 8e4b17628d8..f71c7c4290d 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOFileUpload.java @@ -7,6 +7,7 @@ import com.webobjects.appserver.WORequest; import com.webobjects.appserver.WOResponse; import com.webobjects.appserver._private.WODynamicElementCreationException; +import com.webobjects.appserver._private.WOFileUpload; import com.webobjects.foundation.NSDictionary; import er.extensions.appserver.ERXBrowserFactory; @@ -21,7 +22,11 @@ * * * @author ak on Wed Oct 09 2002 + * @project ERExtensions + * @deprecated use {@link WOFileUpload} as parent class */ +// CHECKME is that class obsolete as the cause of its presence was a bug fixed in WO 5.2 or should some logic be maintained? +@Deprecated public class ERXWOFileUpload extends com.webobjects.appserver._private.WOFileUpload { /** logging support */ diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java index e30d1c587fd..87952183734 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/_private/ERXWOText.java @@ -13,7 +13,10 @@ * But use WOText instead. * * @author ak on Tue Oct 15 2002 + * @project ERExtensions + * @deprecated use {@link ERXPatcher.DynamicElementsPatches.Text} as parent class instead */ +@Deprecated public class ERXWOText extends ERXPatcher.DynamicElementsPatches.Text { /** * Public constructor diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java index 18e9692e80a..a668ac27be6 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSValidationErrors.java @@ -98,14 +98,8 @@ public void awake() { } catch (NSValidation.ValidationException ex1) { _errors = ex1.getMessage(); } finally { - if(eo != null && eo.editingContext() != null) + if (eo != null && eo.editingContext() != null) { eo.editingContext().unlock(); - if(page != null) { - // we cheat here because calling sleep() is not enough... - // Michael Bushkov: WO5.4.3 tracks all awakened components so no need to call this manually - if (!ERXApplication.isWO54()) { - page._sleepInContext(page.context()); - } } } } diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java index 5e3525fa2d0..c83e460b707 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXEOControlUtilities.java @@ -196,12 +196,6 @@ public static T editableInstanceOfObject(T eo, if(ec == null) throw new IllegalArgumentException("EO must live in an EC"); boolean isNewObject = ERXEOControlUtilities.isNewObject(eo); - - // Check for old EOF bug and do nothing as we can't localInstance - // anything here - if (ERXProperties.webObjectsVersionAsDouble() < 5.21d && isNewObject) { - return eo; - } T localObject = eo; diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java index c3d51bb6f00..dea82fd02df 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXModelGroup.java @@ -1244,7 +1244,7 @@ else if (attribute.prototype().entity() == prototypeEntity) { } } - private static final NSArray _prototypeKeys = new NSArray(new Object[] { "externalType", "columnName", "readOnly", ERXApplication.isWO54()?"className":"valueClassName", "valueType", "width", "precision", "scale", "writeFormat", "readFormat", "userInfo", "serverTimeZone", "valueFactoryMethodName", "adaptorValueConversionMethodName", "factoryMethodArgumentType", "allowsNull", "parameterDirection", "_internalInfo" }); + private static final NSArray _prototypeKeys = new NSArray(new Object[] { "externalType", "columnName", "readOnly", "className", "valueType", "width", "precision", "scale", "writeFormat", "readFormat", "userInfo", "serverTimeZone", "valueFactoryMethodName", "adaptorValueConversionMethodName", "factoryMethodArgumentType", "allowsNull", "parameterDirection", "_internalInfo" }); public static NSArray _prototypeKeys() { return _prototypeKeys; @@ -1259,18 +1259,6 @@ public static int _enumForKey(String key) { } public static boolean _isKeyEnumOverriden(EOAttribute att, int key) { - if (!ERXApplication.isWO54()) { - // 5.4 - API changed - try { - Method isKeyEnumOverriddenMethod = att.getClass().getMethod("_isKeyEnumOverriden", new Class[] { int.class }); - Boolean isKeyEnumOverridden = (Boolean)isKeyEnumOverriddenMethod.invoke(att, new Object[] { Integer.valueOf(key) }); - return isKeyEnumOverridden.booleanValue(); - } - catch (Exception e) { - throw new RuntimeException("_isKeyEnumOverridden failed.", e); - } - } - boolean result = false; if(att.prototype() != null) { Map characteristics = (Map) NSKeyValueCoding.Utility.valueForKey(att, "overwrittenCharacteristics"); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java index 6c315b72fc3..536c3a2832e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXPatcher.java @@ -128,9 +128,6 @@ public static synchronized void installPatches() { if (ERXProperties.booleanForKeyWithDefault("er.extensions.WOSwitchComponent.patch", true)) { ERXPatcher.setClassForName(ERXSwitchComponent.class, "WOSwitchComponent"); } - if (!ERXApplication.isWO54() || ERXProperties.booleanForKey("er.extensions.WOConditional.patch")) { - ERXPatcher.setClassForName(ERXWOConditional.class, "WOConditional"); - } // RM XHTML strict compliance ERXPatcher.setClassForName(DynamicElementsPatches.JavaScript.class, "WOJavaScript"); @@ -310,23 +307,6 @@ public void appendToResponse(WOResponse woresponse, WOContext wocontext) { woresponse.appendContentString(newResponse.contentString()); } } - - // WO 5.4: 5.4 returns false for this - protected boolean hasContent() { - return !ERXApplication.isWO54(); - } - - // WO 5.4: 5.4 already does this, but for 5.3, if you want to use WOImage's with - // PDF generation, you need XHTML output - protected void _appendOpenTagToResponse(WOResponse response, WOContext context) { - response.appendContentCharacter('<'); - response.appendContentString(elementName()); - appendAttributesToResponse(response, context); - if(!hasContent() || ERXResponse.isXHTML(response)) { - response.appendContentString(" /"); - } - response.appendContentCharacter('>'); - } } public static class ActiveImage extends WOActiveImage { diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java index 52eb0eebe1c..dc1c3990a08 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/foundation/ERXProperties.java @@ -347,8 +347,10 @@ public static String valueFromPlistBundleWithKey(NSBundle bundle, String plist, * @see #webObjectsVersionAsDouble * @see ERXStringUtilities#removeExtraDotsFromVersionString * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static String webObjectsVersion() { if (_webObjectsVersion == null) { _webObjectsVersion = versionStringForFrameworkNamed("JavaWebObjects"); @@ -383,8 +385,10 @@ public static String webObjectsVersion() { * * @see #webObjectsVersion * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static double webObjectsVersionAsDouble() { if (_webObjectsVersionDouble == 0.0d) { String woVersionString = ERXStringUtilities.removeExtraDotsFromVersionString(webObjectsVersion()); @@ -417,8 +421,10 @@ public static double webObjectsVersionAsDouble() { * * @return true もし、バージョン番号が5.2以上であれば * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static boolean webObjectsVersionIs52OrHigher() { if(ERXProperties.booleanForKey("er.extensions.ERXProperties.checkOldVersions")) { return webObjectsVersionAsDouble() >= 5.2d; @@ -439,8 +445,10 @@ public static boolean webObjectsVersionIs52OrHigher() { * * @return true もし、バージョン番号が5.22以上であれば * + * @deprecated Wonder is used with WO 5.4 only */ @SuppressWarnings("javadoc") + @Deprecated public static boolean webObjectsVersionIs522OrHigher() { if(ERXProperties.booleanForKey("er.extensions.ERXProperties.checkOldVersions")) { String webObjectsVersion = webObjectsVersion(); diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java index de28f0be5ce..67ce565897b 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java @@ -327,15 +327,13 @@ private Map getCurrentThreadNames(Set keySet) { public NSDictionary statistics() { NSDictionary stats = super.statistics(); - if (ERXApplication.isWO54()) { - NSMutableDictionary fixed = stats.mutableClone(); - for (Enumeration enumerator = stats.keyEnumerator(); enumerator.hasMoreElements();) { - Object key = enumerator.nextElement(); - Object value = stats.objectForKey(key); - fixed.setObjectForKey(fix(value), key); - } - stats = fixed; + NSMutableDictionary fixed = stats.mutableClone(); + for (Enumeration enumerator = stats.keyEnumerator(); enumerator.hasMoreElements();) { + Object key = enumerator.nextElement(); + Object value = stats.objectForKey(key); + fixed.setObjectForKey(fix(value), key); } + stats = fixed; return stats; } diff --git a/Frameworks/Core/WOOgnl/.classpath b/Frameworks/Core/WOOgnl/.classpath index 276980adc8d..2518444e737 100755 --- a/Frameworks/Core/WOOgnl/.classpath +++ b/Frameworks/Core/WOOgnl/.classpath @@ -1,8 +1,6 @@ - - diff --git a/Frameworks/Core/WOOgnl/Documentation/Properties.sample b/Frameworks/Core/WOOgnl/Documentation/Properties.sample deleted file mode 100644 index 740372bfb12..00000000000 --- a/Frameworks/Core/WOOgnl/Documentation/Properties.sample +++ /dev/null @@ -1,21 +0,0 @@ -## If you want to use OGNL but not enable it automatically in your bindings, you can set this to -## false. Default is true. -ognl.active=true - -## If you want to enable the helper function parser (which now is misnamed and does a bunch of other things), -## you can set this to true. Default is false. See README-HelperFunctions.txt for more information about -## helper functions. -ognl.helperFunctions=false - -## If you want to enable inline binding syntax (i.e. .. ), then set -## this to true. This requires ognl.helperFunctions=true. Default is false. -ognl.inlineBindings=false - -## If you want to enable inline bindings on non-WO tags (like
..
), you can enable this and -## the parser will automatically turn these tags into WOGenericContainers. This requires that ognl.helperFunctions=true -## and ognl.inlineBindings=true. The default is false. -ognl.parseStandardTags=false - -## If you want OGNL exceptions to actually throw exceptions on failures (rather than just warn), set -## this to true. Default is false. -ognl.webobjects.WOAssociation.shouldThrowExceptions=false \ No newline at end of file diff --git a/Frameworks/Core/WOOgnl/Libraries/.gitignore b/Frameworks/Core/WOOgnl/Libraries/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar b/Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar deleted file mode 100644 index 009a246203b..00000000000 Binary files a/Frameworks/Core/WOOgnl/Libraries/WOOgnl53.jar and /dev/null differ diff --git a/Frameworks/Core/WOOgnl/Libraries/WOOgnl54.jar b/Frameworks/Core/WOOgnl/Libraries/WOOgnl54.jar deleted file mode 100644 index c1f3678529b..00000000000 Binary files a/Frameworks/Core/WOOgnl/Libraries/WOOgnl54.jar and /dev/null differ diff --git a/Frameworks/Core/WOOgnl/Sources_WO54/ognl/helperfunction/WOHelperFunctionParser54.java b/Frameworks/Core/WOOgnl/Sources/ognl/helperfunction/WOHelperFunctionParser54.java similarity index 100% rename from Frameworks/Core/WOOgnl/Sources_WO54/ognl/helperfunction/WOHelperFunctionParser54.java rename to Frameworks/Core/WOOgnl/Sources/ognl/helperfunction/WOHelperFunctionParser54.java diff --git a/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java b/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java index 22edde60a1e..1d048631c37 100644 --- a/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java +++ b/Frameworks/Core/WOOgnl/Sources/ognl/webobjects/WOOgnl.java @@ -26,6 +26,7 @@ import com.webobjects.appserver._private.WOBindingNameAssociation; import com.webobjects.appserver._private.WOConstantValueAssociation; import com.webobjects.appserver._private.WOKeyValueAssociation; +import com.webobjects.appserver.parser.WOComponentTemplateParser; import com.webobjects.foundation.NSArray; import com.webobjects.foundation.NSDictionary; import com.webobjects.foundation.NSMutableArray; @@ -126,19 +127,6 @@ public Hashtable newDefaultContext() { return h; } - // Borrowed from ERXApplication, but we can't depend on ERX - private boolean isWO54() { - boolean isWO54; - try { - WOApplication.class.getMethod("getWebObjectsVersion", new Class[0]); - isWO54 = true; - } - catch (Exception e) { - isWO54 = false; - } - return isWO54; - } - public void configureWOForOgnl() { // Configure runtime. // Configure foundation classes. @@ -152,25 +140,8 @@ public void configureWOForOgnl() { OgnlRuntime.setElementsAccessor(NSSet.class, e); // Register template parser if (hasProperty("ognl.active", "true")) { - String parserClassName; - if (isWO54()) { - parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser54"); - try { - Class.forName("com.webobjects.appserver.parser.WOComponentTemplateParser").getMethod("setWOHTMLTemplateParserClassName", String.class).invoke(null, parserClassName); - } - catch (Exception e1) { - throw new RuntimeException("Failed to set the template parser to WOHelperFunctionParser54.", e1); - } - } - else { - parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser53"); - try { - Class.forName("com.webobjects.appserver._private.WOParser").getMethod("setWOHTMLTemplateParserClassName", String.class).invoke(null, parserClassName); - } - catch (Exception e1) { - throw new RuntimeException("Failed to set the template parser to WOHelperFunctionParser53.", e1); - } - } + String parserClassName = System.getProperty("ognl.parserClassName", "ognl.helperfunction.WOHelperFunctionParser54"); + WOComponentTemplateParser.setWOHTMLTemplateParserClassName(parserClassName); if (hasProperty("ognl.inlineBindings", "false")) { WOHelperFunctionTagRegistry.setAllowInlineBindings(true); } diff --git a/Frameworks/Core/WOOgnl/Sources_WO53/ognl/helperfunction/WOHelperFunctionParser53.java b/Frameworks/Core/WOOgnl/Sources_WO53/ognl/helperfunction/WOHelperFunctionParser53.java deleted file mode 100755 index 32e4053706e..00000000000 --- a/Frameworks/Core/WOOgnl/Sources_WO53/ognl/helperfunction/WOHelperFunctionParser53.java +++ /dev/null @@ -1,34 +0,0 @@ -package ognl.helperfunction; - -import org.apache.log4j.Logger; - -import com.webobjects.appserver.WOElement; -import com.webobjects.appserver._private.WODeclarationFormatException; -import com.webobjects.appserver._private.WOHTMLFormatException; -import com.webobjects.appserver._private.WOParser; -import com.webobjects.foundation.NSArray; - -public class WOHelperFunctionParser53 extends WOParser { - public static Logger log = Logger.getLogger(WOHelperFunctionParser53.class); - - private WOHelperFunctionParser _delegate; - - public WOHelperFunctionParser53(String htmlString, String declarationString, NSArray languages) { - super(htmlString, declarationString, languages); - _delegate = new WOHelperFunctionParser(htmlString, declarationString, languages); - } - - public WOElement parse() throws WODeclarationFormatException, WOHTMLFormatException, ClassNotFoundException { - try { - return _delegate.parse(); - } - catch (WOHelperFunctionDeclarationFormatException e) { - // LAME - throw new WODeclarationFormatException(e.getMessage()); - } - catch (WOHelperFunctionHTMLFormatException e) { - // LAME - throw new WOHTMLFormatException(e.getMessage()); - } - } -} diff --git a/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java b/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java index f51b9800488..39ade054264 100644 --- a/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java +++ b/Frameworks/Misc/EROpenID/Sources/er/openid/EROpenIDManager.java @@ -147,37 +147,10 @@ public void responseReceived(VerificationResult verification, EROResponse eroRes public String returnToUrl(WORequest request, WOContext context) { String returnToUrl; boolean requireSecureReturnURL = ERXProperties.booleanForKeyWithDefault("er.openid.requireSecureReturnURL", true); - if (ERXApplication.isWO54()) { - try { - if (requireSecureReturnURL) { - Method directActionURLForActionNamedMethod = context.getClass().getMethod("directActionURLForActionNamed", new Class[] { String.class, NSDictionary.class, boolean.class, boolean.class }); - returnToUrl = (String) directActionURLForActionNamedMethod.invoke(context, new Object[] { "ERODirectAction/openIDResponse", null, Boolean.TRUE, Boolean.TRUE }); - } - else { - returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", new NSDictionary()); - } - } - catch (Exception e) { - throw new RuntimeException("directActionURLForActionNamed failed.", e); - } - } - else { - context.generateCompleteURLs(); - try { - if (requireSecureReturnURL) { - Method _directActionURLMethod = context.getClass().getMethod("_directActionURL", new Class[] { String.class, NSDictionary.class, boolean.class }); - returnToUrl = (String) _directActionURLMethod.invoke(context, new Object[] { "ERODirectAction/openIDResponse", null, Boolean.TRUE }); - } - else { - returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", new NSDictionary()); - } - } - catch (Exception e) { - throw new RuntimeException("_directActionURL failed.", e); - } - finally { - context.generateRelativeURLs(); - } + if (requireSecureReturnURL) { + returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", null, true, true); + } else { + returnToUrl = context.directActionURLForActionNamed("ERODirectAction/openIDResponse", NSDictionary.EmptyDictionary); } EROpenIDManager.log.debug("Return to URL: " + returnToUrl); return returnToUrl;