CA Harvest Software Change Manager Customizing CA Harvest

  • Slides: 30
Download presentation
CA Harvest Software Change Manager Customizing CA Harvest SCM Forms: Why and How January

CA Harvest Software Change Manager Customizing CA Harvest SCM Forms: Why and How January 2016

Agenda § Harvest Forms overview § Workbench Form Editor Overview § Form Template Features

Agenda § Harvest Forms overview § Workbench Form Editor Overview § Form Template Features § Form Scripts § Harweb Forms § Demo § Migration/Upgrade Issues § Java. Script Tips § Q&A 2 © 2016 CA. ALL RIGHTS RESERVED.

Harvest Forms Overview § CA Harvest SCM forms let you record changes associated with

Harvest Forms Overview § CA Harvest SCM forms let you record changes associated with Harvest Change Package. § Forms help you organize information for a project or about a specific customer. § Form attachments provide us to additional relevant information associated with Harvest Change Package. § Forms are global objects, can be accessed across multiple projects. 3 © 2016 CA. ALL RIGHTS RESERVED.

Harvest Forms Overview Default Forms/Custom Forms § Default forms o Shipped through Harvest SCM

Harvest Forms Overview Default Forms/Custom Forms § Default forms o Shipped through Harvest SCM installation. o Loaded through ‘Load. Forms’ option in hdbsetup operation. § Custom forms o Can be created from Harvest SCM Administrator interface. o Use hformsync utility to load forms into Harvest Schema. Syntax : hformsync –b brokername –usr harvest –pw harvest “form. xml” § Doc Reference o Administrator Guide->Creating and Modifying Form Types 4 © 2016 CA. ALL RIGHTS RESERVED.

Workbench Form Editor Overview Features § Integrated Form Editor – Eclipse-based GUI – Multiple

Workbench Form Editor Overview Features § Integrated Form Editor – Eclipse-based GUI – Multiple Forms can be opened as tabs – Image & Hyperlink Fields – Multiple Column Layout – Required Fields (*) – Validation Patterns – XML Form Templates on Server – Java. Script scripting – Form Editor API 5 © 2016 CA. ALL RIGHTS RESERVED.

Form Editor Overview XML Form Templates § Workbench uses XML Form Templates – Can

Form Editor Overview XML Form Templates § Workbench uses XML Form Templates – Can be generated from. HFD with Form. Gen. exe – Java. Script scripting § Form Editor API § XML Templates Stored on Server – No need to distribute form templates to individual client machines – Load on server using: § hserver –loadforms § hformsync 6 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Image Field § XML Element <image> – Attributes: § url (required)

Form Template Features Image Field § XML Element <image> – Attributes: § url (required) URL to image location § href (optional) Hyperlink URL § span (optional) Grid Columns <image url="http: //www. ca. com/images/front/chips/unify_walkie 1. jpg" href="http: //www. ca. com" span="2"/> § Supported Image Types – JPEG, GIF, PNG, BMP (Windows bitmap), ICO (Windows icon) 7 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Hyperlink Field § XML Element <hyperlink> – Attributes: § href (required)

Form Template Features Hyperlink Field § XML Element <hyperlink> – Attributes: § href (required) Hyperlink URL § label (optional) Link Text <hyperlink label="CA Home“ ref="http: //www. ca. com"/> 8 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Rich Label § Existing XML Element <text> – ‘value’ attribute supports

Form Template Features Rich Label § Existing XML Element <text> – ‘value’ attribute supports HTML-like markup <text value="< p>< /p>< p>New < b>Harvest Sigma< /b> Features< /p>< li>Java CMSDK< /li>< li>Workspace< /li>< li>Serverbased Form Templates< /li>< p>< /p>"/> – Uses SWT Form. Text Widget § See SWT Java. Doc for supported markup http: //help. eclipse. org/help 32/index. jsp? topic=/org. eclipse. platform. doc. isv/reference/api/org/eclipse/ui/for ms/widgets/Form. Text. html 9 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Required Fields § ‘required’ attribute – Optional for all <text-field> elements

Form Template Features Required Fields § ‘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 “*” 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. 10 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Field Validation Patterns § ‘pattern’ attribute – Optional for all <text-field>

Form Template Features Field Validation Patterns § ‘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="ddd" patternmessage="Three Digits Required"/> – May also define ‘patternmessage’ attribute to explain pattern in readable text. 11 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Multiple Columns § ‘columns’ Attribute – Optional attribute for<tabpanel> and <harvest_form>

