Package com.jalios.jcms
Class WeakLinkManager
java.lang.Object
com.jalios.jcms.BasicStoreListener
com.jalios.jcms.WeakLinkManager
- All Implemented Interfaces:
PluginComponent,StoreListener
This class manages the index of weak references on publications.
A weak reference is either a wiki link (e.g. [[Title]]) or the
URL of a publication (display.jsp?id=xxx).
The index is managed through a map (pub, set of referrer).
- Since:
- jcms-5.5.0
- Author:
- Olivier Dedieu
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve all publication referenced in the specified HTML/JHTML.Returns the set of publication weakly referenced by the given publication.static WeakLinkManagerReturns the map of urls referenced by publications.Returns the map of urls referenced by publications of the given workspace.getUrlReferrerSet(String url) Returns all the publications referring the given URL.voidhandleCommitUpdate(Storable storable, Storable oldStorable, boolean firstTime) This method gets called when after a storable has been updated.voidhandleCreate(Storable storable, boolean firstTime) This method gets called when a storable is created.voidhandleDelete(Storable storable, boolean firstTime) This method gets called when a storable is deleted.voidindexPublication(Publication referrer) Indexes the given publication.voidinit()Scans and indexes all existing publications then register a StoreListener (myself) to update the index at each change.voidreindexPublication(Publication referrer) Reindexes the given publication.voidunindexPublication(Publication referrer) Unindexes the given publication.Methods inherited from class com.jalios.jcms.BasicStoreListener
handlePrepareUpdate, init
-
Method Details
-
getInstance
-
init
public void init()Scans and indexes all existing publications then register a StoreListener (myself) to update the index at each change.- Since:
- jcms-5.5.0
-
indexPublication
Indexes the given publication.- Parameters:
referrer- the publication to be indexed.- Since:
- jcms-5.5.0
-
unindexPublication
Unindexes the given publication.- Parameters:
referrer- the publication to be unindexed.- Since:
- jcms-5.5.0
-
reindexPublication
Reindexes the given publication.- Parameters:
referrer- the publication to be reindexed.- Since:
- jcms-5.5.0
-
getUrlReferrerSet
Returns all the publications referring the given URL. CAUTION: DO NOT alter the returned set, clone prior modification..- Parameters:
url- the referee URL- Returns:
- all the publications referring the given URL.
- Since:
- jcms-5.5.0
-
getUrlMap
Returns the map of urls referenced by publications. CAUTION: DO NOT alter the returned set, clone prior modification..- Returns:
- the map of urls referenced by publications.
- Since:
- jcms-5.5.0
-
getUrlMap
Returns the map of urls referenced by publications of the given workspace.- Parameters:
ws- the workspacembr- the member used for filtering- Returns:
- the map of urls referenced by publications.
- Since:
- jcms-5.5.0
-
extractWeakLinkSet
Returns the set of publication weakly referenced by the given publication.- Parameters:
pub- the publication- Returns:
- the set of publication weakly referring the given publication.
- Since:
- jcms-5.5.0
-
handleCreate
Description copied from interface:StoreListenerThis method gets called when a storable is created.- Specified by:
handleCreatein interfaceStoreListener- Overrides:
handleCreatein classBasicStoreListener- Parameters:
storable- the storablefirstTime- true if it is the first time this operation is processed- See Also:
-
handleCommitUpdate
Description copied from interface:StoreListenerThis method gets called when after a storable has been updated.- Specified by:
handleCommitUpdatein interfaceStoreListener- Overrides:
handleCommitUpdatein classBasicStoreListener- Parameters:
storable- the storable, this instance is the object that was created at first and that will be stored in jcms until deletion of the storable with this ID. You should always manipulate this object if you maintain any index.oldStorable- the previous version of the storable, it is a clone, do not use in any index, it should only be used to access old values.firstTime- true if it is the first time this operation is processed- See Also:
-
handleDelete
Description copied from interface:StoreListenerThis method gets called when a storable is deleted.- Specified by:
handleDeletein interfaceStoreListener- Overrides:
handleDeletein classBasicStoreListener- Parameters:
storable- the storablefirstTime- true if it is the first time this operation is processed- See Also:
-
extractPubSetFromWysiwyg
Retrieve all publication referenced in the specified HTML/JHTML.- Parameters:
html- the HTML to inspect- Returns:
- a set of Publication, never returns null
-