This section describes how to create, edit, and delete templates. There are also procedures for changing a template’s status.
You can also create templates on the fly when you create
and edit aggregated applications. Do not create templates in this
way when you create secure applications—you may receive
a JavaScript error. See Chapter 3, “Developing Applications,” for details.
Creating a template
Select Build | Templates from the Mobile Web Studio left pane.
Click New on the Template Manager toolbar to launch the Template Upload window.
Click the down arrow next to Wizard to select from the list of templates.
Complete these fields:
Name – enter a name for the new template. For example, you might want to name a template “2-4 Basic” for an application with two columns and four elements.
Roles – assign the appropriate roles to the template. When you assign a role to a template, all users assigned that role can access the template in Mobile Web Studio.
Once you add an application to a page, the roles assigned
to the page and applications supersede the roles assigned to the
underlying template. A template’s roles pertain only to
roles that can access templates in Mobile Web Studio.
Type – select from HTML, HELP, JSP, or XSL.
Status – select the template’s status. You can only add applications and elements to approved templates.
Code – enter the code that defines this template. Templates are stripped of header tags, so include only the content that normally resides between the opening <BODY> tag and closing </BODY> tag.
If this is an HTML or HELP template, click Preview to see the template preview in a separate window.
Click Save to save the new template definition.
Click OK in the confirmation popup window.
Click Close to exit the window.
Editing a template
In the Template Manager, select the status of the template you want to modify.
Double-click the template listing in the detail view to open the Template Editor window.
Change the Status, Type, Assigned Roles, or Code, and activate or deactivate the template.
When you are satisfied with your changes, click Preview to review your modifications if this is an HTML or HELP template.
Click Save to save your changes under the same name, or click Save As to save the template under a different name.
Click Close to exit the Template Editor.
Changing workflow status
If you are using the Mobile Web Studio’s workflow feature, you can change a template’s approval status as it moves through the workflow process.
Right-click a template in the Template Manager’s detail view, select Approval Status from the pop-up Template Menu, then select the appropriate status; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select a new status from the Status drop-down list in the Template Editor window, then click Save.
Changing a template’s active status
You cannot add an application to a template unless the template is approved and active.
Right-click a template in the Template Manager’s detail view, select Active Status from the pop-up Template Menu, then select the appropriate status; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select or deselect Active, then click Save.
Deleting a template
When you delete a template, it remains in the database, and displays in the detail view with a status of “Deleted.” To mark a template as deleted:
Right-click a template in the Template Manager’s detail view, select Approval Status from the pop-up Template Menu, then select Deleted; or
Select a template in the Template Manager’s detail view, click Edit on the toolbar, select Deleted from the Status drop-down list box in the Template Editor window, then click Save.
To change a template’s deleted status, select Deleted from the Template Manager’s Status menu, right-click the template in the detail view, select Approval Status, then select a new status.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |