Class URLHandlerImpl
java.lang.Object
org.broadleafcommerce.cms.url.domain.URLHandlerImpl
- All Implemented Interfaces:
Serializable,URLHandler,URLHandlerAdminPresentation,AdminMainEntity,MultiTenantCloneable<URLHandler>,ProfileEntity,Locatable
@Entity
public class URLHandlerImpl
extends Object
implements URLHandler, Locatable, AdminMainEntity, ProfileEntity, URLHandlerAdminPresentation
- Author:
- priyeshpatel
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.broadleafcommerce.cms.url.domain.URLHandlerAdminPresentation
URLHandlerAdminPresentation.GroupName, URLHandlerAdminPresentation.GroupOrder, URLHandlerAdminPresentation.TabName, URLHandlerAdminPresentation.TabOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longprotected Stringprotected Booleanprotected Stringprotected StringFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends URLHandler>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.booleangetId()If this is returning something that is non-null, this MUST return a String that starts with a slash and does not end with a slash.inthashCode()protected booleanhasRegExCharacters(String location) In a preview environment,getLocation()attempts to navigate to the provided URL.booleanIndicates if the value returned bygetIncomingURL()is a regex expression rather than a concrete URI.voidvoidsetIncomingURL(String incomingURL) voidvoidsetRegexHandler(boolean regexHandler) Deprecated.voidsetRegexHandler(Boolean regexHandler) Indicates if the value set by the methodsetIncomingURL(String)should be treated as a regex expression rather than as a concrete URI.voidsetUrlRedirectType(URLRedirectType redirectType)
-
Field Details
-
id
-
incomingURL
-
newURL
-
urlRedirectType
-
isRegex
-
-
Constructor Details
-
URLHandlerImpl
public URLHandlerImpl()
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceURLHandler
-
setId
- Specified by:
setIdin interfaceURLHandler
-
getIncomingURL
- Specified by:
getIncomingURLin interfaceURLHandler
-
setIncomingURL
- Specified by:
setIncomingURLin interfaceURLHandler
-
getNewURL
- Specified by:
getNewURLin interfaceURLHandler
-
setNewURL
- Specified by:
setNewURLin interfaceURLHandler
-
getUrlRedirectType
- Specified by:
getUrlRedirectTypein interfaceURLHandler
-
setUrlRedirectType
- Specified by:
setUrlRedirectTypein interfaceURLHandler
-
isRegexHandler
public boolean isRegexHandler()Description copied from interface:URLHandlerIndicates if the value returned bygetIncomingURL()is a regex expression rather than a concrete URI. Default is false.- Specified by:
isRegexHandlerin interfaceURLHandler- Returns:
-
setRegexHandler
Deprecated.- Specified by:
setRegexHandlerin interfaceURLHandler
-
setRegexHandler
Description copied from interface:URLHandlerIndicates if the value set by the methodsetIncomingURL(String)should be treated as a regex expression rather than as a concrete URI.- Specified by:
setRegexHandlerin interfaceURLHandler
-
getMainEntityName
- Specified by:
getMainEntityNamein interfaceAdminMainEntity- Returns:
- the display name of this entity for the admin screen
-
getLocation
Description copied from interface:LocatableIf this is returning something that is non-null, this MUST return a String that starts with a slash and does not end with a slash.- Specified by:
getLocationin interfaceLocatable- Returns:
- the url of the locatable item
-
hasRegExCharacters
In a preview environment,getLocation()attempts to navigate to the provided URL. If the URL contains a Regular Expression, then we can't navigate to it.- Parameters:
location-- Returns:
-
createOrRetrieveCopyInstance
public <G extends URLHandler> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneableClone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<URLHandler>- Parameters:
context- a context object providing persistence and library functionality for copying entities- Returns:
- the resulting copy container, possibly already persisted
- Throws:
CloneNotSupportedException- if there's a problem detected with the cloning configuration
-
equals
-
hashCode
public int hashCode()
-