org.sakaiproject.component.legacy.site
Class BaseToolConfiguration

java.lang.Object
  extended byorg.sakaiproject.util.Placement
      extended byorg.sakaiproject.component.legacy.site.BaseToolConfiguration
All Implemented Interfaces:
Identifiable, Placement, Serializable, ToolConfiguration

public class BaseToolConfiguration
extends Placement
implements ToolConfiguration, Identifiable

BaseToolConfiguration is an implementation of the Site API's ToolConfiguration.

Author:
Sakai Software Development Team
See Also:
Serialized Form

Field Summary
protected  boolean m_configLazy
          True if the placement conf has not been read yet.
protected  String m_layoutHints
          The layout hints.
protected  SitePage m_page
          The SitePage I belong to.
protected  String m_pageId
          The page id I belong to, in case I have no m_page.
protected  int m_pageOrder
          The order within the page.
protected  String m_siteId
          The site id I belong to, in case I have no m_page.
protected  String m_skin
          The site skin, in case I have no m_page.
 
Fields inherited from class org.sakaiproject.util.Placement
m_config, m_context, m_id, m_title, m_tool
 
Constructor Summary
protected BaseToolConfiguration(Element el, SitePage page)
          Construct from XML element.
protected BaseToolConfiguration(SitePage page)
          Construct using a tool registration for default information.
protected BaseToolConfiguration(SitePage page, String id, String toolId, String title, String layoutHints, int pageOrder)
          ReConstruct
protected BaseToolConfiguration(String id, String toolId, String title, String layoutHints, String pageId, String siteId, String skin, int pageOrder)
          ReConstruct - if we don't have a page to follow up to get to certain page and site info.
protected BaseToolConfiguration(ToolConfiguration other, SitePage page, boolean exact)
          Construct as a copy of another.
protected BaseToolConfiguration(Tool reg, SitePage page)
          Construct using a tool registration for default information.
 
Method Summary
 SitePage getContainingPage()
          Access the SitePage in which this tool configuration lives.
 String getContext()
          Access the placement context.
 String getLayoutHints()
           
protected  Properties getMyConfig()
          Acces the m_config, which is inherited and not visible to this package outside this class -ggolden
 String getPageId()
          
 int getPageOrder()
          Access the tool's order in the page.
 Properties getPlacementConfig()
          Access the configuration properties for this tool placement - not including those from the tool registration.
 String getSiteId()
          
 String getSkin()
          
 void moveDown()
          Move this tool one step towards the end of the order of tools in this page.
 void moveUp()
          Move this tool one step towards the start of the order of tools in this page.
 int[] parseLayoutHints()
          If the layout hints are a row,col format, return the two numbers, else return null.
 void save()
          Save any changes to the placement.
 void setLayoutHints(String hints)
          Set the layout hints.
 Element toXml(Document doc, Stack stack)
          {@inheritDoc}
 
Methods inherited from class org.sakaiproject.util.Placement
equals, getConfig, getId, getTitle, getTool, hashCode, setContext, setId, setTitle, setTool
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.api.kernel.tool.Placement
getConfig, getId, getTitle, getTool, setTitle, setTool
 
Methods inherited from interface org.sakaiproject.component.legacy.site.Identifiable
getId
 

Field Detail

m_layoutHints

protected String m_layoutHints
The layout hints.


m_page

protected SitePage m_page
The SitePage I belong to.


m_siteId

protected String m_siteId
The site id I belong to, in case I have no m_page.


m_pageId

protected String m_pageId
The page id I belong to, in case I have no m_page.


m_skin

protected String m_skin
The site skin, in case I have no m_page.


m_configLazy

protected boolean m_configLazy
True if the placement conf has not been read yet.


m_pageOrder

protected int m_pageOrder
The order within the page.

Constructor Detail

BaseToolConfiguration

protected BaseToolConfiguration(SitePage page,
                                String id,
                                String toolId,
                                String title,
                                String layoutHints,
                                int pageOrder)
