Monday, December 8, 2008
Final Project: DueDates-ulaula 2.0
DueDates-ulaula team consist of Tyler Wolff, Aric West and I. We all meet together few times a week and communicate through Google chat as well. I felt kind of intimidated at first because Tyler and Aric seemed more experienced programmer than I am but I did my best to contribute fairly over the course on our project. Aric worked on configuring the mock libraries, background processing and some test cases, etc. Tyler, because he had more exprerience on creating CSS formatting he did most of that and he also created some of the configuration files, DeveloperGuide, and some test cases also. And I did of the test cases like TestResultPage and TestAlertPage, ResultPage and UserGuide. Most of the time we need to modify some other files to add better features or functionalities so we jump into different pages to do that, especially Aric and Tyler.
DueDates Web Application
Due Dates is a simple web application that is capable of obtaining information for users about their borrowed items (books, DVD, VHS, etc.) from the University of Hawaii Library and Hawaii State Library.
As of now, our project looks healthy (at least the coverage > 90) except for Coupling and Churn. There were many lines that were modified and added in a commit, so that would contribute a lot on why our Churn is too high.
Our group member contribution is summarized on the graph below. I had few problems last time on my ant sensor and some eclipse problems debugging codes so I guess that's the reason why my DevTime on Hackystat is higher than Tyler and Aric. I also stumbled upon some other problems on JAXB because I had the 2.0 version and for some reason the parser or something on that version wasn't working. So I had to uninstall that version and installed the 2.1 version and everything worked fine. Aric helped me to figure out that particular problem I had on Jaxb and some on my xml file. They had more commits than me because they did a lot of modifications especially for creating better features and functionality on our project and more times than not two people are working on the same part of the project.
Fig. 1 Member Build Count
_______________________
Fig. 2 Member Commit
______________________
Fig. 3 Member Dev Time
Overview
Working with different people always bring you new experience and new knowledge. In duedates-ulaula team we didn't have any designated leader so that made us probably more responsible enough to accomplish our own task. It is always good to have a group leader but I think it depends on that particular team also how to handle their own responsibility. I had a great time working with the rest of the team because whenever we have problems we update each other what is going on and we try to communicate to solve that particular problem.
Monday, November 24, 2008
Stack Wicket Application
Stack Wicket Application is a web application that implement Stack that implements functionality such as "Push"(adding item on the stack); "Pop" (deleting item on the stack) and "Clear"(removing all the item on the stack).
Problems: PMD, Checkstyle, RuntimeException, etc.
Perhaps, the only thing that took me while to do on this project was fixing all those endless annoying errors. PMD complains a lot about using string literals so much or when you compare objects using booleans. Secondly, Checkstyle complains about this particular thing about "package-info: Doesn't exist" and little did I know that the problem is in my build.xml file. Oh and finally, RuntimeException - the greatest problem of all. Especially, on Wicket it gives you this particular stacktrace but it doesn't really say much, so you are actually staring at that particular line number (where it indicates where the problem was) forever and don't see anything wrong...but I am so glad I got that fix.
Overview
Learning Wicket could be fun but at the same time it's "wicked". Despite, of all the problems I had I began to like it and hoping to learn more about it. These past few days that I was doing this web application on Wicket I gained a lot of ideas although it is not so easy to grasp every aspect of it right away. I am looking forward to learn more and maybe in the future I will be able to design a bigger website using Wicket. Here is my stack wicket distribution file.
Friday, November 14, 2008
Enhancement for DueDates 1.2
Assigned Task
I was assigned to implement the timer-based reporting for DueDates. In doing so we have to implement some of the functions of the Java Timer and TimerTask. Implementing the timer wasn't that bad, I looked at the API and there was also a tutorial link that was provided by Dr. Johnson, which helped a lot. The other member of our teams -Daniel, implemented the JavaMail and John was responsible for working on the complexity, improving the coverage, etc. The good part about in our team is the good communication and good cooperation. We were able to meet and discuss the tasks and issues about the project 1-2 hours a day on weekdays. As for the weekends, since we weren't able to get together due to some other personal commitments communicating through google chat is the only solution.
Minor Problems
The problem I had stumble upon this week was running the JAR file. Everytime I tried to run the jar file on the command line it gives me this particular exception stacktrace about "javax mail". And little did I realize that we weren't the only team who was having a problem so are the other teams. So after seeing emails from other groups who had experienced the similar problem and who also posted a possible solution (Ronn and Art) helped me to solve my own. By putting the "mail.jar" into the JDK library is not enough because that didn't solve the problem, so I had to also put the "mail.jar" into the JRE library extension to make it work. In addition, these past few days I also had a couple of weird connection failures. I could be in the middle of working on something on the net and out of the blue my internet connection would just fail. Despite of everything that happened I was still able to do my part in the project and so is the rest of the purple team.
Overview
As the day go by on the incremental of our project I am continuing to improve my knowledge about creating a good software and what software engineering is all about. Good and clear communication in our team is one of the keys in determining the accomplishment of our project. Finally, being able to keep track about the status of our project using Software ICU and Hackystat were very helpful.
Friday, November 7, 2008
Hackystat Sensor: Project Health Monitor
Hackystat sensor is a program that shows analysis, chart, graph, interpretation and vital signs development of a project. On this project we use Software ICU to monitor the vital signs of our project health. The concept of SoftwareICU is pretty similar to monitoring the vital signs of patients in the hospital's ICU. The Software ICU vital signs include coverage (emma coverage), churn (measure the lines of code), complexity (measures how complex the loops and branches on your code), coupling (measures number of dependencies between classes), code issue (number of warnings), commits (measure number of commits by developers to the repository), builds (number of builds in the system), devtime (measures time spent by developers editing code), UnitTest (measures number of unit test invoked) and size (amount of code in the system).
To be able to use all of these features of hackystat sensor we have to install Eclipse, JUnit, Emma sensor, DependencyFinder, JavaNCSS, SCLC, SVN sensors, etc. I did that by updating all the
DueDates Purple Project on SoftwareICU
Overview
Hackystat sensor and Software ICU is a very good visual tool to monitor a project's health therefore, developers or programmers will be able to analyze the development of their own project. Setting up the sensor tools and environment variables for SCLC, DependencyFinder, and JavaNCSS, etc., were very straightforward. The only problem I had was when I tried to invoke "ant -f svn.build.xml" it failed because of User mapping error. So I had to actually create a UserMap.xml file to fix it and duedates-purple-dailybuild on Hudson is back to sunny day. I've learned a lot by gaining my familiarity on using and interpreting Software ICU and Hackystat.
Monday, November 3, 2008
"Behind the dark clouds there is a sun that still shinning."
Darker Days
Me and the rest of the purple team pretty much meet at least an hour or so everyday except for the weekends because some of us has to go to work and do some other personal matters. So on weekends we just communicated through Google chat. This second version of doing the project seemed a lot harder than the first one. Because we have to build more classes and test cases for each class. On top of that, we also stumble upon problems on the .classpath file, every time I tried to compile and run the program on eclipse it would just crash.
Therefore, we ended up editing the .classpath file and fixing the build class path on eclipse. While I had that particular problem on eclipse I just pretty much did my compiling and running on DOS prompt. In addition, there are also a lot of pressure in our group especially in getting things done in certain ways. If someone forget to verify and when you tried to run the build on your program it fails and because of that someone can just assume that you broke the build.
Shinny Days
Despite everything we've been through we got everything done. We also updated our wikis (Homepage, DeveloperGuide and UserGuide) and checked all the Javadoc documentations. Last time we got deducted some points because of not having enough sample input and output on our UserGuide so I added some screen shots and better sample output for the program.
Saturday, November 1, 2008
Code Review: Second Time Around
Their homepage and wikis (DeveloperGuide and UserGuide) were very detailed and informative. The output formatting of their program is really nice though they only used a basic formatting as oppose to using the String format with field and width precisions. In addition, they didn't really implement a lot testing cases and if they did, that will probably help to raise the emma coverage on their program. My additional review for the blue team is located here.
_______________________________________________________________
Our DueDates program was reviewed by duedates-violet They stated on their review that they weren't able to pass "ant -f verify.build.xml" on the first attempt. Also, due to time constraint they weren't able to really look at and test all the functions of the additional classes that we implemented. However, they did their best to give us constructive criticism such as needing to do a little clean up on our comment tags so that we won't be having errors in running PMD and checkstyle. Finally, they liked the improvement on our wikis (DeveloperGuide and UserGuide) that included with screenshots and more enlightening guide.
_______________________________________________________________
Overview:
Everyone works hard on this phase of the project. My team and I meet each other everyday except on weekends because of work and personal matter. We did our best to review and comment on the blue team's project and it's up to them whether to disregard it or at least consider it. And the violet's review on our project are quite helpful and something to consider and look forward to.
Thursday, October 23, 2008
Project Review
Examining different codes from various people helps me to broaden my knowledge about programming. The people who reviewed our code were kaneshige, shum, leung, ly, reeves and tian. All of them who reviewed our code gave some constructive criticisms on how they like our javadocs, test cases and the print out of the stack trace but at the same time they also pointed out some things that can be improve such as meaningful comments, user guide output example and fix build failed because of the missing "xbean.jar".
The DueDates project codes that I reviewed are the following:
First, the duedates-violet used few abstract classes and they implemented those really well. The only thing though I tried to run the verify but their program had couple checkstyle problems. Then, I also tried to run their program on the command line using my own information (id and lastname) with valid and invalid inputs but it only prints out a stack trace on both conditions.
Second, upon reviewing the duedates-red project code it was very neat, it has a nice output formatting and it prints out the correct error message. The only thing that they didn't have are test cases and their program didn't really check for invalid inputs. Finally, the last thing I reviewed is the duedates-yellow and they have the best output formatting that I've seen so far. Their program also output the right error message for valid and invalid inputs but their user manual didn't really have detailed information guide for external users in downloading and running the program.
Overview
By checking out or doing some reviews on other people's projects helped me on how to become a better programmer in the future. I have seen some really good program codes that I think will really help us to get some ideas from. And receiving those feedback from other peers on how to improve our project were very helpful. We are currently working on how to develop a better detailed user guide, meaningful comments and trying to analyze on how to fix the build.xml file that contains the error about the "xbean.jar".
Sunday, October 19, 2008
DueDates Project
DueDates-Purple Team
_____________________________________________________________________
Duedates is an application that keeps track of borrowed items (books, DVD, video, etc.) from the library. There are three members in our group: me, John Ancheta and Daniel Arakaki. Doing the duedates project with them was very interesting and helpful. From the very first day that the project was assigned, all the three of us met outside and discuss the days and times that we have to meet to accomplish the project. Therefore, we agreed to meet from Monday to Friday for at least 1-2 hours. And for the weekends, some of us has to go to work and take care of some other things, so we didn't agree to meet on Saturday and Sunday and we just decided to communicate through google chat and email.
I don't have a lot of experience using Subversion so John, who has the most experience really walk us through it in every step of the way. Especially, when I was having so much problems on SVN update and errors on Eclipse jars, he was there telling us not to give up because everything is going to be okay.
_____________________________________________________________________
Project Assigned
The part of the project that was assigned to me was the "UserGuide.wiki". The User guide was created in order for the "everyday user" to be able to comprehend the downloading and installation instructions in layman's terms, whereby making the installation of the program much easier. Here is the link for the user guide. Then, the Homepage was assigned to Daniel and the DeveloperGuide.wiki was assigned to John.
In addition, Daniel did most of the coding on the test cases for TestDueDates.java. I did a little bit of coding some methods on the DueDates.java and 1-2 test cases. And John was the one who gave us hints on how to complete our own assigned task and oversees if we are having problems accomplishing those particular tasks. Finally, he also fixed some errors on most of the codes and made sure that we understand what we were doing on the project.
_____________________________________________________________________
Overview
I have learned so much things on this project especially using Google Project Hosting and SVN. We had so much problems on Eclipse jars and on top of that we have different operating systems. So what does work on the other member's OS it doesn't work on the other one. Despite of everything happened we were still able to accomplish our project because of team work, sharing ideas and determination.
Here is our DueDates Distribution file: DueDates-1.0.1019.zip
Wednesday, October 8, 2008
SVN and Google Project Hosting with a partner
"The greatest good you can do for another is not just to share your riches but to reveal to him his own. "
In this week's second homework we are going to do a collaboration in software development by editing a partner's project on their stack implementation using SVN and Google Project Hosting. We didn't have a lot of time to do a side-by-side programming so we decided to just communicate through Google Chat.
______________________________________________________________________
Experience:
I did not really do a lot of heads up on this homework and I missed the class where they discuss about on how to use SVN Google Project Hosting. Therefore, I just installed the TortoiseSVN client on my laptop before the lab in the class and haven't gotten a chance to navigate through it. So, when I got home I was about to teach myself and try to remember what my partner[Ancheta] did on the previous homework. But I never got a chance to because we started chatting and he asked me some questions whether I am able to do a particular task.
Afterward, he downloaded, verified and modified my stack project default folder from build/classes/ to bin/ . Then, he sent me a confirmation that he made a commit (repository revision) on my project. Finally, I checked and verified (ant -f verify.build.xml) everything
____________________________________________________________________
Downloading partner's code and build:
I had a problem when I was editing my partner's project because I downloaded it from the incorrect location and when I tried to import it into Eclipse it got froze. So, when I told him that I was having a problem he pretty much walk me through it but that took a while because we are not sitting side-by-side to see each others screen so he can have a better look at what is going on. Nevertheless, we solved that particular problem so I downloaded his "stack-jnancheta" project on my desktop and verified it. Then, I changed the default output folder from build/classes/ to bin/. At the end, I commit the changes and an email was sent for confirmation.
____________________________________________________________________
Overview:
I love learning from other people especially when they share their wits with humility and shows an appreciation to their partner. My partner was really helpful and knowledgeable about using the SVN and Google Project Hosting. Although sometimes he works so fast and he wants everything to be done right on the spot but I understand because "time is gold". Using SVN and Google Project Hosting in an open source application is very convenient. As soon as you made the changes on a project it is available for a review right away by someone remotely.
Tuesday, October 7, 2008
TortoiseSVN and Google Project Hosting
SVN is a revision control system that maintains current and past versions of source code files, documentation, and web pages. In addition, SVN has three top level directories:
- trunk/ -- which represents the 'main line' of project development
- branches / -- contains subdirectories that holds the copy of the project
- tags/ -- contains subdirectories that each has the snapshot of the project which represents the record configuration of the project.
Modifying the existing Google Project:
I haven't gone far in modifying the existing google project. So since my partner John Ancheta already finished his homework he just pretty much helped me to accomplish this part of the homework.
First, we checkout the file that is located at http://code.google.com/p/stack- johnson/. Then, we run the "verify" target (ant -f verify.build.xml) and everything was all good. Then, we have to improve the project and we did this by putting additional test and run the "verify" target again and everything passes. Finally, we commit the change on the project to the repository.
____________________________________________________________________
Creating new Project:
In creating a new Google Hosting Project we have to obtain an SVN password first (like one of the SVN screenshot SAMPLE below).
____________________________________________________________________
Next, we added the instructor's email, which is "philipmjohnson@gmail.com" as an additional owner so he will be able to review our project setup. I also added my partner's email "jnancheta@gmail.com" on my member list. Then, we define "stack-flestado-discuss" in the discussion list and add the "codesite-noreply@google.com" as a list member. Later, we specified the trunk directory:
https://
Afterward, we did "SVN checkout" this is where you have to enter your repository URL (as shown below) and then entered gmail username and SVN password.
Next,we populate the trunk directory and added the files, then finally we did a commit (red ! indicates that the directory has been modified not committed) and all files should be now in the directory.
___________________________________________________________________
Overview:
Doing this particular task helps me to understand more about SVN and Google Project Hosting. The offered features and convenience of Google Project Hosting for open source projects is really good. All the modifications or updates is need to keep track especially for problem issues.
Wednesday, October 1, 2008
Testing Stack using Emma and Junit
Conclusion:[concat] Emma Coverage summary
[concat] class: 100% (3/3)
[concat] method: 73% (8/11)
[concat] block: 69% (65/94)
[concat] line: 75% (15/20)
The first thing I did was add some testing to my TestClearStack.java.
____________________________________________________________________
/**
* Test the top of stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the test process.
*/
@Test
public void testGetTop() throws EmptyStackException {
ClearStack stack = new ClearStack();
stack.push(two);
stack.push(three);
assertEquals("The top of stack is two", three, stack.getTop());
}
/**
* Test illegal empty of the stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testIllegalEmpty() throws EmptyStackException {
ClearStack stack = new ClearStack();
stack.push(one);
stack.isEmpty();
assertEquals("The stack is not empty", false, stack.isEmpty());
}
/**
* Test if the stack is empty.
* Should use JUnit 4 exception annotation!
*
*/
@Test
public void testLegalEmpty() {
ClearStack stack = new ClearStack();
stack.isEmpty();
assertEquals("The stack is empty", true, stack.isEmpty());
stack.push(two);
assertEquals("The stack is empty", false, stack.isEmpty());
}
************************************************
TestStack.java
************************************************
/**
* Test illegal getTop() of the stack.
*
* @exception EmptyStackException If errors during stack processing.
*/
@Test
public void testIllegalTop() throws EmptyStackException {
Stack stack = new Stack();
try {
stack.top();
fail("Top of empty stack did not generate exception.");
}
catch (EmptyStackException e) {
System.out.println(e);
}
}
/**
* Test legal get top of empty stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testLegalGetTop() throws EmptyStackException {
Stack stack = new Stack();
stack.push(two);
stack.push(three);
assertEquals("The top of stack is three", three, stack.top());
stack.pop();
assertEquals("The top of stack is two", two, stack.top());
}
/**
* Test legal pop of the stack.
* Should use JUnit 4 exception annotation!
*
* @throws EmptyStackException if the stack is empty during the process.
*/
@Test
public void testPop() throws EmptyStackException {
Stack stack = new Stack();
stack.push(two);
stack.push(three);
assertEquals("Testing pop of the top of the stack", three, stack.pop());
assertEquals("Testing pop of the top of the stack", two, stack.pop());
}
________________________________________________________________
When I added those test cases I obtained this coverage summary:
[concat] Emma Coverage summary
[concat] class: 100% (3/3)
[concat] method: 100% (11/11)
[concat] block: 100% (94/94)
[concat] line: 100% (20/20)
Here's the link for my final Stack build:
http://www2.hawaii.edu/~flestado/stack-flestado-final-build-6.0.1006.zip
The most important thing that I've learned in implementing different
test cases to improve the Emma coverage summary is doing thoroughly testing
and implementing the correct result assertion. For some reason every time I run
my JUnit test it gives some kind of "RemoteRunnerError, etc.". Therefore, I have
to actually "Clean" it first for my test to be able to run correctly. Adding some sort
of test cases into my TestStack.java and TestClearStack.java helped to improve my
Emma coverage summary. The only main thing that the Emma is detecting is how
many test case methods you implement but you can actually put those test cases in
one method except that it doesn't really increase the coverage summary.
Wednesday, September 24, 2008
11.Stack
____________________________________________________
GOAL:
To be able to get familiarize ourselves with the Ant build
system, open source automated quality assurance tools like
FindBugs, PMD, and CheckStyle, and build system structure.
TASK 1:
First, installing all the tools namely Ant, JUnit, PMD, FindBugs, and Checkstyle was easy . However, we have to set up all the Environment variables which I forgot to do after installing those tools. So when me and my partner was starting to do the Ant Lab in the class we had to actually set up all the paths for those tools and that took a while. After everything was set up invoking all the targets was fine except when I run the "ant -f junit.build.xml" it failed because and it's saying something about the testing of the TestStack.java. So I run the TestStack.java on Eclipse and the test failed because the the top() method in the Stack is trying
access the first one that is push on to the stack instead of the one that is on top
of the stack. And the other one is trying to pop something that has been already remove from the stack. So I fixed that one by modifying the Stack.java class and TestStack.java class.
- ant clean compile
- ant -f checkstyle.build.xml
- ant -f dist.build.xml
- ant -f findbugs.build.xml
- ant -f javadoc.build.xml
- ant -f junit.build.xml
- ant -f pmd.build.xml
- ant -f verify.build.xml
Here is the revised build stack file:
http://www2.hawaii.edu/~flestado/stack-flestado.zip
Sunday, September 14, 2008
CodeReview
GOAL:
To be able to identify any violations of
the Java coding standards and documentation.
Reviewer: Mari-Lee Flestado
Reviewee: Jeho Jung
File | Lines | Violation | Comments |
MyRuler.java | 1, 2,3, * | EJS-5 | Code is indented 4 spaces instead of 2 spaces |
MyRuler.java | 1 ,3 | EJS-SE-JAVA-2 | Code used the wildcard "*" in import statement |
MyRuler.java | 121,147 | EJS-22 | Code did not use lowercase for the first word for method names. |
MyRuler.java | 7, 156 | EJS-46 | Code did not use a fixed ordering for Javadoc tags. |
The logic of the code itself performs the task in a very efficient
manner. I did run the code also and what I really like about it is
how the knights captured the castle really fast and when the
knights captured the opponent's castle then it can create more
knights and peasants. That was one of the strategy that I tried
to implement in my own code but it didn't really work.
However, the only thing that I've notice was the lack of good
application of Java coding documentations which I have listed
above. But other than that he implemented a very interesting
strategy in his program.
Monday, September 8, 2008
05.CodeRuler
LESSON LEARNED FROM CODE RULER:
Time dedication is always been big part of programming. But in this project I think that was my biggest challenge. Because of time conflict with my former partner and my busy work schedule, communication in a timely manner was really hard. Unfortunately, he finally found someone else to do the project with .
The strategy that I came up with is :
- to release the peasants in different directions to claim unoccupied lands and opponent's lands
- when the opponent's peasants, knights and castles are more than ours we create more peasants, knights and castles.
- when there are peasants or knights on our way we capture then and finally capture the opponent's castle.
Source code and javadoc link:
www2.hawaii.edu/~flestado
RESULT:
_________________________
marilee vs. migrate ruler
_________________________
438 - 94
408 - 121
330 - 118
_________________________marilee vs. gang up ruler
_________________________
66 - 499
18 - 346
41 - 536
_________________________
marilee vs. split up ruler
_________________________
17 - 522
8 - 602
27 - 527
Among the three teams the hardest to compete with were the 2 groups(gang up and split up rulers), as you can see I got defeated pretty bad. I know I could have done better if I put more time in doing it. I think the reason why the 2 teams defeated me really bad was because I didn't develop a better strategy in attacking the enemy and protecting my castle, knights and peasants at the same time.
What I have learned about eclipse is remembering some of the features that I haven't use for a while. But comparing Eclipse to other IDE's out there, I would say that Eclipse has the best hands-on resources to help a lot of programmers .
Monday, September 1, 2008
OSS Experience
- OVERVIEW
The package Openbravo POS is a point of sale application that is designed for touch screen and it is also a program that allows user to be able to assign customers to receipts using the customer's loyalty card, create invoices, track the account of the customer, payments, customer's report execution, etc.
The Openbravo POS website (http://sourceforge.net/forum/forum.php?forum_id=861610) has the description of the package, introduction, download links, etc.
Finally, the main objective of this particular program or package is to provide convenience for multiusers to do products entry forms, charts, and reports.
_______________________________________________________
- Prime Directive #1: The system successfully accomplishes a useful task.
Therefore, I would say that Prime Directive #1 is satisfied.
_______________________________________________________
- Prime Directive #2: An external user can successfully install and use the system.
In the Login Panel above, I logged in as a manager (choose title: manager, employee, guest, administrator, etc.) and you get this panel below.
When you log in as a manager you are able to access the stock (inventory, warehouse, catalog), customer's information, sales reports and graphs, etc.
In contrast, logging in as an employee you can only access to certain features such processing transactions, editing sales, and password change.
In that case, Prime Directive #2 is satisfied.
_______________________________________________________
- Prime Directive #2: An external developer can successfully understand and enhance the system.
___________________________________________________________________
The Object Model
There are five objects passed to the scripts: ticket that contains the data of the current ticket, taxes that contains the list of available taxes record, place that in restaurant mode contains the table object, in other modes contains null, user that contains the user object and sales that contains utility methods of the sales panel.
- ticket. Contains all the information related to the ticket is an object of type TicketInfo
- place. Contains the table in restaurant mode. Is an object of type String.
- taxes. Contains a list of all the taxes. Is a map that contains objects of type TaxInfo.
- taxeslogic. Contains a list of methods that calculates the taxes lines of a current receipt. Is an object of type TaxesLogic.
- user. Contains the user that is currently logged in the application. Is an object of type AppUser.
- sales. Contains utility methods of the sales panel. Is an object of class ScriptObject.
Utility methods
The sales object available in scripts button and events contains a list of utility methods of the sales panel.
- getInputValue(). Returns the value typed in the sales panel using the on screen keyboard.
- getSelectedIndex(). Returns the index of the selected receipt line in the sales panel. If the receipt has no lines returs -1.
- setSelectedIndex(int i). Sets the index of the selected receipt line in the sales panel.
- printReport(String resourcefile). Prints a report using the current receipt using the included Jasper Reports engine. This command is useful if you want to print elaborated invoices from the sales panel.
- printTicket(String resourcename). Prints a receipt in the receipt printer.
- evalScript(String code, ScriptArg... args). Calls another script.
Attributes
Receipts, receipt lines and products have a list of properties called attributes. These attributes can be used for any purpose the developer needs. When adding a new receipt line Openbravo POS copies the attributes of the product to the line, Openbravo POS does not manage in any other way the content and values of these attributes, and is the developer of script buttons and events the responsible of managing its values.
These attributes are stored in the database and can be edited in the products panel as an XML text file. This is an example of a product attributes record:
http://java.sun.com/dtd/properties.dtd">Asian salad attributes Only available in spring. Letucce, and other vegetables
-- Openbravo POS Scripting Tutorial
http://wiki.openbravo.com/wiki/Openbravo_POS_Scripting_Tutorial#Examples
CONCLUSION
This Openbravo POS system basically fulfilled its main objective and it is very user friendly, flexible, and convenient, as well. Finally, the package is really easy to install and run and external developers can easily understand and enhance the system by using its scripting capabilities and other features.
Wednesday, August 27, 2008
Implementing FizzBuzz
/**
* FizzBuzz.java -- is a program that prints out "Fizz" if the number is multiples
* of 3,if the number is multiples of 5 then it will return "Buzz" and
* if the number is multiples of 3 & 5 then it will return "FizzBuzz".
*
* @author Mari-Lee Flestado
* @version Sample Quiz 1
*/
public class FizzBuzz {
public static void main(String args[]) {
FizzBuzz fb = new FizzBuzz();
for(int i = 0; i <= 100; i++){
System.out.println(fb.getResult(i));
}
}
/**
* This method checks or calculate if a number is multiples of 3,
* multiples of 5 and if the number is multiples of 3 & 5.
*
* @return String value
* @param num is input number
*/
public String getResult(int num) {
if(((num % 3) == 0) && ((num % 5) == 0)) {
return "FizzBuzz";
}
else if((num % 3) == 0) {
return "Fizz";
}
else if((num % 5) == 0) {
return "Buzz";
}
else {
return String.valueOf(num);
}
}
}