Template libraries are custom project templates that specify how a project should look and what it should contain. When you create a custom template library, it is placed in the New Files dialog box where is accessible for creating a project using FileNew.
You can create template library projects from scratch, or you can use projects previously created by you or other developers as the basis for template libraries. To use an existing project, you simply create an XML file with the extension .bdstemplatelib which describes the project and is used to create the template library using that project.
<TemplateLibrary Version="1.0" id=""> <Name><Name/> <Description><Description/> <Items> <Item id="" Creator=""> <Name>Name of template library here <Name/> <Description>Custom Project Template<Description/> <Author><Author/> <Icon>MyTemplate\MyTemplateIcon.ico<Icon/> <Projectfile>MyTemplate.dproj</Projectfile> <DefaultProjectName>MyTemplate<DefaultProjectName/> <FilePath>MyTemplate<FilePath/> </Item> </Items> </TemplateLibrary>
Important:
Project Type |
Item Creator Attribute Value |
C++ Projects |
Creator="CBuilderProjectRepositoryCreator" |
Delphi Projects |
Creator="DelphiProjectRepositoryCreator" |
Example
<TemplateLibrary Version="1.0" id="CompanyXYZASPWebSiteProject"> <Name>WebSiteProject<Name/> <Description>WebSite Project Template<Description/> <Items> <Item id="WebSiteProject" Creator="AspDelphiProjectRepositoryCreator"> <Name>WebSite Project<Name/> <Description>WebSite<Description/> <Author>John Smith<Author/> <Icon>WebsiteProject\WebsiteProjectIcon.ico<Icon/> <Projectfile>WebSiteProject.dproj</Projectfile> <DefaultProjectName>WebSiteProject<DefaultProjectName/> <FilePath>WebSiteProject<FilePath/> </Item> </Items> </TemplateLibrary>
If you have several related projects, you can use a single .bdstemplatelib template library file to list all the projects.
<TemplateLibrary Version="1.0" id="CodeGearWebSiteProject"> <Name>WebSiteProject<Name/> <Description>WebSite Project Template<Description/> <Items> <Item id="WebSiteProject" Creator="AspDelphiProjectRepositoryCreator"> <Name>WebSite Project<Name/> <Description> WebSite Project<Description/> <Author>CodeGear<Author/> <Icon>WebsiteProject\WebsiteProjectIcon.ico<Icon/> <Projectfile>WebSiteProject.dproj</Projectfile> <DefaultProjectName>WebSiteProject<DefaultProjectName/> <FilePath>WebSiteProject<FilePath/> </Item> <Item id="WebSiteProjectMP" Creator="DelphiProjectRepositoryCreator"> <Name>WebSite Project Master Page<Name/> <Description>WebSite Project Master Page<Description/> <Author>CodeGear<Author/> <Icon>WebsiteProjectMP\WebsiteProjectMPIcon.ico<Icon/> <Projectfile>WebSiteProjectMP.dproj</Projectfile> <DefaultProjectName>WebSiteProjectMP<DefaultProjectName/> <FilePath>WebSiteProjectMP<FilePath/> </Item> <Item id="WebSiteProjectForm" Creator="DelphiProjectRepositoryCreator"> <Name>WebSite Project Information Form<Name/> <Description>WebSite Information Form<Description/> <Author>CodeGear<Author/> <Icon>WebsiteProjectForm\WebsiteProjectFormIcon.ico<Icon/> <Projectfile>WebSiteProjectForm.dproj</Projectfile> <DefaultProjectName>WebSiteProjectForm<DefaultProjectName/> <FilePath>WebSiteProjectForm<FilePath/> </Item> </Items> </TemplateLibrary>
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|