ReConstruct

Parameters:
page - The page in which this tool lives.
id - The tool (placement) id.
toolId - The id (registration code) of the tool to place here.
title - The tool title.
layoutHints - The layout hints.
pageOrder - The order within the page.

BaseToolConfiguration

protected BaseToolConfiguration(String id,
                                String toolId,
                                String title,
                                String layoutHints,
                                String pageId,
                                String siteId,
                                String skin,
                                int pageOrder)
ReConstruct - if we don't have a page to follow up to get to certain page and site info.

Parameters:
id - The tool (placement) id.
toolId - The id (registration code) of the tool to place here.
title - The tool title.
layoutHints - The layout hints.
pageId - The page id in which this tool lives.
siteId - The site id in which this tool lives.
skin - The site's skin.
pageOrder - The order within the page.

BaseToolConfiguration

protected BaseToolConfiguration(ToolConfiguration other,
                                SitePage page,
                                boolean exact)
Construct as a copy of another.

Parameters:
other - The other to copy.
page - The page in which this tool lives.
exact - If true, we copy ids - else we generate a new one.

BaseToolConfiguration

protected BaseToolConfiguration(SitePage page)
Construct using a tool registration for default information.

Parameters:
page - The page in which this tool lives.

BaseToolConfiguration

protected BaseToolConfiguration(Tool reg,
                                SitePage page)
Construct using a tool registration for default information.

Parameters:
reg - The tool registration.
page - The page in which this tool lives.

BaseToolConfiguration

protected BaseToolConfiguration(Element el,
                                SitePage page)
Construct from XML element.

Parameters:
el - The XML element.
page - The page in which this tool lives.
Method Detail

getPlacementConfig

public Properties getPlacementConfig()
Access the configuration properties for this tool placement - not including those from the tool registration.

Specified by:
getPlacementConfig in interface Placement
Overrides:
getPlacementConfig in class Placement

getMyConfig

protected Properties getMyConfig()
Acces the m_config, which is inherited and not visible to this package outside this class -ggolden


getLayoutHints

public String getLayoutHints()
Specified by:
getLayoutHints in interface ToolConfiguration
Returns:
the layout hints for this tool.

parseLayoutHints

public int[] parseLayoutHints()
Description copied from interface: ToolConfiguration
If the layout hints are a row,col format, return the two numbers, else return null.

Specified by:
parseLayoutHints in interface ToolConfiguration

getPageOrder

public int getPageOrder()
Access the tool's order in the page.

Specified by:
getPageOrder in interface ToolConfiguration
Returns:
the tool's order in the page.

getSkin

public String getSkin()

Specified by:
getSkin in interface ToolConfiguration
Returns:
the skin to use for this tool.

getPageId

public String getPageId()

Specified by:
getPageId in interface ToolConfiguration
Returns:
the page id for this tool.

getSiteId

public String getSiteId()

Specified by:
getSiteId in interface ToolConfiguration
Returns:
the site id for this tool.

getContext

public String getContext()
Access the placement context.

Specified by:
getContext in interface Placement
Overrides:
getContext in class Placement

setLayoutHints

public void setLayoutHints(String hints)
Set the layout hints.

Specified by:
setLayoutHints in interface ToolConfiguration
Parameters:
hints - The layout hints.

moveUp

public void moveUp()
Move this tool one step towards the start of the order of tools in this page.

Specified by:
moveUp in interface ToolConfiguration

moveDown

public void moveDown()
Move this tool one step towards the end of the order of tools in this page.

Specified by:
moveDown in interface ToolConfiguration

getContainingPage

public SitePage getContainingPage()
Access the SitePage in which this tool configuration lives.

Specified by:
getContainingPage in interface ToolConfiguration
Returns:
the SitePage in which this tool configuration lives.

toXml

public Element toXml(Document doc,
                     Stack stack)
{@inheritDoc}


save

public void save()
Save any changes to the placement.

Specified by:
save in interface Placement
Overrides:
save in class Placement