Archive for Andrew Leggett

Search and Replace in CA Plex

Did you know that you can copy and paste Action Diagram code into a text editor such as Notepad or Notepad++.

This simple tip can be a real time saver when editing Action Diagrams in CA Plex.

Once you have the code in a text editor you can perform operations such as search and replace, or even run macros in Notepad++. For example if you need to add a number of new subroutines and want to include the recommended +Subroutine meta variable and associated edit points, you could do the following:

1. Paste the following boilerplate code into a text editor.

ª+1 Sub aaa
ª+2 +++Define Field: FIELDS/+Subroutine
ª+2 Edit Point Start aaa
ª+2 +If Field: FIELDS/+Subroutine
ª+3 Edit Point aaa
ª+2 Edit Point End aaa
ª+2 +++Undefine Field: FIELDS/+Subroutine
@@

2. Open the Search and Replace dialog in the text editor and replace the “aaa” placeholder with the name of your subroutine, e.g. “Process Results”.

ª+1 Sub Process Results
ª+2 +++Define Field: FIELDS/+Subroutine
ª+2 Edit Point Start Process Results
ª+2 +If Field: FIELDS/+Subroutine
ª+3 Edit Point Process Results
ª+2 Edit Point End Process Results
ª+2 +++Undefine Field: FIELDS/+Subroutine
@@

3. Select the code and copy the text.
4. Paste the copied text into your Action Diagram.

subroutine

5. Repeat the steps for any other subroutines you want to add.

Be careful not to modify any of the special characters, e.g. “ª+2” or “@@”.  The code you edit will be parsed by Plex when you paste the text, so it may report any errors if for instance you mistype a field name.

CM WebClient and Vector Graphic File Support

By Abram Darnutzer, Sr. Application Consultant

All modern browsers have scalable vector graphic (SVG) file support. But there are several display options for these files.

The simplest method is to display the file directly as an image:

<img src=”test.svg” alt=”My Test SVG File”>

However, in so doing, you lose a unique function of SVG files because it is no longer possible to dynamically change the images using CSS or the SVG code itself.

A better method is to embed the code directly into the HTML using the “svg” tag:

<svg x=”0px” y=”0px” width=”612px” height=”502.174px” viewBox=”0 65.326 612 502.174″ enable-background=”new 0 65.326 612 502.174″ xml:space=”preserve” class=”logo”> <ellipse class=”ground” cx=”283.5″ cy=”487.5″ rx=”259″ ry=”80″/> <path class=”test” d=”testing”/> <filter id=”pictureFilter” > <feGaussianBlur stdDeviation=”15″ /> </filter> </svg>

Then you can manipulate the SVG image with CSS, as follows:

.logo {

width: 200px;

height: 164px;

}

.test {

fill: #94d31b;

}

.test:hover {

fill: #ace63c;

}

