ca scm r12 development outreach · ca scm r12 development outreach form customization and ......

41
CA SCM r12 Development Outreach Form Customization and Advanced Usage Prajval Parthasarathy Ray Kramp September 30, 2008

Upload: dangcong

Post on 19-Apr-2018

224 views

Category:

Documents


1 download

TRANSCRIPT

CA SCM r12Development Outreach

Form Customization and Advanced Usage

Prajval Parthasarathy

Ray Kramp

September 30, 2008

Agenda

> Workbench Form Editor Overview

� Demo

> New Form Template Features

� Demo

> Form Scripts

2 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

> Form Scripts

� Demo

> JavaScript Tips

> Q&A

Welcome to the Development Outreach Program

> Webcast series to increase awareness of r12

> Hear about r12 direct from development

> Help customers to upgrade to r12

> Get feedback from customers on r12> Get feedback from customers on r12

> Hosted by the Product Line Community

� https://causergroups.ca.com/join.aspx

Software Change Manager r12“Release Management with Agility”> Release Management is a traditional CA SCM strength

� Release Management is the process of modifying, packaging and

deploying applications

� Improved Security, Auditing, and Reporting

� Advanced Build Management integration with OpenMake Meister

> Increased Agility

� Increased Performance� Increased Performance

� For Developers

– New Eclipse RCP client optimized to increase productivity

– Increased concurrent development support

– Refactoring and Folder Versioning

– Optimistic synchronization with “Work Area”

� For Administrators

– Create Projects “On Demand” from templates

– Create Projects based on new/existing baselines

– Improved Forms capability

Form Editor OverviewFeatures

> Integrated Form Editor

� Fast Eclipse-based GUI

� Multiple Forms can be opened as

tabs.

� New Image & Hyperlink Fields

� Multiple Column Layout

5 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Multiple Column Layout

� Required Fields (*)

� Validation Patterns

� XML Form Templates on Server

� JavaScript scripting

� New Form Editor API

� Attachments in Explorer

Form Editor OverviewXML Form Templates

> Workbench uses XML Form Templates

� Can be generated from .HFD with FormGen.exe

� JavaScript scripting

– New Form Editor API

> XML Templates Stored on Server

6 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

> XML Templates Stored on Server

� No need to distribute form templates to individual client

machines.

� Load on server using:

– hserver –loadforms

– hformsync

Form Editor OverviewOpening Form Editor

> From Explorer or Find Form Dialog

� Right Click on Form

– Invoke Edit Form

> From Explorer

� Double Click on Form

7 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Double Click on Form

> From Packages View

� Right Click on Package

– Select View Forms

� Select a form and click Open

Form Editor OverviewSaving a Form

> Unsaved Indicator

� Modified forms with unsaved

changes are marked with “*” on

form tab.

> To Save a Form…

8 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Invoke File > Save / Save All

� Click Save Button on Toolbar

� Close Form – Will Prompt

� Close Workbench – Will Prompt

Form Attachments

> Attachments in Explorer View

� File & URL Attachments

� Double-click

– Opens File

– Opens Browser at URL

> Adding Attachment

9 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

> Adding Attachment

� Drag/drop from File System

� Right-click on Form

– Add URL Attachment

– Add Attachment from Local File

System / Remote Agent

> Drag/Drop Attachment from

Explorer to File System

Merging FormsForm Merge Tool

> Form Merge Tool

� Displayed when saving a form if the form has been modified

since it was opened in the Form Editor

� Offers the capability to merge content of conflicting fields.

10 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

Demo

r12 WorkbenchForm EditorForm Editor

New Form Template FeaturesImage Field

> XML Element <image>

� Attributes:

– url (required) � URL to image location

– href (optional) � Hyperlink URL

– span (optional) � Grid Columns<image

12 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

<image

url="http://www.ca.com/images/front/chips/unify_walkie1.jpg"

href="http://www.ca.com" span="2"/>

> Supported Image Types

� JPEG, GIF, PNG, BMP (Windows

bitmap), ICO (Windows icon).

New Form Template FeaturesHyperlink Field

> XML Element <hyperlink>

� Attributes:

– href (required) � Hyperlink URL

– label (optional) � Link Text

<hyperlink label="CA Home“ ref="http://www.ca.com"/>

13 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

<hyperlink label="CA Home“ ref="http://www.ca.com"/>

New Form Template FeaturesRich Label

> Existing XML Element <text>

� ‘value’ attribute supports HTML-like

markup<text value="&lt;p>&lt;/p>&lt;p>New &lt;b>Harvest Sigma&lt;/b>

Features&lt;/p>&lt;li>Java

CMSDK&lt;/li>&lt;li>Workspace&lt;/li>&lt;li>Server-based Form

Templates&lt;/li>&lt;p>&lt;/p>"/>

14 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Uses SWT FormText Widget

– See SWT JavaDoc for supported

markup.

