Monday, November 25, 2013

Learning Flash

The Flash engine inside the box is FlashLite 3.1, and makes use of ActionScript 2.0

While setting up the environment, I was reading the documentation in the Lexmark SDK and came across this part:
The SDK comes with several components (SWCs) that must be set up in the proper location in order for Creative Suite to make use of them. To install these components, do the following:
Determine the proper data directory.
For CS5, it will look like this: (Your Drive):\Documents and Settings\(Your user name)\Local Settings\Application Data\Adobe\Flash CS5\(Language and country, i.e. en_US)\Configuration\Components
 and while I do have this directory on the machine, there is one more child directory named "Flex" which does contain a SWC file in it.  So at this time I am not 100% sure whether I will need to copy over SWC files into the one specified by the documentation or the child directory named "Flex".  For the moment I am going to stay strictly with the documentation and if problems arise I can see if this is the problem.

The documentation has you set up the Test SWF app on the printer so that you can test SWF files.  I ran into a problem at first however with the app not showing anything.  However I luckily figured out that the publishing settings were set to run on flash player 10 instead of Flash Lite 3.1 like it needed to be, here is how I fixed it.

Inside of Flash Player under File>Publish Settings>Flash I changed the Player value to Flash Lite3.1 and under formats I unclicked HTML so that we don't get an HTML published format.

In order to see actionscript inside of eclipse I downloaded the plugin at http://aseclipseplugin.sf.net/updates/ in order to get syntax highlighting


Also found out that calling SWFPromptContext.cancel will take you back to the homescreen where as .dismiss() will just dismiss the prompt and contiue on with the go() function

Saturday, November 23, 2013

Customer Change Request

After showing the app to Lexmark, they have decided that they would like us to have a Flash interface instead of the current VLML interface.  Here is a list of all of the changes that were proposed by our customer (Jason):
  • Login and Password prompts should ask for your gmail account.
  • Hide password with asterisks.
  • When authorization fails give a message and let them retype their password.
  • Where the meetings are displayed either make the date bigger or get rid of it.
  • Make some of the Tips screens better by changing them from one long paragraph to multiple paragraphs. 
  • Fix descriptions on the settings screen. 
  • Fix the white bar on the meetings page.
  • The timing for late, on time, and running close seem to be a little off.
  • Make the status for each meeting bigger and more than just late. They wanted late to become You are Late.
  • Put the arrow buttons when there is a double booking at the middle of the screen. (They might have changed their minds on this one, they saw another place in an app that had the arrows at the bottom).
  • The back button for tips needs to be all the way to the bottom right corner. 

Thursday, November 7, 2013

Integration Testing

After a few days of trying to get JUnit up and running, I have decided that integration testing will be the best route to take.  The way we ended up doing integration testing is to have a separate program which can invoke different elements and modules that we have create for this program.

Unit testing ended up not working to well as our classes often are reliant on many different services which may or may not be present.  Other obstacles with unit testing were that we were forced to test with junit 3 and the framework needed to run on a special application on the printer in order to see test results.  All of this made it unnecessary and clearly the wrong approach for testing.

In our test program, we take out individual classes and test them similar to how we would do unit testing but with more emphasis on how it will interact with the overall system.  For example with the EmailPrompt.java class we test that it can show all messages which are passed into the constructor in the radio list on screen.  We also test that the prompt returns the correct message by allowing the user in the program to test edge cases and off by one errors.

Wednesday, November 6, 2013

Completed work on the EmailPrompt

The email prompt class is a class which aids in rendering a graphical user interface as well as handling primary events which happen as a result of user interaction.

It's important to remember the overall theme of what happens in an eSF application on a Lexmark computer.  A Profile is a series of Prompt's.  A prompt is an individual screen which can be rendered and handle events.  There are several standard prompts that the SDK provides such as a Message prompt, String prompt, and other base prompts that can be utilized in many settings.

As part of this project though, the requirements for the screens cause us to have to implement a custom prompt.  When implementing a custom prompt you must create a class that extends BasePrompt and implements VlmlPrompt.  One method which will need to be overridden is getVlml which returns the String representation of the custom vlml to be shown to the user.

We saw in the SDK that many of the examples would literally write the VLML into string literals which would cause them to have to escape a lot of text and generally looked tedious.  The way that we tackled this problem was to have the VLML centralized into an xml file which we then import in program code and convert to a String representation that the framework expects.  Gavin used the StringSubstitutor class so that we could place tags within the xml file such as ${texttoreplace} and using the string substitutor class we could easily throw in dynamic elements into the VLML file.  This proved useful when I was implementing the EmailPrompt class as the Email Prompt needs to be able to display different messages depending on the messages that are passed into the constructor.  Therefore I was able to put a tag like ${radio1} in the VLML file and have that text replaced with one of the messages passed into the constructor.