Convert CRLF (dos) to LF (unix)
Prior to this change, roughly 5% (~300 out of 6000+) of files under the source tree had CRLF line endings as opposed to the majority which have LF endings. This change normalizes these files to LF for consistency going forward. Command used: $ git ls-files | xargs file | grep CRLF | cut -d":" -f1 | xargs dos2unix Issue: SPR-5608
This commit is contained in:
@@ -1,53 +1,53 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet;
|
||||
|
||||
import javax.portlet.PortletException;
|
||||
import javax.portlet.PortletRequest;
|
||||
|
||||
import org.springframework.core.style.StylerUtils;
|
||||
|
||||
/**
|
||||
* Exception to be thrown if DispatcherPortlet is unable to determine
|
||||
* a corresponding handler for an incoming portlet request.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0.5
|
||||
*/
|
||||
public class NoHandlerFoundException extends PortletException {
|
||||
|
||||
/**
|
||||
* Constructor for NoHandlerFoundException.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
public NoHandlerFoundException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for NoHandlerFoundException.
|
||||
* @param msg the detail message
|
||||
* @param request the current portlet request,
|
||||
* for further context to be included in the exception message
|
||||
*/
|
||||
public NoHandlerFoundException(String msg, PortletRequest request) {
|
||||
super(msg + ": mode '" + request.getPortletMode() +
|
||||
"', phase '" + request.getAttribute(PortletRequest.LIFECYCLE_PHASE) +
|
||||
"', parameters " + StylerUtils.style(request.getParameterMap()));
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet;
|
||||
|
||||
import javax.portlet.PortletException;
|
||||
import javax.portlet.PortletRequest;
|
||||
|
||||
import org.springframework.core.style.StylerUtils;
|
||||
|
||||
/**
|
||||
* Exception to be thrown if DispatcherPortlet is unable to determine
|
||||
* a corresponding handler for an incoming portlet request.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0.5
|
||||
*/
|
||||
public class NoHandlerFoundException extends PortletException {
|
||||
|
||||
/**
|
||||
* Constructor for NoHandlerFoundException.
|
||||
* @param msg the detail message
|
||||
*/
|
||||
public NoHandlerFoundException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for NoHandlerFoundException.
|
||||
* @param msg the detail message
|
||||
* @param request the current portlet request,
|
||||
* for further context to be included in the exception message
|
||||
*/
|
||||
public NoHandlerFoundException(String msg, PortletRequest request) {
|
||||
super(msg + ": mode '" + request.getPortletMode() +
|
||||
"', phase '" + request.getAttribute(PortletRequest.LIFECYCLE_PHASE) +
|
||||
"', parameters " + StylerUtils.style(request.getParameterMap()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet action requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping
|
||||
public @interface ActionMapping {
|
||||
|
||||
/**
|
||||
* The name of the action, according to the Portlet 2.0
|
||||
* "javax.portlet.action" parameter.
|
||||
* <p>If not specified, the method will be used as default handler:
|
||||
* i.e. for action requests where no specific action mapping was found.
|
||||
* <p>Note that all such annotated action methods only apply within the
|
||||
* <code>@RequestMapping</code> constraints of the containing handler class.
|
||||
* @see javax.portlet.ActionRequest#ACTION_NAME
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* The parameters of the mapped request, narrowing the primary mapping.
|
||||
* <p>Same format for any environment: a sequence of "myParam=myValue" style
|
||||
* expressions, with a request only mapped if each such parameter is found
|
||||
* to have the given value. "myParam" style expressions are also supported,
|
||||
* with such parameters having to be present in the request (allowed to have
|
||||
* any value). Finally, "!myParam" style expressions indicate that the
|
||||
* specified parameter is <i>not</i> supposed to be present in the request.
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping#params()
|
||||
*/
|
||||
String[] params() default {};
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet action requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping
|
||||
public @interface ActionMapping {
|
||||
|
||||
/**
|
||||
* The name of the action, according to the Portlet 2.0
|
||||
* "javax.portlet.action" parameter.
|
||||
* <p>If not specified, the method will be used as default handler:
|
||||
* i.e. for action requests where no specific action mapping was found.
|
||||
* <p>Note that all such annotated action methods only apply within the
|
||||
* <code>@RequestMapping</code> constraints of the containing handler class.
|
||||
* @see javax.portlet.ActionRequest#ACTION_NAME
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* The parameters of the mapped request, narrowing the primary mapping.
|
||||
* <p>Same format for any environment: a sequence of "myParam=myValue" style
|
||||
* expressions, with a request only mapped if each such parameter is found
|
||||
* to have the given value. "myParam" style expressions are also supported,
|
||||
* with such parameters having to be present in the request (allowed to have
|
||||
* any value). Finally, "!myParam" style expressions indicate that the
|
||||
* specified parameter is <i>not</i> supposed to be present in the request.
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping#params()
|
||||
*/
|
||||
String[] params() default {};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet event requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping()
|
||||
public @interface EventMapping {
|
||||
|
||||
/**
|
||||
* The name of the event to be handled.
|
||||
* This name uniquely identifies an event within a portlet mode.
|
||||
* <p>Typically the local name of the event, but fully qualified names
|
||||
* with a "{...}" namespace part will be mapped correctly as well.
|
||||
* <p>If not specified, the handler method will be invoked for any
|
||||
* event request within its general mapping.
|
||||
* @see javax.portlet.EventRequest#getEvent()
|
||||
* @see javax.portlet.Event#getName()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet event requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping()
|
||||
public @interface EventMapping {
|
||||
|
||||
/**
|
||||
* The name of the event to be handled.
|
||||
* This name uniquely identifies an event within a portlet mode.
|
||||
* <p>Typically the local name of the event, but fully qualified names
|
||||
* with a "{...}" namespace part will be mapped correctly as well.
|
||||
* <p>If not specified, the handler method will be invoked for any
|
||||
* event request within its general mapping.
|
||||
* @see javax.portlet.EventRequest#getEvent()
|
||||
* @see javax.portlet.Event#getName()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet render requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping
|
||||
public @interface RenderMapping {
|
||||
|
||||
/**
|
||||
* The window state that the annotated render method applies for.
|
||||
* <p>If not specified, the render method will be invoked for any
|
||||
* window state within its general mapping.
|
||||
* <p>Standard Portlet spec values: "NORMAL", "MAXIMIZED", "MINIMIZED".
|
||||
* Custom window states can be used as well, as supported by the portal.
|
||||
* @see javax.portlet.PortletRequest#getWindowState()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* The parameters of the mapped request, narrowing the primary mapping.
|
||||
* <p>Same format for any environment: a sequence of "myParam=myValue" style
|
||||
* expressions, with a request only mapped if each such parameter is found
|
||||
* to have the given value. "myParam" style expressions are also supported,
|
||||
* with such parameters having to be present in the request (allowed to have
|
||||
* any value). Finally, "!myParam" style expressions indicate that the
|
||||
* specified parameter is <i>not</i> supposed to be present in the request.
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping#params()
|
||||
*/
|
||||
String[] params() default {};
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet render requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping
|
||||
public @interface RenderMapping {
|
||||
|
||||
/**
|
||||
* The window state that the annotated render method applies for.
|
||||
* <p>If not specified, the render method will be invoked for any
|
||||
* window state within its general mapping.
|
||||
* <p>Standard Portlet spec values: "NORMAL", "MAXIMIZED", "MINIMIZED".
|
||||
* Custom window states can be used as well, as supported by the portal.
|
||||
* @see javax.portlet.PortletRequest#getWindowState()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* The parameters of the mapped request, narrowing the primary mapping.
|
||||
* <p>Same format for any environment: a sequence of "myParam=myValue" style
|
||||
* expressions, with a request only mapped if each such parameter is found
|
||||
* to have the given value. "myParam" style expressions are also supported,
|
||||
* with such parameters having to be present in the request (allowed to have
|
||||
* any value). Finally, "!myParam" style expressions indicate that the
|
||||
* specified parameter is <i>not</i> supposed to be present in the request.
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping#params()
|
||||
*/
|
||||
String[] params() default {};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet resource requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping()
|
||||
public @interface ResourceMapping {
|
||||
|
||||
/**
|
||||
* The id of the resource to be handled.
|
||||
* This id uniquely identifies a resource within a portlet mode.
|
||||
* <p>If not specified, the handler method will be invoked for any
|
||||
* resource request within its general mapping.
|
||||
* @see javax.portlet.ResourceRequest#getResourceID()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.bind.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.web.bind.annotation.Mapping;
|
||||
|
||||
/**
|
||||
* Annotation for mapping Portlet resource requests onto handler methods.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Mapping()
|
||||
public @interface ResourceMapping {
|
||||
|
||||
/**
|
||||
* The id of the resource to be handled.
|
||||
* This id uniquely identifies a resource within a portlet mode.
|
||||
* <p>If not specified, the handler method will be invoked for any
|
||||
* resource request within its general mapping.
|
||||
* @see javax.portlet.ResourceRequest#getResourceID()
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,111 +1,111 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.context;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import javax.portlet.PortletContext;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.config.Scope;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link Scope} wrapper for a PortletContext, i.e. for global web application attributes.
|
||||
*
|
||||
* <p>This differs from traditional Spring singletons in that it exposes attributes in the
|
||||
* PortletContext. Those attributes will get destroyed whenever the entire application
|
||||
* shuts down, which might be earlier or later than the shutdown of the containing Spring
|
||||
* ApplicationContext.
|
||||
*
|
||||
* <p>The associated destruction mechanism relies on a
|
||||
* {@link org.springframework.web.context.ContextCleanupListener} being registered in
|
||||
* <code>web.xml</code>. Note that {@link org.springframework.web.context.ContextLoaderListener}
|
||||
* includes ContextCleanupListener's functionality.
|
||||
*
|
||||
* <p>This scope is registered as default scope with key
|
||||
* {@link org.springframework.web.context.WebApplicationContext#SCOPE_APPLICATION "application"}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.context.ContextCleanupListener
|
||||
*/
|
||||
public class PortletContextScope implements Scope, DisposableBean {
|
||||
|
||||
private final PortletContext portletContext;
|
||||
|
||||
private final Map<String, Runnable> destructionCallbacks = new LinkedHashMap<String, Runnable>();
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Scope wrapper for the given PortletContext.
|
||||
* @param PortletContext the PortletContext to wrap
|
||||
*/
|
||||
public PortletContextScope(PortletContext portletContext) {
|
||||
Assert.notNull(portletContext, "PortletContext must not be null");
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
|
||||
public Object get(String name, ObjectFactory<?> objectFactory) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject == null) {
|
||||
scopedObject = objectFactory.getObject();
|
||||
this.portletContext.setAttribute(name, scopedObject);
|
||||
}
|
||||
return scopedObject;
|
||||
}
|
||||
|
||||
public Object remove(String name) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject != null) {
|
||||
this.portletContext.removeAttribute(name);
|
||||
this.destructionCallbacks.remove(name);
|
||||
return scopedObject;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerDestructionCallback(String name, Runnable callback) {
|
||||
this.destructionCallbacks.put(name, callback);
|
||||
}
|
||||
|
||||
public Object resolveContextualObject(String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getConversationId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Invoke all registered destruction callbacks.
|
||||
* To be called on ServletContext shutdown.
|
||||
* @see org.springframework.web.context.ContextCleanupListener
|
||||
*/
|
||||
public void destroy() {
|
||||
for (Runnable runnable : this.destructionCallbacks.values()) {
|
||||
runnable.run();
|
||||
}
|
||||
this.destructionCallbacks.clear();
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.context;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import javax.portlet.PortletContext;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.config.Scope;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link Scope} wrapper for a PortletContext, i.e. for global web application attributes.
|
||||
*
|
||||
* <p>This differs from traditional Spring singletons in that it exposes attributes in the
|
||||
* PortletContext. Those attributes will get destroyed whenever the entire application
|
||||
* shuts down, which might be earlier or later than the shutdown of the containing Spring
|
||||
* ApplicationContext.
|
||||
*
|
||||
* <p>The associated destruction mechanism relies on a
|
||||
* {@link org.springframework.web.context.ContextCleanupListener} being registered in
|
||||
* <code>web.xml</code>. Note that {@link org.springframework.web.context.ContextLoaderListener}
|
||||
* includes ContextCleanupListener's functionality.
|
||||
*
|
||||
* <p>This scope is registered as default scope with key
|
||||
* {@link org.springframework.web.context.WebApplicationContext#SCOPE_APPLICATION "application"}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.web.context.ContextCleanupListener
|
||||
*/
|
||||
public class PortletContextScope implements Scope, DisposableBean {
|
||||
|
||||
private final PortletContext portletContext;
|
||||
|
||||
private final Map<String, Runnable> destructionCallbacks = new LinkedHashMap<String, Runnable>();
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Scope wrapper for the given PortletContext.
|
||||
* @param PortletContext the PortletContext to wrap
|
||||
*/
|
||||
public PortletContextScope(PortletContext portletContext) {
|
||||
Assert.notNull(portletContext, "PortletContext must not be null");
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
|
||||
public Object get(String name, ObjectFactory<?> objectFactory) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject == null) {
|
||||
scopedObject = objectFactory.getObject();
|
||||
this.portletContext.setAttribute(name, scopedObject);
|
||||
}
|
||||
return scopedObject;
|
||||
}
|
||||
|
||||
public Object remove(String name) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject != null) {
|
||||
this.portletContext.removeAttribute(name);
|
||||
this.destructionCallbacks.remove(name);
|
||||
return scopedObject;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerDestructionCallback(String name, Runnable callback) {
|
||||
this.destructionCallbacks.put(name, callback);
|
||||
}
|
||||
|
||||
public Object resolveContextualObject(String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getConversationId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Invoke all registered destruction callbacks.
|
||||
* To be called on ServletContext shutdown.
|
||||
* @see org.springframework.web.context.ContextCleanupListener
|
||||
*/
|
||||
public void destroy() {
|
||||
for (Runnable runnable : this.destructionCallbacks.values()) {
|
||||
runnable.run();
|
||||
}
|
||||
this.destructionCallbacks.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,64 +1,64 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.handler;
|
||||
|
||||
import javax.portlet.PortletMode;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Internal class used as lookup key, combining PortletMode and parameter value.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
class PortletModeParameterLookupKey {
|
||||
|
||||
private final PortletMode mode;
|
||||
|
||||
private final String parameter;
|
||||
|
||||
|
||||
public PortletModeParameterLookupKey(PortletMode portletMode, String parameter) {
|
||||
this.mode = portletMode;
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PortletModeParameterLookupKey)) {
|
||||
return false;
|
||||
}
|
||||
PortletModeParameterLookupKey otherKey = (PortletModeParameterLookupKey) other;
|
||||
return (this.mode.equals(otherKey.mode) &&
|
||||
ObjectUtils.nullSafeEquals(this.parameter, otherKey.parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (this.mode.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Portlet mode '" + this.mode + "', parameter '" + this.parameter + "'";
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.handler;
|
||||
|
||||
import javax.portlet.PortletMode;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Internal class used as lookup key, combining PortletMode and parameter value.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
class PortletModeParameterLookupKey {
|
||||
|
||||
private final PortletMode mode;
|
||||
|
||||
private final String parameter;
|
||||
|
||||
|
||||
public PortletModeParameterLookupKey(PortletMode portletMode, String parameter) {
|
||||
this.mode = portletMode;
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PortletModeParameterLookupKey)) {
|
||||
return false;
|
||||
}
|
||||
PortletModeParameterLookupKey otherKey = (PortletModeParameterLookupKey) other;
|
||||
return (this.mode.equals(otherKey.mode) &&
|
||||
ObjectUtils.nullSafeEquals(this.parameter, otherKey.parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (this.mode.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Portlet mode '" + this.mode + "', parameter '" + this.parameter + "'";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.mvc;
|
||||
|
||||
import javax.portlet.EventRequest;
|
||||
import javax.portlet.EventResponse;
|
||||
|
||||
/**
|
||||
* Extension of the Portlet {@link Controller} interface that allows
|
||||
* for handling Portlet 2.0 event requests as well. Can also be
|
||||
* implemented by {@link AbstractController} subclasses.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see javax.portlet.EventPortlet
|
||||
* @see Controller
|
||||
* @see ResourceAwareController
|
||||
*/
|
||||
public interface EventAwareController {
|
||||
|
||||
/**
|
||||
* Process the event request. There is nothing to return.
|
||||
* @param request current portlet event request
|
||||
* @param response current portlet event response
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
void handleEventRequest(EventRequest request, EventResponse response) throws Exception;
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.mvc;
|
||||
|
||||
import javax.portlet.EventRequest;
|
||||
import javax.portlet.EventResponse;
|
||||
|
||||
/**
|
||||
* Extension of the Portlet {@link Controller} interface that allows
|
||||
* for handling Portlet 2.0 event requests as well. Can also be
|
||||
* implemented by {@link AbstractController} subclasses.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see javax.portlet.EventPortlet
|
||||
* @see Controller
|
||||
* @see ResourceAwareController
|
||||
*/
|
||||
public interface EventAwareController {
|
||||
|
||||
/**
|
||||
* Process the event request. There is nothing to return.
|
||||
* @param request current portlet event request
|
||||
* @param response current portlet event response
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
void handleEventRequest(EventRequest request, EventResponse response) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.mvc;
|
||||
|
||||
import javax.portlet.ResourceRequest;
|
||||
import javax.portlet.ResourceResponse;
|
||||
|
||||
import org.springframework.web.portlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* Extension of the Portlet {@link Controller} interface that allows
|
||||
* for handling Portlet 2.0 resource requests as well. Can also be
|
||||
* implemented by {@link AbstractController} subclasses.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see javax.portlet.ResourceServingPortlet
|
||||
* @see Controller
|
||||
* @see EventAwareController
|
||||
*/
|
||||
public interface ResourceAwareController {
|
||||
|
||||
/**
|
||||
* Process the resource request and return a ModelAndView object which the DispatcherPortlet
|
||||
* will render. A <code>null</code> return value is not an error: It indicates that this
|
||||
* object completed request processing itself, thus there is no ModelAndView to render.
|
||||
* @param request current portlet resource request
|
||||
* @param response current portlet resource response
|
||||
* @return a ModelAndView to render, or null if handled directly
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
ModelAndView handleResourceRequest(ResourceRequest request, ResourceResponse response) throws Exception;
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.portlet.mvc;
|
||||
|
||||
import javax.portlet.ResourceRequest;
|
||||
import javax.portlet.ResourceResponse;
|
||||
|
||||
import org.springframework.web.portlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* Extension of the Portlet {@link Controller} interface that allows
|
||||
* for handling Portlet 2.0 resource requests as well. Can also be
|
||||
* implemented by {@link AbstractController} subclasses.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see javax.portlet.ResourceServingPortlet
|
||||
* @see Controller
|
||||
* @see EventAwareController
|
||||
*/
|
||||
public interface ResourceAwareController {
|
||||
|
||||
/**
|
||||
* Process the resource request and return a ModelAndView object which the DispatcherPortlet
|
||||
* will render. A <code>null</code> return value is not an error: It indicates that this
|
||||
* object completed request processing itself, thus there is no ModelAndView to render.
|
||||
* @param request current portlet resource request
|
||||
* @param response current portlet resource response
|
||||
* @return a ModelAndView to render, or null if handled directly
|
||||
* @throws Exception in case of errors
|
||||
*/
|
||||
ModelAndView handleResourceRequest(ResourceRequest request, ResourceResponse response) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user