http://help.eclipse.org/help32/index.jsp?topic=/org.ec

lipse.platform.doc.isv/reference/api/org/eclipse/ui/f

orms/widgets/FormText.html

New Form Template FeaturesRequired Fields

> New ‘required’ attribute

� Optional for all <text-field> elements

<text-field cols="18" dbfield="mrcomponentname"

id="mrcomponentname" label="Component"

maxsize="30" required="true"/>

� Required attributes are marked with

15 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Required attributes are marked with

“*” indicator.

� Form Editor will report Missing

Required Data if required fields are

not supplied when attempting to save

form.

– User must return to form, enter all

required fields, then attempt to save

again.

New Form Template FeaturesField Validation Patterns

> New ‘pattern’ attribute

� Optional for all <text-field> elements

� Defines validation pattern as standard regular expression.

<text-field cols="18" dbfield="mrdepartment" id="mrdepartment" label="Department# (nnn)"

maxsize="30" pattern="\d\d\d" patternmessage="Three Digits Required"/>

� May also define ‘patternmessage’ attribute to explain pattern in

16 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� May also define ‘patternmessage’ attribute to explain pattern in

readable text.

New Form Template FeaturesField Validation Patterns

> Example Patterns

Pattern Possible Matching Text Usage

\d{3}-\d{2}-\d{4} 123-45-6789 Social security number

1234-1234-1234-1234

17 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

\d{4}-\d{4}-\d{4}-\d{4}|\d{16}

1234-1234-1234-1234

-or-

1234123412341234

Credit card number

D\d{3},\d{3} D\d{6} D\d{6}D339,456 D321987

D000152US Design Patent Number

> Regular Expression Usage

� http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

New Form Template FeaturesMultiple Columns

> New ‘columns’ Attribute

� Optional attribute for<tabpanel> and <harvest_form>

� Pages not defining ‘columns’ will default to one column.

> New ‘span’ Attribute

� Optional attribute for all field elements.

18 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

� Optional attribute for all field elements.

� Fields not defining ‘span’ will default to spanning one

column.

New Form Template FeaturesMultiple Columns

> Form Grid

19 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

New Form Template FeaturesMultiple Columns

> Multiple Column Layout Example

<tabpanel id="1" label="Origination" columns="2">

<image … span="2"/>

<text value … span="2">

<date-field … label="Date reported"/>

<dbcombobox … label="Reported By"/>

<combobox … label="Category" maxsize="11" rows="1">

20 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

<combobox … label="Category" maxsize="11" rows="1">

…</combobox>

<text-field … label="SS# (nnn-nn-nnnn)" …/>

<text-field … label="Component" …/>

<text-field … label="Department# (nnn)" …/>

<text value= …>

<image …>

<hyperlink label="CA Home" … span="2">

</tabpanel>

New Form Template FeaturesHarweb URL

> For users needing Web-based forms, an alternative

harweburl can be specified in a form template:

� harweburl is an optional attribute of <harvest_form>

� Form templates with a defined harweburl will be

opened within Workbench, in an embedded Web

Browser.

21 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

Browser.

– Similar to 7.1 Harvest Plug-in for Eclipse

� When using harweburl, no need to specify any other

XML template elements

<harvest_form dbtable="testform1" id="testform1"

name="TestForm1"

harweburl="http://harwebserver/harweb"/>

Demo

New Form Template Template Features

Form ScriptsJavaScript

> JavaScript replaces VBScript

� Multiple platform support

> New Form Editor Java API

� Surfaced to JavaScript Environment

� Interaction with Form Editor GUI

– get/set field values

– set focus to field, etc.

23 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

– set focus to field, etc.

� Read-only access to many CMSDK Objects

� JavaDoc Documentation

> Mozilla Rhino

� Embedded JavaScript Interpreter

� LiveConnect

– Allows JavaScript to interact with Java

Form ScriptsForm Editor API

> JavaScript Form API Documentation

� Installed in CA_SCM_HOME\Docs\FormEditorAPIDoc

> Surfaced editor object

� Type IFormEditor

– See JavaDoc

� Access to SCM Objects:

– getSession(), getProject(), getStoredForm(), getUser()

24 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

– getSession(), getProject(), getStoredForm(), getUser()

� Interaction with Form Editor

– get/setTextFieldValue, get/setDateFieldValue, etc., for each type

– addComboBoxItem, refreshFieldValue, alert(), etc.

– setValid to report validity

� Navigation between SCM Objects

– e.g.

� editor.getSession().getActiveProjects()

� editor.getSession().getUser().getName()

� editor.getSessoin.getUser().getInUserGroups()

Form ScriptsScript Blocks in XML Template

> Support Script Blocks

� Initialization

� Field Validation

� Form Events

> Script Blocks in XML<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!DOCTYPE harvest_form SYSTEM "harwebForms.dtd">

25 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

