IWorkspaceTemplate Interface

com.bea.ide.workspace
IWorkspaceTemplate Interface

public interface IWorkspaceTemplate

Represents a set of static or dynamic content to be inserted into a new or existing application. An IWorkspaceTemplate corresponds to an element found in the template.xml file of a template zip file located in the workshop templates directory.

Normally, a template will define a set of content elements (archives, files) from the template zip that are to be copied to particular locations in the application. Application templates may contain any number of these content elements, however these content members may only be used to add application-level data - libaries, and J2EE modules. Project-level content should be specified using a project template. See IProjectTemplate. Project templates used by an application template may be externally defined and referenced, or they may be defined inside the application template xml. Project templates defined inside the application template xml will not have display information and will only used when invoking the application template.

Workshop provides a default template processor which can handle processing a list of file or archive content elements, as well as invoking project templates. Alternatively, an application template may specify use of a custom template processor class located in an extension jar. A custom processor implementation can then make full use of the extension API, examine and update configuration files, query the user for input, and control how content is added to the application when the template is invoked.

Application templates may be displayed in the New Application Dialog, or in the application tree root context menu under Install. They may also be extended by other application templates and referenced by application templates.

Nested Class Summary

public static interfaceIWorkspaceTemplate.ITemplateContent
           Represents content data to be used for populating an application.
public static interfaceIWorkspaceTemplate.ITemplateDisplay
           Information to use when displaying a workspace template.

Field Summary

public static final String
CONTEXT_MENU_ID
Id for display in the application context menu
public static final String
NEW_DIALOG_ID
Id for display in the New Application Dialog
 

Method Summary

public IWorkspaceTemplateProcessor
createProcessor(IWorkspace workspace)
Creates a template processor which may be used to apply this template to a given IWorkspace.
public IWorkspaceTemplate.ITemplateContent[]
getContents()
Array of content elements to use when populating a workspace with this template.
public IWorkspaceTemplate.ITemplateDisplay
getDisplay(String id)
Gets the display information for the given display id.
public String
getId()
Id string for the template.

Field Detail

CONTEXT_MENU_ID

public static final String CONTEXT_MENU_ID
Id for display in the application context menu


NEW_DIALOG_ID

public static final String NEW_DIALOG_ID
Id for display in the New Application Dialog

 

Method Detail

createProcessor(IWorkspace) Method

public IWorkspaceTemplateProcessor createProcessor(IWorkspace workspace)
Creates a template processor which may be used to apply this template to a given IWorkspace.

If an IWorkspaceTemplateProcessor class has been declared in the template xml, an instance of that class will be created. Otherwise a default processor implementation will be used. See IWorkspaceTemplateProcessor for default processor behavior.

Parameters

workspace
IWorkspace which will form the context for the template processor.

Returns

IWorkspaceTemplateProcessor.

getContents() Method

public IWorkspaceTemplate.ITemplateContent[] getContents()
Array of content elements to use when populating a workspace with this template.

Returns

array of ITemplateContent.

getDisplay(String) Method

public IWorkspaceTemplate.ITemplateDisplay getDisplay(String id)
Gets the display information for the given display id. Places where a workspace template may be displayed include the New Application Dialog and the context menu of the root node in the application tree.

Parameters

id
String identifier for a display location, e.g. NEW_DIALOG_ID, CONTEXT_MENU_ID.

Returns

ITemplateDisplay will be null if this template is not intended to be displayed in the given location.

getId() Method

public String getId()
Id string for the template. Will be unique among all application templates in a template zip file.

Returns

string representing the template id.