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 Long
protected String
protected Boolean
protected String
protected String
Fields 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.boolean
getId()
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.int
hashCode()
protected boolean
hasRegExCharacters
(String location) In a preview environment,getLocation()
attempts to navigate to the provided URL.boolean
Indicates if the value returned bygetIncomingURL()
is a regex expression rather than a concrete URI.void
void
setIncomingURL
(String incomingURL) void
void
setRegexHandler
(boolean regexHandler) Deprecated.void
setRegexHandler
(Boolean regexHandler) Indicates if the value set by the methodsetIncomingURL(String)
should be treated as a regex expression rather than as a concrete URI.void
setUrlRedirectType
(URLRedirectType redirectType)
-
Field Details
-
id
-
incomingURL
-
newURL
-
urlRedirectType
-
isRegex
-
-
Constructor Details
-
URLHandlerImpl
public URLHandlerImpl()
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceURLHandler
-
setId
- Specified by:
setId
in interfaceURLHandler
-
getIncomingURL
- Specified by:
getIncomingURL
in interfaceURLHandler
-
setIncomingURL
- Specified by:
setIncomingURL
in interfaceURLHandler
-
getNewURL
- Specified by:
getNewURL
in interfaceURLHandler
-
setNewURL
- Specified by:
setNewURL
in interfaceURLHandler
-
getUrlRedirectType
- Specified by:
getUrlRedirectType
in interfaceURLHandler
-
setUrlRedirectType
- Specified by:
setUrlRedirectType
in interfaceURLHandler
-
isRegexHandler
public boolean isRegexHandler()Description copied from interface:URLHandler
Indicates if the value returned bygetIncomingURL()
is a regex expression rather than a concrete URI. Default is false.- Specified by:
isRegexHandler
in interfaceURLHandler
- Returns:
-
setRegexHandler
Deprecated.- Specified by:
setRegexHandler
in interfaceURLHandler
-
setRegexHandler
Description copied from interface:URLHandler
Indicates if the value set by the methodsetIncomingURL(String)
should be treated as a regex expression rather than as a concrete URI.- Specified by:
setRegexHandler
in interfaceURLHandler
-
getMainEntityName
- Specified by:
getMainEntityName
in interfaceAdminMainEntity
- Returns:
- the display name of this entity for the admin screen
-
getLocation
Description copied from interface:Locatable
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.- Specified by:
getLocation
in 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:MultiTenantCloneable
Clone 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 { CreateResponse
createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstance
in 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()
-