.ground {{

fill: #787f6a;

}

.ground:hover {

filter: url(#pictureFilter);

fill: #896d3d;

}

Creating a template for CM WebClient to use this kind of functionality is straightforward. You just need some simple HTML, like this:

<span id=”/(!NameID)” class=”/(!CustomClass:nc:class=/(!Param:class))” style=”/(!DefaultCSS:nc:withPos=/(!Param:default))”>

<svg width=”/(!Size:x)px” height=”/(!Size:y)px”>

</svg>

</span>

Then, add some code in the JSOnLoad and/or add an action to do a SetValue in CM WebClient. You will be able to control the contents of this SVG tag through CA Plex.

Alternatively, you can reference an existing SVG file directly in the browser. By using the Object Tag you can reference an existing file while retaining all the functionality embedded within the SVG file. However, you still do not have control over the file using CSS. To retain control, write HTML that looks like this:

<object type=”image/svg+xml” data=”https://upload.wikimedia.org/wikipedia/commons/6/6c/Trajans-Column-lower-animated.svg” class=”logo”>

</object>

Manipulating Object Positions in CSS

By Abram Darnutzer / Sr. Application Consultant

With HTML5/JavaScript applications, item positioning on a screen falls into two categories: relative positioning or absolute positioning. Absolute positioning for mobile applications should be avoided (with few exceptions) since mobile devices vary greatly. Relative positioning can be tricky to get just right, however. Below are a few quick and easy tricks to position items better in your app!

Header Setup

A typical header region contains two things: a centered logo and a back button in the top left corner. (You should limit the area to include 1-2 other items since you don’t want to overcrowd the space.) If you use Sencha Touch’s spacing to set this up, you may notice that your logo will be off-centered because the items on each side of the logo are different sizes. We can do some simple CSS to avoid this eyesore.

If you want an item to appear in the top left:

.TopLeftButton {

position: absolute;

left: .2em;

}

If you want an item to appear in the top right:

.TopRightButton {

position: absolute;

right: .2em;

}

And for the centered logo:

.CenteredLogo {

height: auto;

margin: auto;

}

You’ll end up with something like this:

cm-centered-logo

The code is setting a discrete constant distance between the left and the right buttons from the edge of the screen and marking the logo margins as equal to the left and to the right. (Note: Since the left and right buttons are position absolute, they do not factor into the margin calculation.)

Displaying a Button Image Over Button Text

In WebClient Mobile, the button image and button text will appear on the same line by default because they both use the Span HTML tag, which displays items on the same line. Getting around this issue is simple.

For the button CSS:

.Mybutton {

display: table-cell !important;

}

For the button image:

.Mybutton .x-button-icon {

vertical-align: top;

margin-left: auto;

margin-right: auto;

}

And for the button text:

.Mybutton .x-button-label {

display: table-row;

vertical-align: bottom;

}

This will produce a layout like this:

cm-layout-css-objects

These methods will ensure that your carefully designed objects will display optimally on whatever device your customers choose!

Automate Your Web Page Testing

By Denise Kalm | Industry Expert

A new, clean web page isn’t built in a day — it requires major testing before going live. Web pages are software, and software is prone to bugs. Problems with your pages can seriously affect your line of business, and the wide visibility of a web page harbors the risk of damaging your brand when mistakes happen. (And they do.) Mistakes in this arena are deadly not only because customers might seek out other business: Public mistakes are just plain embarrassing!

Though most application software goes through complex automated QA and load testing, too often web pages don’t get the same diligence and attention, because they “look just fine.” You may manually walk through various options, but the “if it ain’t broke, don’t fix it” mentality is tempting. It’s possible you’ve known for years that your company needs an automated tool, but budget constraints have placed it out of reach for except the largest companies. But now small startups are working harder and getting smarter, and small companies are accordingly offering creative, affordable solutions. In short, you can no longer afford not to evaluate your automation needs.

So what kinds of questions should you ask yourself while evaluating? “How repeatable are your manual tests?” “How long does each test take?” Automating the process allows you to run tests repeatedly as you develop the web pages without impacting the development schedule. For web applications, tests need to be run on all operating systems and hardware types your customers might use — a complicated, unwieldy process when performed manually. Automated test scripts ensure that you cover all the bases, freeing up time and money that you can then devote to other areas.

You’ll also have the option to create more tests than you would ever want to execute manually. (Remember: The more you test, the more reliable your software will be.) You not only want to test the ideal way a customer works with your application; you also need to run tests that’ll check when things go wrong. It is essential to detect where, how, and why your application isn’t handling a situation correctly. Once your solution is in place, you can have the product report on in-flight, transaction processing steps to see contents of tables and files, and the memory to understand and correct problems.

So what does automation mean for you?

  1. Automation means accuracy. Each run will be exactly the same as the last, and every important aspect will be documented. Unless you hire out, developers in small shops end up doing the testing, which wastes valuable company resources (and is hardly fun for them).
  2. Automation means scale. No one can bring together hundreds or thousands of users to test the capacity of a system and detect potential issues, such as out-of-sequence database updates. Only an automation solution can test the limits of your application as thoroughly as if it were running live.
  3. Automation means a happier and more productive team. When developers and QA can do what they love instead of what they find tedious, everyone smiles more. Simple as that.

What are the steps involved in automation?

The first step is deciding what tests to run — the most obvious of which are unit, functional, regression and load testing. Unless this is a brand new application, you’ll also need to conduct regression testing to ensure you haven’t broken anything in the existing code. Your application may have other needs, so be sure to have a complete list before you search for a product.

Once you know this, you can prepare a list of requirements (or RFP) to present to a list of vendors, such as supported platforms, scripting languages, the ability to record and/or replay, and kinds of testing they offer. Vendors must, of course, be able to test against all the common browsers, but they’ll also need to test all the popular mobile platforms.

This may sound overwhelming, but CM First can help!

We at CM First can help you develop efficient ways to automate testing of your browser, mobile, green screen, and client-server applications with industry-leading products coupled with best practices training and mentoring. We are particularly experienced with applications developed with CA Plex and CA 2E, but we are not limited to applications built with those products. (Anything that has an interface can be automatically tested, including packages like Office and Salesforce.)

In sum, running tests early in the development cycle expedites the process of getting your working product to market. Let CM First help smooth the transition from manual to automated so you stress less and profit more.

When will you start automating?

The Fourth of Four Tips for Designing a Good Mobile Application

Lily Taharudin/Application Consultant

When designing applications just for a website accessed only by a desktop or laptop, many of us got comfortable using low-resolution images. They loaded faster and back in the day, with networks and browsers working more slowly, everything you could do to improve performance truly mattered.

Now, when you don’t know who will be accessing your website and how, you want to optimize the experience for everyone. As noted in prior tips, design of your mobile-facing site cannot be a clone of your old desktop-facing website. In most cases, you want to use high-resolution images now. Most devices have high-definition screens which require an image double the resolution of a desktop. Having extremely high-resolution images will help you avoid having pixelated or blurry images when viewed on a retina-quality screen.

Expectations for visibility have increased and people demand clear images. With download speeds greatly improved, loading time for these images is less of an issue, so make sure you have sharp images to create a great user experience. As you see below, the low res image is a poor representation of your brand and can quickly put people off. Get it right and keep people on your site.

 

lily

 

Using CA Plex Objects in Control Names for CM WebClient

Abram Darnutzer – Sr. Application Consultant

When working with CM WebClient and CM WebClient Mobile, there are times where you have to enter custom parameters into the Control Name for a CA Plex Panel Object.

For normal WebClient, you could be setting a CSS class for a button like this:

myPushButton:MainArea:class=CustomCSSClass:default

Or for CM WebClient Mobile, you could be setting a Label for an Edit control:

TestFld:MainArea:label=MyTestLabel

Or an icon class for a Push Button:

TestBtn:MainArea:iconCls=more

There are times where hard-coding these values can bring maintenance problems, and doesn’t take advantage of the powers of CA Plex. So, there must be another (sometimes better) way. By using CA Plex objects in your Control Names, you can affect larger portions of your application with a single change.

Let’s look at the three examples from before. But this time we will use CA Plex objects to set the values.

myPushButton:MainArea:class= <VAL:Classes.MyButtons>:default
TestFld:MainArea:label= <LBL:CompanyID>
TestBtn:MainArea:iconCls= <VAL:Icons.TestIcons>

Here, you can see we are using CA Plex Value and Label objects in the Control Name. These can be entered by hand, or dragged and dropped from the Object Browser.

Now, if I wanted to change the label for every field that uses the CompanyID label, all I need to do is change the literal for that label object and regenerate my function. It’s a great way to avoid hard-coding and the maintenance issues it brings.

Keeping Track of Your Changes

Andrew Leggett / Sr. Application Consultant

When working on your CA Plex application, it’s easy to lose track of all the entities, functions, panels, fields and more that you’ve recently modified. Luckily, there are a few options in CA Plex to aid your memory.

1.  Automatic Lists

With this option, CA Plex will automatically add any objects you create or change to a List object. There are a couple of steps to using this option.

  1. In File -> General Options, open the ‘Impact Analysis’ tab and check ‘Automatically log modified objects’.

  1. Now set the List object to use. Go to File -> Model Options and press ‘Select’ to select an existing List, press ‘New List…’ to create a new one.

Just find the List in the Object Browser, and everything you’ve worked on recently is there.

2.  Highlight Modified Objects

This is a useful option to make it easy to spot objects in the Object Browser that have been modified or created since you last updated the group model. To set this option, right-click in the Object Browser and select View -> Highlight Modified Objects.

Untouched objects show in grey while modified objects show in black.

3. Highlight Modified Triples

In the Model Editor you can highlight any triples you’ve added or changed since you last updated the group model. To set this option, open the Model Editor and select View -> Options and check ‘Highlight Modifieds’.

With this option, unchanged triples show in grey while your latest triples are in full color.

 

Running CM WebClient Applications 24 Hours a Day, 365 Days a Year

Andrew Leggett / Sr. Application Consultant

running

If you have a live, CM WebClient web application, you will probably want to upgrade your existing site sometime, whether to fix a bug, add new features, or just to update the graphics.

Upgrading has traditionally been a pain.  You had to make sure no-one was using the system and schedule a window of time where the system would be unavailable.  This is not always practical if your system is used around the world and needs to run 24 hours a day, 365 days a year.

Fortunately, if you are using Tomcat v7 or later as your web server, there is already a built-in solution for this, and it’s incredibly simple to implement.

This feature is called ‘Parallel Deployment’, and this is how it works:

  1. When you are ready to deploy your CM WebClient war file, you just need to rename it to add ‘##’ followed by a sequence number, e.g. rename “MyWebApplication.war” to “MyWebApplication##0001.war”.
  2. Copy this file to your “WebApps” folder in your Tomcat installation.  Tomcat monitors this folder and will automatically unpack and deploy your war file.  Your application will be available to your users at the usual URL.
  3. When you need to upgrade, rename your new war file to include a higher sequence number, e.g. “MyWebApplication##0002.war” and copy it to your “WebApps” folder.
  4. Tomcat will take care of everything from this point.  If there are users currently using the previous version, they will continue to use that version for their current session.  Any new users connecting to the URL will be directed to the new version.  Once all the sessions for the old version have expired, Tomcat will undeploy the old version and clean up the files.
  5. Repeat for each upgrade, just increment the sequence number each time.

Free Tools to Make Your CM WebClient Apps Shine

by Andrew Leggett / Sr. Application Consultant

CM WebClient, CM WebClient Mobile and CM WebClient HSync all allow you to customize the style, appearance and behavior of your web applications. But what if you want a little more? What else can you do? The following sites provide free tools that run within the browser to help you make your applications stand out.

1. JSFiddle (http://jsfiddle.net/) lets you quickly try out your JavaScript, HTML and CSS code right in the browser. Your ‘fiddles’ can be saved so that you can test them out in different browsers, or allow others to collaborate.

2. Sencha Fiddle (https://fiddle.sencha.com/) is similar to JSFiddle, but is designed for the Sencha Touch framework used by CM WebClient Mobile and CM WebClient HSync. Run and test your code instantly.

3. Free Icon Maker (https://freeiconmaker.com/ – requires Adobe Flash) provides a large collection of scalable icons, plus tools to customize their appearance. Treat your users to a modern, consistent makeover.

4. CSS3 Generator (http://css3generator.com/) allows you to try out different styles without having to learn CSS. Simply paste the results into your CSS file to add some style.

5. Paletton (http://paletton.com/) – Some color combinations simply look better than others. This tool can help you pick colors for your application that are easy on the eye.

6. Chrome Developer Tools (http://webdesign.tutsplus.com/articles/faster-htmlcss-workflow-with-chrome-developer-tools–webdesign-8314) this tutorial explains how you can use the Chrome F12 Developer tools to prototype in real-time how the visual designs you created with the above tools will make your CM WebClient application look.

Be a web application wizard without having to beg management for more software and without having to learn new languages.

Using the Log File for Your Own Purposes

by Andrew Leggett / Sr. Application Consultant

WebClient developers know how useful the log file is for debugging and for tracking errors, but did you know that you can send your own messages to the log file from your CA Plex action diagram?

This technique can be used to provide an insight on what happens ‘behind the scenes’ without affecting the end user.  Note that this is only for Java client or server functions.

To log a message to the log file:

  1. Create a new JAVA source code object, e.g. “Send WebClient Log Message”, and provide a parameter field:
    *Message Text.
  2. Add the following source:import com.adcaustin.webplex.WebPlexLog;
    WebPlexLog.errorLog(&(1:).toString());
  3. Create an API Call to your new source code object, and pass in your message text.
 
 
© 2013 CM First Group - All rights reserved