com.opencms.workplace
Class CmsHelperMastertemplates

java.lang.Object
  |
  +--com.opencms.workplace.CmsHelperMastertemplates

public class CmsHelperMastertemplates
extends Object

Helper class to receive all mastertemplates that are currently in the system.

Version:
$Revision: 1.10 $ $Date: 2003/01/20 23:59:20 $

Constructor Summary
CmsHelperMastertemplates()
           
 
Method Summary
static boolean checkVisible(CmsObject cms, CmsResource res)
          Check if this template should be displayed in the selectbox (this is only true if the visible flag is set for the current user or if he is admin).
static void getTemplateElements(CmsObject cms, String subFolder, Vector names, Vector values)
          Gets the templates displayed in the template select box.
static Integer getTemplates(CmsObject cms, Vector names, Vector values, String currentTemplate)
          Gets the templates displayed in the template select box.
static Integer getTemplates(CmsObject cms, Vector names, Vector values, String currentTemplate, int defaultReturnValue)
          Gets the templates displayed in the template select box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsHelperMastertemplates

public CmsHelperMastertemplates()
Method Detail

getTemplates

public static Integer getTemplates(CmsObject cms,
                                   Vector names,
                                   Vector values,
                                   String currentTemplate)
                            throws CmsException
Gets the templates displayed in the template select box.

Parameters:
cms - The CmsObject.
names - Will be filled with the display names of found the templates.
values - Will be filled with the file names of the found templates.
currentTemplate - The file name of the currently selected template.
Returns:
The index of the currently selected template and the vectors names and values, filled with the information about the available templates. The index refers to the vectors.
Throws:
Throws - CmsException if something goes wrong.
CmsException

getTemplates

public static Integer getTemplates(CmsObject cms,
                                   Vector names,
                                   Vector values,
                                   String currentTemplate,
                                   int defaultReturnValue)
                            throws CmsException
Gets the templates displayed in the template select box.

Parameters:
cms - The CmsObject.
names - Will be filled with the display names of found the templates.
values - Will be filled with the file names of the found templates.
currentTemplate - The file name of the currently selected template.
defaultReturnValue - The index used if no currentTemplate was found.
Returns:
The index of the currently selected template and the vectors names and values, filled with the information about the available templates. The index refers to the vectors.
Throws:
Throws - CmsException if something goes wrong.
CmsException

getTemplateElements

public static void getTemplateElements(CmsObject cms,
                                       String subFolder,
                                       Vector names,
                                       Vector values)
                                throws CmsException
Gets the templates displayed in the template select box.

Parameters:
cms - The CmsObject.
subFolder - The sub folder name in the modules to look for information.
names - Will be filled with the display names of found the templates.
values - Will be filled with the file names of the found templates.
Throws:
Throws - CmsException if something goes wrong.
CmsException

checkVisible

public static boolean checkVisible(CmsObject cms,
                                   CmsResource res)
                            throws CmsException
Check if this template should be displayed in the selectbox (this is only true if the visible flag is set for the current user or if he is admin).

Parameters:
cms - The CmsObject
res - The resource to be checked.
Returns:
True or false.
Throws:
CmsException - if something goes wrong.