<!DOCTYPE harvest_form SYSTEM "harwebForms.dtd">

<harvest_form dbtable="formtest1" id="formtest1" name="FormTest1" numtabs="0">

<initialization language=“javascript” client=“eclipse”>

JavaScript Here

</initialization>

<validation language=“javascript” client=“eclipse”>

JavaScript Here

</validation>

<events language=“javascript” client=“eclipse”>

JavaScript Here

</events>

...

</harvest_form>

Form ScriptsInitialization

<harvest_form …>

<initialization language="javascript“ client=“eclipse”>

editor.setTextFieldValue(“dtcomponentname", “An Initial Value");

var projects = editor.getSession().getActiveProjects();

for (i in projects)

{

26 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

{

editor.addComboBoxItem("dtproject", projects[i].getName());

}

</initialization>

</harvest_form>

Form ScriptsValidation

<harvest_form …><validation language="javascript“ client=“eclipse”>if (editor.isFieldModified("vibf1devname")){

if (!isManager()){

editor.alert("Sorry, you must be in a Manager group to change assignment");editor.setValid(false);

}}

27 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

}

function isManager(){

var groups = editor.getSession().getUser().getInUserGroups();for (i in groups){

if (groups[i].getName().indexOf("Manager") != -1)return true;

}return false;

}</validation>

</harvest_form>

Form ScriptsEvents

<harvest_form …>

<events language="javascript" client="eclipse">

function dtprojectChanged()

{

var project = editor.getSession().getProject(editor.getTextFieldValue("dtproject"));

var states = project.getStateList();

for (i in states)

{

28 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

{

editor.addComboBoxItem("dtstate", states[i].getName());

}

}

</events>

<combobox cols="11" dbfield="dtproject" id="dtproject" label="Project" maxsize="11"

rows="1"/>

</harvest_form>

Form ScriptsInteracting with Java

> Java Language is accessible from JavaScript with

LiveConnect

<events language="javascript">

function radiosChanged()

{

java.lang.System.out.println(“I can use Java!");

29 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

java.lang.System.out.println(“I can use Java!");

}

</events>

> See Mozilla Rhino documentation for LiveConnect details:

� http://www.mozilla.org/rhino

Form ScriptsInvoking HSQL

> See ScmSession in Form Editor API JavaDoc

editor.getSession().executeSqlQuery(“select * from…”);

� Result will be of type ScmQueryResult (see JavaDoc)

� ScmQueryResult provides many ways of retrieving data from

result set.

30 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

var queryResult =

editor.getSession().executeSqlQuery("select username, usrobjid from haruser");

var columnIter = queryResult.getColumn("USERNAME").iterator();

while (columnIter.hasNext())

{

var userName = columnIter.next();

java.lang.System.out.println(userName);

}

Form ScriptsExample: OnDemand Projects

> OnDemand Form Script

� Dynamic List Boxes

� Dynamic Field Enablement

� JavaScript-invoked SQL

31 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

Demo

Form Scripts

JavaScript Tips

> No need to restart Workbench after loading new Script

� Just Close/Reopen Form Editor

� Form Editor Re-reads XML Template from Server on every Open

> Start Workbench from Command Shell

� Easy viewing of stdout (text sent to System.out)

33 September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright © 2008 CA

– Navigate to SCMHOME in shell and launch…

java -jar plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar

> Form Editor API provides access to many wrapped CMSDK

objects.

� Use the API, not HSQL when possible.

> Use Form API JavaDoc

> Use resources at http://www.mozilla.org/rhino

Upgrade Assistance

Assistance from CA

> Upgrade support website

https://support.ca.com/irj/portal/anon

ymous/phpdocs?filePath=0/255/255_u

pdatemainpage.htmlpdatemainpage.html

> Development outreach webcasts

> CA Technology Services to perform the

conversion

SCM Upgrade Page Available

SCM Upgrade Page Available

Upgrade Support

Register to get upgrade

template plan

Product Line Community

https://causergroups.ca.com/join.aspx

Additional Dev Outreach webcasts

Topic Training Date Time (EST)

r12 Overview 8/19/2008 11:00AM -

12:00PM

Preparing r12 Installation &

Upgrade

8/26/2008 11:00AM -

12:00PM

Forms Customizations and

Advanced Usage

9/2/2008 11:00AM -

12:00PM

r12 Overview 9/16/2008 12:00PM -r12 Overview 9/16/2008 12:00PM -

1:00PM

Preparing r12 Installation &

Upgrade

9/23/2008 12:00PM -

1:00PM

Forms Customizations and

Advanced Usage

9/30/2008 12:00PM -

1:00PM

r12 Eclipse Plugin Overview 10/07/2008 12:00PM -

1:00PM

r12 .Net Plugin Overview 10/14/2008 12:00PM -

1:00PM

Q&A

41September 30, 2008 CA SCM r12 Development Outreach - Forms Copyright ©

2008 CA