Form Template Features Multiple Columns § ‘columns’ Attribute – Optional attribute for<tabpanel> and <harvest_form> – Pages not defining ‘columns’ will default to one column § ‘span’ Attribute – Optional attribute for all field elements. – Fields not defining ‘span’ will default to spanning one column 12 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Multiple Columns § Form Grid 13 © 2016 CA. ALL RIGHTS

Form Template Features Multiple Columns § Form Grid 13 © 2016 CA. ALL RIGHTS RESERVED.

Form Template Features Multiple Columns Ø Multiple Column Layout Example <tabpanel id="1" label="Origination" columns="2">

Form Template Features Multiple 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"> …</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> 14 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Java. Script Ø Java. Script replaces VBScript Multiple platform support Ø Form

Form Scripts Java. Script Ø Java. Script replaces VBScript Multiple platform support Ø Form Editor Java API § § Surfaced to Java. Script Environment Interaction with Form Editor GUI o get/set field values o set focus to field, etc Read-only access to many CMSDK Objects Java. Documentation Ø Mozilla Rhino § § Embedded Java. Script Interpreter Live. Connect o Allows Java. Script to interact with Java 15 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Form Editor API Ø Java. Script Form API Documentation CA_SCM_HOME/Docs/Form. Editor. APIDoc

Form Scripts Form Editor API Ø Java. Script Form API Documentation CA_SCM_HOME/Docs/Form. Editor. APIDoc Ø Surfaced editor object § § Type IForm. Editor o See Java. Doc Access to SCM Objects: o get. Session(), get. Project(), get. Stored. Form(), get. User() Interaction with Form Editor o get/set. Text. Field. Value, get/set. Date. Field. Value, etc. , for each type o add. Combo. Box. Item, refresh. Field. Value, alert(), etc o set. Valid to report validity Navigation between SCM Objects e. g. o o o 16 editor. get. Session(). get. Active. Projects() editor. get. Session(). get. User(). get. Name() editor. get. Sessoin. get. User(). get. In. User. Groups() © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Script Blocks in XML Template Ø Support Script Blocks § § §

