|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pepper.platform.page.PepperPage
com.pepper.platform.page.SectionPage
public class SectionPage
This class represents a Section TOC Page
Nested Class Summary | |
---|---|
static class |
SectionPage.PackageInfo
The object encapsulates info the package xml element as well as it's section id |
Field Summary | |
---|---|
static String |
DESC_EL
|
static int |
MAX_HISTORY_DAYS
|
static int |
MAX_SESSION_ENTRIES
|
static String |
NAME_EL
|
static String |
SESSION_ENTRY_EL
|
static String |
SESSION_HISTORY_EL
|
static String |
SESSION_HOST_EL
|
static String |
TITLE_EL
|
static String |
URL_EL
|
Fields inherited from class com.pepper.platform.page.PepperPage |
---|
log |
Constructor Summary | |
---|---|
SectionPage(String id,
String packageId)
Creates a new SectionPage instance. |
Method Summary | |
---|---|
void |
addPage(Page page,
com.pepper.platform.page.PageService pageService)
Adds a new Page element to this section page. |
boolean |
addSessionEntry(String url,
String title,
String description)
Add a new sessionEntry to the WebSession page |
boolean |
containsPackages()
Returns true if this section contains any packages |
boolean |
containsPages()
Returns true if this section contains any pages |
int |
findElementPosition(List theChildren,
int startPos,
String elementName,
String attrName,
String attrValue)
Find the element position in the list of children |
List |
findFiles(String[] pageIds,
String elementName)
Return a list of Files contained in the list of pageIds passed in with the specified elementName |
protected static void |
findPackages(List packages,
String sectionId,
String thePackageId,
String thePackageType,
List results)
Finds packages and adds PackageInfo objects for found packages that meet the specified criteria to the passed in results list |
List |
findPackages(String thePackageId,
String thePackageType)
Returns a list of PackageInfo objects for found packages that meet the specified criteria. |
List |
getHomepageList()
Get list of page ids where homepage attribute is set to true |
static String |
getPackageId(org.jdom.Element packageEl)
Get the packageId out of the package element. |
List |
getPageList()
get a list of the child page elements on the section page |
int |
getPositionAndName(String id,
StringBuffer name)
Get relative position and name of page or package element by ID. |
void |
moveElement(String elementName,
String attrName,
String attrValue,
boolean moveUp)
Move the specified element either up or down one position relative to it's parent |
void |
moveElement(String elementName,
String attrName,
String attrValue,
int index)
Move the specified element either up or down one position relative to it's parent |
boolean |
remove(String elementName,
String id,
boolean createMoveTombstone)
Removes the specified element from this section page. |
boolean |
remove(String elementName,
String id,
boolean makeTombstone,
boolean createMoveTombstone)
Removes the specified element from this section page. |
void |
remove(String elementName,
String childName,
String childValue)
Remove the element whose specified child value matches the passed in child value. |
void |
removeAllSessions()
Remove all web session (history) entries |
void |
removePage(Page page,
boolean createMoveTombstone)
Removes the specified element from this section page. |
void |
removePage(Page page,
boolean makeTombstone,
boolean createMoveTombstone)
Removes the specified element from this section page, optionally makes a tombstone |
void |
removeSessionDate(String dateId)
Describe removeSessionDate method here. |
void |
removeSessionEntry(String id,
String sessionDate,
String sessionHost)
Describe removeSessionEntry method here. |
void |
removeSessionHost(String hostId,
String sessionDate)
Remove the |
boolean |
reorderPackage(String pageId,
int newPosition)
reorderPackage |
boolean |
reorderPage(String pageId,
int newPosition)
reorderPage |
boolean |
reorderPagePackageElement(String elementName,
String attrName,
String attrValue,
int newPosition)
This method will reorder a |
void |
save()
Saves this section page. |
void |
setPackageAttr(String thePackageId,
String attrName,
String attrValue)
Find the specified package in the section and set the attribute on it |
boolean |
updateSessionEntry(String url,
String title)
Update the title of a webSession |
Methods inherited from class com.pepper.platform.page.PepperPage |
---|
exists, getBackup, getBaseDir, getCreateDate, getDefaultType, getForceAutoSave, getId, getLastSaveTime, getName, getNoCache, getPackageName, getPackageVersion, getPageData, getProcessBody, getRootAttrValue, getSupportedPageTypes, getTemplate, getType, isAutoSaveEnabled, isDeletable, isHidden, isLoaded, isPageTypeSupported, isReadOnly, isSecure, load, setAutoSaveEnabled, setBackup, setBaseDir, setClassLoader, setDefaultType, setDeletable, setForceAutoSave, setHidden, setId, setLastSaveTime, setName, setNoCache, setPackageName, setPackageVersion, setPageData, setProcessBody, setReadOnly, setSecure, setSupportedPageTypes, setTemplate, setTemplateOverride, setType, toString, unload |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_SESSION_ENTRIES
public static final int MAX_HISTORY_DAYS
public static final String SESSION_HISTORY_EL
public static final String SESSION_ENTRY_EL
public static final String SESSION_HOST_EL
public static final String NAME_EL
public static final String URL_EL
public static final String TITLE_EL
public static final String DESC_EL
Constructor Detail |
---|
public SectionPage(String id, String packageId)
SectionPage
instance.
id
- a String
value representing
the id of the SectionPage
.Method Detail |
---|
public void addPage(Page page, com.pepper.platform.page.PageService pageService) throws Exception
Page
element to this section page.
page
- the Page
to be added to this section.pageService
- PageService
used to look up cache rules.
Exception
- if the current instance (ie. this) of
SectionPage
cannot be loaded
in order to add the specified page.public boolean remove(String elementName, String id, boolean createMoveTombstone) throws Exception
elementName
- a String
containing the element name to
be removed.id
- a String
containing the id of the element to
be removed.createMoveTombstone
- If true
, creates a pageMoved
tombstone instead of a pageRemoved
tombstone when deleting
the reference to the page.
Exception
- if the current instance (ie. this) of
SectionPage
cannot be loaded
in order to remove the specified page.public boolean remove(String elementName, String id, boolean makeTombstone, boolean createMoveTombstone) throws Exception
elementName
- a String
containing the element name to
be removed.id
- a String
containing the id of the element to
be removed.makeTombstone
- If true
then make a tombstone for this elementcreateMoveTombstone
- If true
, creates a pageMoved
tombstone instead of a pageRemoved
tombstone when deleting
the reference to the page.
Exception
- if the current instance (ie. this) of
SectionPage
cannot be loaded
in order to remove the specified page.public void remove(String elementName, String childName, String childValue) throws Exception
elementName
- Element to removechildName
- Name of child to attempt to matchchildValue
- Value of child to match
Exception
- if an error occurspublic void moveElement(String elementName, String attrName, String attrValue, boolean moveUp) throws Exception
elementName
- The name of the element to moveattrName
- The attribute name to matchattrValue
- The attribute value to matchmoveUp
- true to move the element up one position in the list,
false to move it down in the list
Exception
- if an error occurspublic void moveElement(String elementName, String attrName, String attrValue, int index) throws Exception
elementName
- The name of the element to moveattrName
- The attribute name to matchattrValue
- The attribute value to matchindex
- The order to put it in
Exception
- if an error occurspublic boolean reorderPagePackageElement(String elementName, String attrName, String attrValue, int newPosition) throws Exception
elementName
- a String
valueattrName
- a String
valueattrValue
- a String
valuenewPosition
- an int
value
Exception
- if an error occurspublic int findElementPosition(List theChildren, int startPos, String elementName, String attrName, String attrValue)
theChildren
- a List
valuestartPos
- an int
valueelementName
- a String
valueattrName
- a String
valueattrValue
- a String
value
public int getPositionAndName(String id, StringBuffer name)
id
- a String
page or package ID valuename
- a StringBuffer
return element name ("page" or "program", etc.)
int
return element position (0 - n-1, -1 if not found)public void removePage(Page page, boolean createMoveTombstone) throws Exception
page
- the Page
to be removed from this section page.createMoveTombstone
- If true
, creates a pageMoved
tombstone instead of a pageRemoved
tombstone when deleting
the reference to the page.
Exception
- if the current instance (ie. this) of
SectionPage
cannot be loaded
in order to add remove the specified page.public void removePage(Page page, boolean makeTombstone, boolean createMoveTombstone) throws Exception
page
- the Page
to be removed from this section page.makeTombstone
- true to make a tombstonecreateMoveTombstone
- If true
, creates a pageMoved
tombstone instead of a pageRemoved
tombstone when deleting
the reference to the page.
Exception
- if the current instance (ie. this) of
SectionPage
cannot be loaded
in order to add remove the specified page.public boolean reorderPage(String pageId, int newPosition) throws Exception
reorderPage
pageId
- a String
valuenewPosition
- an int
value
boolean
value
Exception
- if an error occurspublic boolean reorderPackage(String pageId, int newPosition) throws Exception
reorderPackage
pageId
- a String
valuenewPosition
- an int
value
boolean
value
Exception
- if an error occurspublic List getPageList()
public static String getPackageId(org.jdom.Element packageEl)
packageEl
- an Element
value
String
valuepublic void setPackageAttr(String thePackageId, String attrName, String attrValue)
thePackageId
- The packageId to findattrName
- Name of the attribute to setattrValue
- Value of the attribute to setpublic List findPackages(String thePackageId, String thePackageType)
thePackageId
- If null, all packages of specified type
(if type not null), will be returned. If not null, the
particular package will be returned.thePackageType
- The type of packages to return (i.e. "music",
"journal", etc). If null all packages will be returned or
the package with the specified packageId will be returned.
public boolean containsPackages()
boolean
valuepublic boolean containsPages()
boolean
valueprotected static void findPackages(List packages, String sectionId, String thePackageId, String thePackageType, List results)
packages
- A list of package elements to be searched
packagesthePackageId
- If null, all packages of specified type
(if type not null), will be returned. If not null, the
particular package will be returned.thePackageType
- The type of packages to return (i.e. "music",
"journal", etc). If null all packages will be returned or
the package with the specified packageId will be returned.results
- An array list that found PackageInfo objects will
be added topublic boolean addSessionEntry(String url, String title, String description)
url
- a String
valuetitle
- a String
valuedescription
- a String
value
public boolean updateSessionEntry(String url, String title)
url
- a String
valuetitle
- a String
value
public void save() throws Exception
save
in interface Page
save
in class PepperPage
Exception
- if a low-level error occurrs.Page
public List getHomepageList()
public void removeAllSessions()
public void removeSessionDate(String dateId)
removeSessionDate
method here.
dateId
- a String
valuepublic void removeSessionHost(String hostId, String sessionDate)
hostId
- a String
valuesessionDate
- a String
valuepublic void removeSessionEntry(String id, String sessionDate, String sessionHost)
removeSessionEntry
method here.
id
- a String
valuesessionDate
- a String
valuesessionHost
- a String
valuepublic List findFiles(String[] pageIds, String elementName)
pageIds
- the pageIds to search forelementName
- the name of the element that contains the relative
path name of the file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |