|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SEOService
The Search Engine Optimization Service is responsible for managing the mapping between friendly URLs and their internal URL counterpart. This service defines CRUD methods, as well as methods for transforming friendly URLs to internal URLs or the other way around.
| Method Summary | |
|---|---|
void |
activateFriendlyURL(MediaItemVersion mediaItemVersion)
Activates the friendly URL of the given media item version. |
void |
activateFriendlyURL(PageVersion pageVersion)
Activates the friendly URL of the given page version. |
void |
createFriendlyURL(MediaItemVersion mediaItemVersion)
Creates a new friendly URL for the given media item version. |
void |
createFriendlyURL(PageVersion pageVersion)
Creates a new friendly URL for the given page version. |
void |
createFriendlyURL(ResourceInstance resourceInstance,
java.lang.String entityTitle)
Creates a new friendly URL for the given resource instance with the specified entity title. |
void |
deleteFriendlyURL(int id)
Deprecated. Delete friendly URLs using deleteFriendlyURL(Page),
deleteFriendlyURL(PageVersion), deleteFriendlyURL(MediaItem) and
deleteFriendlyURL(ResourceInstance). |
void |
deleteFriendlyURL(MediaItem mediaItem)
Deletes the friendly URL for the given media item. |
void |
deleteFriendlyURL(MediaItemVersion mediaItemVersion)
Deletes the friendly URL for the given media item version. |
void |
deleteFriendlyURL(Page page)
Deletes all friendly URLs for the given page. |
void |
deleteFriendlyURL(PageVersion pageVersion)
Deletes the friendly URL for the given page version. |
void |
deleteFriendlyURL(ResourceInstance resourceInstance)
Deletes the friendly URL for the given resource instance. |
java.lang.String |
getDBPageFriendlyURL(int dbId,
int typeOfPageId,
java.lang.String host)
Deprecated. Use getFriendlyURL(ResourceInstance) instead. |
java.lang.String |
getFriendlyURL(MediaItemVersion mediaItemVersion,
Website website)
Deprecated. Use getFriendlyURL(PageVersion, MediaItemVersion) instead. |
java.lang.String |
getFriendlyURL(PageVersion pageVersion)
Returns the friendly URL of the given page version. |
java.lang.String |
getFriendlyURL(PageVersion pageVersion,
MediaItemVersion mediaItemVersion)
Returns the friendly URL of the given media item version shown on the given page version. |
java.lang.String |
getFriendlyURL(PageVersion pageVersion,
ResourceInstance resourceInstance)
Returns the friendly URL of the given resource instance shown on the given page version. |
java.lang.String |
getFriendlyURL(ResourceInstance resourceInstance)
Deprecated. Use getFriendlyURL(PageVersion, ResourceInstance) instead. |
java.lang.String |
getFriendlyURL(java.lang.String internalURL,
java.lang.String host)
Returns the friendly URL given an internal URL. |
FriendlyURLEntity |
getFriendlyURLEntity(MediaItemVersion mediaItemVersion)
Returns the friendly URL entity for the given media item version. |
FriendlyURLEntity |
getFriendlyURLEntity(PageVersion pageVersion)
Returns the friendly URL entity for the given page version. |
FriendlyURLEntity |
getFriendlyURLEntity(ResourceInstance resourceInstance)
Returns the friendly URL entity for the given resource instance. |
java.lang.String |
getMediaItemBaseEntityURLTitle(int mediaItemVersionId)
Deprecated. Use FriendlyURLEntity.getBaseURLTitleEntityIdentifier() which can be retrieved
through getFriendlyURLEntity(MediaItemVersion). |
java.lang.String |
getMediaItemFriendlyURL(int mediaItemVersionId,
java.lang.String host)
Deprecated. Use getFriendlyURL(MediaItemVersion, Website) instead. |
java.lang.String |
getPageFriendlyURL(int pageVersionId,
java.lang.String host)
Deprecated. Use getFriendlyURL(PageVersion) instead. |
java.lang.String |
getPageTitle(PageVersion pageVersion)
Returns the title used for generating the friendly URL for this page version. |
java.lang.String |
getTargetURL(java.lang.String url,
java.lang.String host)
Calculates the targeted internal URL given a relative friendly URL and a host name, or the current Friendly URL when given an old friendly URL, or returns an empty String when no match can be found. |
boolean |
isFriendlyURL(java.lang.String url,
java.lang.String host)
Checks whether the given URL is a friendly URL. |
boolean |
isGoogleNewsIdOn(java.lang.String host)
Returns true if the Google News id feature is activated. |
void |
moveFriendlyURL(Page page,
Page sourceParentPage)
Handles the effect of a page move on the friendly URL of the page and all its descendant pages. |
void |
publishFriendlyURL(MediaItemVersion mediaItemVersion)
Handles the effect of a media item version roll over on the friendly URL of the media item version. |
void |
publishFriendlyURL(PageVersion pageVersion)
Handles the effect of a public version roll over on friendly URLs of descendant pages. |
java.lang.String |
translateTitleToFriendlyURL(java.lang.String title,
java.lang.String host)
Deprecated. Translation is done internally when creating a friendly URL. Get friendly URL through getFriendlyURL(PageVersion). |
java.lang.String |
translateTitleToURLIdentifier(java.lang.String title)
Deprecated. Translation is done internally when creating a friendly URL. After that obtain the URL title through getFriendlyURL(PageVersion) and
FriendlyURLEntity.getURLIdentifier(). |
java.lang.String |
translateTitleToURLTitle(java.lang.String title)
Deprecated. Translation is done internally when creating a friendly URL. After that obtain the URL title through getFriendlyURL(PageVersion) and
FriendlyURLEntity.getURLTitle(). |
void |
updateAlternativePath(PageVersion pageVersion)
Updates the friendly URL for the given page version according to its alternative path. |
void |
updateFriendlyURL(MediaItemVersion mediaItemVersion)
Updates the friendly URL for the given media item version. |
void |
updateFriendlyURL(MediaItemVersion mediaItemVersion,
java.lang.String urlTitleOverrule)
Deprecated. The friendly URL of media item versions and page versions are defined to be tightly bound to a metadata field. It should therefore not be possible to explicitly set one. Implicitly update it through updateFriendlyURL(MediaItemVersion). |
void |
updateFriendlyURL(PageVersion pageVersion)
Updates the friendly URL for the given page version. |
void |
updateFriendlyURL(ResourceInstance resourceInstance,
java.lang.String urlTitle)
Updates the friendly URL for the given resource instance using the given URL title. |
| Method Detail |
|---|
java.lang.String getTargetURL(java.lang.String url,
java.lang.String host)
host - the host name.url - The relative friendly URL for which the internal URL is requested.
boolean isGoogleNewsIdOn(java.lang.String host)
true if the Google News id feature is activated. This feature can be switched on
or off per website, specified by one of the website's host names.
Setting this value can be done through the configuration key
website_settings.friendly_url_google_news_id.
host - Host name of the website to check this configuration option.
true if the google_news_id for the current web initiative is checked,
false otherwise.
boolean isFriendlyURL(java.lang.String url,
java.lang.String host)
Setting this value can be done through the configuration key
website_settings.friendly_url_extension.
url - Input URL to check whether it is a friendly URL. Can be absolute or relative.host - Host name of the website to check its friendly URL extension for.
true if the website_settings.friendly_url_extension configuration
setting equals the last part after the '.' in the given URL, false otherwise.
void createFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
FriendlyURLException is thrown. Also, the given page version must be of type
Page.PAGE_TYPE, or else an IllegalArgumentException is thrown.
Depending on which meta data field of the page version is used as input (see
getPageTitle(PageVersion)) an entity URL is generated from it. The complete friendly URL of
the page version consists of this entity URL and a path of all the parent page's friendly URLs. Only
those parent pages are involved which have a page version for the same language as the given page
version. Also the home page is excluded from those parent pages.
Example:
Assume three pages titled Home, News and Economy. Home is the home page, News is a child of Home, and
Economy is a child of News. Creating a child page of Economy results in the following call and friendly
URL:
mySEOService.createFriendlyURL(economyPage)
Resulting friendly URL: /News/Economy/New-Page.htm
Try to avoid calling this method a lot at once, without changing the URL title. Each newly created version has the same default title, so they will all claim the same friendly URL. In effect sequence numbers are appended to these friendly URLs to make them unique, resulting in a bit less friendly URLs.
Also, avoid publishing the newly created version, before changing its default title. A published version does never release its current friendly URL automatically, even if it is changed afterwards.
pageVersion - Create a friendly URL for this page version.
FriendlyURLException - If any access to the persistent layer failed.#createFriendlyURL(MediaItemVersion)},
#createFriendlyURL(ResourceInstance, String)},
#getPageTitle(PageVersion)}
void createFriendlyURL(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
FriendlyURLException is thrown.
Try to avoid calling this method a lot at once, without changing the URL title. Each newly created version has the same default title, so they will all claim the same friendly URL. In effect sequence numbers are appended to these friendly URLs to make them unique, resulting in a bit less friendly URLs.
Also, avoid publishing the newly created version, before changing its default title. A published version does never release its current friendly URL automatically, even if it is changed afterwards.
mediaItemVersion - Create a friendly URL for this media item version.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.#createFriendlyURL(PageVersion)},
#createFriendlyURL(ResourceInstance, String)}
void createFriendlyURL(ResourceInstance resourceInstance,
java.lang.String entityTitle)
throws FriendlyURLException
FriendlyURLException is thrown.
The entity title parameter should be an unformatted string, that is, the exact title given to the resource instance including any diacritical characters or spaces.
Example: mySEOService.createFriendlyURL(resourceInstance, "Marco van Basten")
resourceInstance - Create a friendly URL for this resource instance.entityTitle - Use this entity title as input for the friendly URL.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.#createFriendlyURL(PageVersion)},
#createFriendlyURL(MediaItemVersion)}
void updateFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
getPageTitle(PageVersion)).
The friendly URL that is overwritten is not released, but becomes part of the history of friendly URLs of the given page version. If a website visitor requests a friendly URL from the history then the SEO application redirects to the most up-to-date friendly URL.
An exception on this is that as long as the given page version is not public (and also has never been), the friendly URL is overwritten. A page version is defined to be public whenever the work flow state of the page version is set to a public state. It is therefore good habit to change its title as long as its not public, and try to minimize title changes after it is in a public state.
pageVersion - Update the friendly URL of this page version.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.#updateFriendlyURL(MediaItemVersion)},
#updateFriendlyURL(MediaItemVersion, String))}
void updateFriendlyURL(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
updateFriendlyURL(MediaItemVersion, String).
The friendly URL that is overwritten is not released, but becomes part of the history of friendly URLs of the given media item version. If a website visitor requests a friendly URL from the history then the SEO application redirects to the most up-to-date friendly URL.
An exception on this is that as long as the given media item version is not public (and also has never been), the friendly URL is overwritten. A media item version is defined to be public whenever the work flow state of the media item version is set to a public state. It is therefore good habit to change its title as long as its not public, and try to minimize title changes after it is in a public state.
mediaItemVersion - Update the friendly URL of this media item version.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.#updateFriendlyURL(MediaItemVersion, String))},
#updateFriendlyURL(PageVersion)}
@Deprecated
void updateFriendlyURL(MediaItemVersion mediaItemVersion,
java.lang.String urlTitleOverrule)
throws FriendlyURLException
updateFriendlyURL(MediaItemVersion).
This method is deprecated as it is a work around for the MediaItemVersion lacking an URL
title overrule field.
mediaItemVersion - Update the friendly URL of this media item version.urlTitleOverrule - The string used as input for creating the friendly URL.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.#updateFriendlyURL(MediaItemVersion)}
void updateFriendlyURL(ResourceInstance resourceInstance,
java.lang.String urlTitle)
throws FriendlyURLException
resourceInstance - Update the friendly URL of this resource instance.urlTitle - The string used as input for creating the friendly URL.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.
void updateAlternativePath(PageVersion pageVersion)
throws FriendlyURLException
PageVersion.getAlternativeURLPath().
If the alternative path is set to an empty string then its normal path is used.
pageVersion - Update the friendly URL of this page version.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.
void deleteFriendlyURL(Page page)
throws FriendlyURLException
page - Delete all friendly URLs of this page.
FriendlyURLException - Occurs in case the friendly URL could not be persisted.
void deleteFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
pageVersion - Delete the friendly URL for this page version.
FriendlyURLException - If any access to the persistent layer failed.
void deleteFriendlyURL(MediaItem mediaItem)
throws FriendlyURLException
mediaItem - Delete the friendly URL for this media item.
FriendlyURLException - If any access to the persistent layer failed.
void deleteFriendlyURL(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
mediaItem - Delete the friendly URL for this media item version.
FriendlyURLException - If any access to the persistent layer failed.
void deleteFriendlyURL(ResourceInstance resourceInstance)
throws FriendlyURLException
resourceInstance - Delete the friendly URL for this resource instance.
FriendlyURLException - If any access to the persistent layer failed.
void activateFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
updateFriendlyURL(PageVersion). The
friendly URL is only activated if the given page version is in a public state.
When a friendly URL is activated a history of friendly URLs is build after subsequent updates. Maintaining this history makes it possible to keep these old friendly URLs accessible. Old URLs typically come from book marks and search engines.
It is a good habit to change its title as long as its not public, and try to minimize title changes
after it is in a public state. This avoids a lot of default title claims (see
createFriendlyURL(PageVersion)) and a big history of friendly URLs.
pageVersion - Activate the friendly URL of this page version.
FriendlyURLException - If any access to the persistent layer failed.
void activateFriendlyURL(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
updateFriendlyURL(MediaItemVersion). The friendly URL is only activated if the given media
item version is in a public state.
When a friendly URL is activated a history of friendly URLs is build after subsequent updates. Maintaining this history makes it possible to keep these old friendly URLs accessible. Old URLs typically come from bookmarks and search engines.
It is a good habit to change its title as long as its not public, and try to minimize title changes
after it is in a public state. This avoids a lot of default title claims (see
createFriendlyURL(MediaItemVersion)) and a big history of friendly URLs.
mediaItemVersion - Activate the friendly URL of this media item version.
FriendlyURLException - If any access to the persistent layer failed.
void publishFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
If the current version of the given page version's page is not null then all descendant
page's friendly URLs are updated, so that the friendly URL of the given page version is substituted in
their paths. If there was no current page version previously the friendly URL of the given page version
in inserted in their paths. If there is no current page version now the previous friendly URL is
removed from their paths.
pageVersion - Publish the friendly URL of this page version.
FriendlyURLException - If any access to the persistent layer failed.
void publishFriendlyURL(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
mediaItemVersion - Publish the friendly URL of this media item version.
FriendlyURLException - If any access to the persistent layer failed.
void moveFriendlyURL(Page page,
Page sourceParentPage)
throws FriendlyURLException
IllegalArgumentException is thrown.
page - Move the friendly URL for this page.sourceParentPage - The parent page the given page previously was a child of.
FriendlyURLException - If any access to the persistent layer failed.
java.lang.String getFriendlyURL(java.lang.String internalURL,
java.lang.String host)
throws FriendlyURLException
id and langid components. If not or there is no friendly URL matching these
components then the internal URL itself is returned. Optionally the internal URL might contain the
contentid component for media items or dbid and typeofpage
components for database pages (resource instances), which are replaced by their friendly variant.
The host specifies some website specific configuration settings that are applied to the friendly URL. These are:
website_settings.friendly_url_prefix)
website_settings.friendly_url_google_news_id); see
isGoogleNewsIdOn(String)
website_settings.friendly_url_separator)
website_settings.friendly_url_extension)
Example:
Given the friendly URL mappings of '&id=41323&langid=42' on 'My News' and '&contentid=4' on 'New and
improved SEO in WebManager', and given the configuration where friendly URL prefix is '/gx', the Google
News id is switched on, the friendly URL separator is '-' and the friendly URL extension is '.htm' for
a website with host name 'www.gxwebmanager.com':
getFriendlyURL("/web/show?id=41323&langid=42&contentid=4&post=true", "www.gxwebmanager.com")
results in: /gx/My-News/004/New-and-improved-SEO-in-WebManager.htm?post=true
Note that the internal URL is allowed to be absolute. There is no validation though that the host name in an absolute internal URL matches the website of the specified host.
internalURL - The internal WebManager URL to translate to a friendly URL.host - The host of the website to retrieve some configuration values from.
id and langid components can be
replaced by friendly variants, or else the internal URL.
FriendlyURLException - If any access to the persistent layer failed.
FriendlyURLEntity getFriendlyURLEntity(PageVersion pageVersion)
throws FriendlyURLException
pageVersion - Return the friendly URL of this page version.
FriendlyURLException - If any access to the persistent layer failed.
FriendlyURLEntity getFriendlyURLEntity(MediaItemVersion mediaItemVersion)
throws FriendlyURLException
mediaItemVersion - Return the friendly URL of this media item version.
FriendlyURLException - If any access to the persistent layer failed.
FriendlyURLEntity getFriendlyURLEntity(ResourceInstance resourceInstance)
throws FriendlyURLException
resourceInstance - Return the friendly URL of this resource instance.
FriendlyURLException - If any access to the persistent layer failed.
java.lang.String getFriendlyURL(PageVersion pageVersion)
throws FriendlyURLException
Assuming default settings /web as prefix and .htm as extension a second level
page titled 'Today', with parent page named 'News' will result in the friendly URL:
/web/News/Today.htm.
pageVersion - Get the friendly URL for this page version.
FriendlyURLException - If any access to the persistent layer failed.
java.lang.String getFriendlyURL(PageVersion pageVersion,
MediaItemVersion mediaItemVersion)
throws FriendlyURLException
Assuming default settings /web as prefix and .htm as extension a second level
page titled 'Today', with parent page named 'News' and a media item version titled 'Booming Economy'.
will result in the friendly URL: /web/News/Today/BoomingEconomy.htm.
pageVersion - The friendly URL consists of a path of pages till this page version.mediaItemVersion - Get the friendly URL for this media item version.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String getFriendlyURL(ResourceInstance resourceInstance)
throws FriendlyURLException
getFriendlyURL(PageVersion, ResourceInstance) instead.
resourceInstance - Get the friendly URL for this resource instance.
FriendlyURLException - If any access to the persistent layer failed.
java.lang.String getFriendlyURL(PageVersion pageVersion,
ResourceInstance resourceInstance)
throws FriendlyURLException
Assuming default settings /web as prefix and .htm as extension a second level
page titled 'Netherlands', with parent page named 'Competitions' and a resource instance titled 'Ajax'.
will result in the friendly URL: /web/Competitions/Netherlands/Ajax.htm.
pageVersion - The friendly URL consists of a path of pages till this page version.resourceInstance - Get the friendly URL for this resource instance shown on the given page
version.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String getFriendlyURL(MediaItemVersion mediaItemVersion,
Website website)
throws FriendlyURLException
getFriendlyURL(PageVersion, MediaItemVersion) instead.
mediaItemVersion - Get the friendly URL for this media item version.website - Use friendly URL configuration values from this website.
FriendlyURLException - If any access to the persistent layer failed.java.lang.String getPageTitle(PageVersion pageVersion)
website_settings.friendly_url_setting. This key
can be one of title, navigationtitle or urltitle. If left empty
then the default is navigationtitle.
urltitle is used then PageVersion.getFriendlyURLTitle() is used as input
navigationtitle is used, then retrieve input from
PageVersion.getNavigationTitle()
title is used, then retrieve input from
PageVersion.getTitle()
pageVersion - Get the page title from this page version.
@Deprecated
java.lang.String getPageFriendlyURL(int pageVersionId,
java.lang.String host)
throws FriendlyURLException
getFriendlyURL(PageVersion) instead.
pageVersionId - Get the friendly URL for this page version id.host - The host for which the page version id is valid.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String getMediaItemFriendlyURL(int mediaItemVersionId,
java.lang.String host)
throws FriendlyURLException
getFriendlyURL(MediaItemVersion, Website) instead.
mediaItemVersionId - Get the friendly URL for this media item version id.host - The host for which the media item version id is valid.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String getDBPageFriendlyURL(int dbId,
int typeOfPageId,
java.lang.String host)
throws FriendlyURLException
getFriendlyURL(ResourceInstance) instead.
dbId - Get the friendly URL for this db id and the type of page id.typeOfPageId - Get the friendly URL for this type of page id and the db id.host - The host for which the db id and type of page id are valid.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String getMediaItemBaseEntityURLTitle(int mediaItemVersionId)
throws FriendlyURLException
FriendlyURLEntity.getBaseURLTitleEntityIdentifier() which can be retrieved
through getFriendlyURLEntity(MediaItemVersion).
mediaItemVersionId - Get the base entity URL title for this media item version id.
FriendlyURLException - If any access to the persistent layer failed.
@Deprecated
java.lang.String translateTitleToFriendlyURL(java.lang.String title,
java.lang.String host)
throws FriendlyURLException
getFriendlyURL(PageVersion).
title - Translate this title to a friendly URL.host - Translate the title given the configuration for this host.
FriendlyURLException - If any access to the persistent layer failed.@Deprecated java.lang.String translateTitleToURLTitle(java.lang.String title)
getFriendlyURL(PageVersion) and
FriendlyURLEntity.getURLTitle().
title - Translate this title to an URL title.
@Deprecated java.lang.String translateTitleToURLIdentifier(java.lang.String title)
getFriendlyURL(PageVersion) and
FriendlyURLEntity.getURLIdentifier().
title - Translate this title to an URL identifier.
@Deprecated
void deleteFriendlyURL(int id)
throws FriendlyURLException
deleteFriendlyURL(Page),
deleteFriendlyURL(PageVersion), deleteFriendlyURL(MediaItem) and
deleteFriendlyURL(ResourceInstance).
id - Delete the friendly URL entity with this id.
FriendlyURLException - If any access to the persistent layer failed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||