Form Scripts Script 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" ? > <harvest_form dbtable="formtest 1" id="formtest 1" name="Form. Test 1" numtabs="0"> <initialization language=“javascript” client=“eclipse”> Java. Script Here </initialization> <validation language=“javascript” client=“eclipse”> Java. Script Here </validation> <events language=“javascript” client=“eclipse”> Java. Script Here </events>. . . </harvest_form> 17 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Initialization <harvest_form …> <initialization language="javascript“ client=“eclipse”> editor. set. Text. Field. Value(“dtcomponentname", “An

Form Scripts Initialization <harvest_form …> <initialization language="javascript“ client=“eclipse”> editor. set. Text. Field. Value(“dtcomponentname", “An Initial Value"); var projects = editor. get. Session(). get. Active. Projects(); for (i in projects) { editor. add. Combo. Box. Item("dtproject", projects[i]. get. Name()); } </initialization> </harvest_form> 18 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Validation <harvest_form …> <validation language="javascript“ client=“eclipse”> if (editor. is. Field. Modified("vibf 1

Form Scripts Validation <harvest_form …> <validation language="javascript“ client=“eclipse”> if (editor. is. Field. Modified("vibf 1 devname")) { if (!is. Manager()) { editor. alert("Sorry, you must be in a Manager group to change assignment"); editor. set. Valid(false); } } function is. Manager() { var groups = editor. get. Session(). get. User(). get. In. User. Groups(); for (i in groups) { if (groups[i]. get. Name(). index. Of("Manager") != -1) return true; } return false; } </validation> </harvest_form> 19 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Events <harvest_form …> <events language="javascript" client="eclipse"> function dtproject. Changed() { var project

Form Scripts Events <harvest_form …> <events language="javascript" client="eclipse"> function dtproject. Changed() { var project = editor. get. Session(). get. Project(editor. get. Text. Field. Value("dtproject")); var states = project. get. State. List(); for (i in states) { editor. add. Combo. Box. Item("dtstate", states[i]. get. Name()); } } </events> … <combobox cols="11" dbfield="dtproject" id="dtproject" label="Project" maxsize="11" rows="1"/> … </harvest_form> 20 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Interacting with Java Ø Java Language is accessible from Java. Script with

Form Scripts Interacting with Java Ø Java Language is accessible from Java. Script with Live. Connect <events language="javascript"> function radios. Changed() { java. lang. System. out. println(“I can use Java!"); } </events> Ø See Mozilla Rhino documentation for Live. Connect details: http: //www. mozilla. org/rhino 21 © 2016 CA. ALL RIGHTS RESERVED.

Form Scripts Invoking HSQL Ø See Scm. Session in Form Editor API Java. Doc

Form Scripts Invoking HSQL Ø See Scm. Session in Form Editor API Java. Doc editor. get. Session(). execute. Sql. Query(“select * from…”); § Result will be of type Scm. Query. Result (see Java. Doc) § Scm. Query. Result provides many ways of retrieving data from result set. var query. Result = editor. get. Session(). execute. Sql. Query("select username, usrobjid from haruser"); var column. Iter = query. Result. get. Column("USERNAME"). iterator(); while (column. Iter. has. Next()) { var user. Name = column. Iter. next(); java. lang. System. out. println(user. Name); } 22 © 2016 CA. ALL RIGHTS RESERVED.

Harweb Forms Server side forms Ø Harweb supports server side forms § Users don’t

Harweb Forms Server side forms Ø Harweb supports server side forms § Users don’t need to manually copy required files to Harweb installation. § Creation of required JSP, Java, XML files is done automatically when a form of specific type is accessed from Harweb. § Compilation of Java (Java. Bean for the form type) files is done automatically. 23 © 2016 CA. ALL RIGHTS RESERVED.

Harweb Forms Scripting § Harvest forms gets converted to jsp pages to display. §

Harweb Forms Scripting § Harvest forms gets converted to jsp pages to display. § Form fields from xml gets converted to html table in jsp file. § Javascript can now be embedded into jsp page for validation. <SCRIPT LANGUAGE="Java. Script"> function my. Function() { alert("test"); } </SCRIPT > <TD ALIGN="RIGHT" class="label">SS# (nnn-nn-nnnn)</TD> <TD ALIGN="LEFT"><INPUT value="<%=HUtil. de. Quote(form. Bean. getsecuritynumber())%>" MAXLENGTH="40" dbfield="securitynumber" on. Click="unset. Space(this)" on. Blur="set. Space(this)" id="securitynumber" name="securitynumber" SIZE="20" class="data" TYPE="TEXT" onchange="my. Function()"></TD> 24 © 2016 CA. ALL RIGHTS RESERVED.

Harweb Forms Styling § Users can edit jsp file with html attributes form display

Harweb Forms Styling § Users can edit jsp file with html attributes form display customizations. Note: Form jsp file gets generated automatically whenever a change is detected form xml file in database. So customized jsp files need to be taken backup before modifying the form template file. 25 © 2016 CA. ALL RIGHTS RESERVED.

Harvest Forms Customizations - Demo

Harvest Forms Customizations - Demo

Java. Script Tips Ø No need to restart Workbench after loading new Script §

Java. Script 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) o Navigate to SCMHOME in shell and launch… java -jar plugins org. eclipse. equinox. launcher_1. 1. 0. v 20100507. jar Ø Form Editor API provides access to many wrapped CMSDK objects § Use the API, not HSQL when possible. Ø Use Form API Java. Doc Ø Use resources at http: //www. mozilla. org/rhino 27 © 2016 CA. ALL RIGHTS RESERVED.

Migration/Upgrade Issues § From R 7. 1 to R 12. x VBScript used in

Migration/Upgrade Issues § From R 7. 1 to R 12. x VBScript used in old form templates has to be converted to Java. Script for use in R 12. x Eclipse-based form editor. This is required because VBScript is not portable to non-Microsoft platforms. § Harweb upgrade If you have customized any CA Harvest SCM JSP pages in your existing Web Interface installation, back them up to a different location. Note: Do not copy the previously customized JSP pages back into your upgraded product installation. You should only use these JSP pages as a reference to customize the upgraded versions. 28 © 2016 CA. ALL RIGHTS RESERVED.

Q&A

Q&A

Sridhar Gooni Principal Software Engineer Sridhar. Gooni@ca. com

Sridhar Gooni Principal Software Engineer Sridhar. Gooni@ca. com