Schedules manager as an example of framework Grails and Groovy language use. Dominik Szymajda, Wojciech Zabierowski Abstract - - Planning work is a key issue in any enterprise. How the employer will lead his team depends the success or failure of each project. In dependence of the nature of the company there are different models of leadership and communication (autocratic, consultative, participative). Each of them is connected with a process of creating a schedule containing relation of monthly work time to the worker. Creating it is very time-consuming. The person responsible for it must take into account several criteria such as staff leave or rest time between shifts. In many enterprises, schedule change frequently, which makes effective planning hard. Now a days when computers are ubiquitous and accompanies us on every step still very popular method of creating work schedules remains a peace of paper and a pencil. While everything is becoming more automated, this crucial issue for all companies is still ignored. KeywordsSchedule, Work Management, Groovy, Grails
I.
WORKMANAGER
and allows series staff: to check his schedule, ▪ to send message to his manager, ▪ to plan Holiday. By choosing form of web portal we have gained the possibility of creating multi-access applications virtually unlimited range. The draft was written based on the Grails framework (version 1.2.1) and the programming language Groovy. As a programming environment was chosen open source software SpringSource Tool Suite and the operating system Windows XP. Database environment is a MySQL database. ▪
II. GROOVY AND GRAILS Groovy programming language was created in 2004. It is a scripting programming language whose syntax is largely based on Java. Inspired by such languages as Ruby, Perl, Python or Smalltalk, has many features that facilitate and accelerate the work associated with application development: closure, dynamic types, everything is an object, operators overload.
Fig. 1: Screen shot of WorkManager system To fill the gap presented in the summary has been designed and built the tool which goes in front of needs of employers and employees. The application was to develop the issue of personnel management, modern and effective solution, which is the evolution of the work planning methods. Built a system is characterized by high flexibility allowing to minimize direct contact manager-employee during the schedule design process. The application provides an advanced tool intended for both, parties sharing in the enterprise and the series staff. The system facilitates the work of the manager in: ▪ supervision of employee, ▪ holiday planning, ▪ work planing, ▪ graphic propagation among workers,
Grails. it is a young, because developed just the last 4 years, a set of tools for creating Web applications on the Java platform. Framework designers took all the best tools, mechanisms and technologies that already exist in other frameworks and combined in one powerful and advanced dynamic tool. As a result, developers are given a tool based on a very well known and proven tools, such as Spring and Hibernate, which allows them to spend more time working on the implementations of the functionality of the system, then the xml file edits, as it is in the work at the Spring-type applications. Grails gives you the opportunity to fully exploit the opportunities hidden in the dynamic language Groovy to create web applications by transferring the Rails-style thinking on the Java platform.
III. DATA MODEL Planning for the appropriate data model for the considered problem is an important component of any object-oriented software project. Data must be divided into modules, that groups the programmer need data. Data structure for web projects such as our website is even more important. In this case all data are collected on a remote server. This means that each page view is associated with the collection of certain information which must to be get from server. The more data is needed at one time, the more time that elapses from the moment the demand until they are received by the interface.
The programmer must design the structure to as much as possible reduce redundancy of data received by the user to as far as possible reduce associated with it delays. In addition, to big fragmentation of data results in a multiplication of inquiries to the server, which is also not a desirable phenomenon. The data model interfaces, hiding under the WorkManager portal consists of eleven interconnected relationships modules. The other main modules of the system are : Profile – The module is used to store personal data of employees; ▪ Company – Information about the company. The module also has a set of relationships to all users registered as ▪
generate the skeleton, which then serve to the user when creating the final plan had come. The basic criteria that we decided to take into account are: ▪ holidays, ▪ availability, ▪ time between the following shifts, ▪ the company can employ more people than there is working on one shift. ▪ company can work only on certain days of the week. On this basis, according to the algorithm presented below, is generated the skeleton of the new schedule.
Fig. 1: Object-relational WorkManager portal data model employees of the company; ▪ Schedule, DaySchedule – Modules containing data about the planned graphic work. Table Schedule is a link between the user and the task list stored in the table DaySchedule. As the name implies, each object class DaySchedule corresponds to one working day; ▪ Holiday – Data describing any breaks such as holidays or days off "on demand"; It is worth noting that information about a user are divided into two separate tables, User and Profiles. This treatment is designed to optimize the access time to data on the server.
IV. PLANNING SCHEDULE The main aim, which we regard to designing WorkManager portal is to facilitate the organization of work in the company. Creating a schedule from scratch is a tedious and time consuming task. Putting all the necessary data to a blank form is not particularly pleasant thing. This is why the idea to design a tool that on the basis of collected data, automatically
Fig. 2: Schedule skeleton generator The first stage of its operation is to set the initial conditions defining the number of performances of the basic loop. The algorithm will process the data until the initial conditions, or an error occurs. By the error understood is the lack of ability to meet the given conditions. If the first initial condition is passed the algorithm follows with the series of comparisons for the staff. There are three decisions blocks: ▪ users > 0 – check to see if that day is for the company a working day in a week and whether the number of staff assigned is not yet sufficient. If so, move on. ▪ isOnHoliday - check whether the employee you want to put on the template has not scheduled and approved leave. When an employee is available it checks the the third
condition. ▪ isWorkingDay – the last of the basic conditions check whether an employee is to be taken on a given day of the week. If all these conditions are considered positive, before adding the employee to schedule, now only remains for us to check whether a break since the last change is sufficiently long. For this purpose, the relevant calculations are performed. The fulfillment of the last block of the decision-making means adding an employee to schedule. This loop is repeated until the introduction of the scheme given the number of employees. To set final shape of the schedule, or modify it, is the view whose fragment is shown in Figure 3 Easily we can see that it is divided into a number of repeated parts. Each of these packages up the data on one day of work. You can schedule planning appropriately allocated, and if necessary remove the workers from each of these modules. Each person is assigned to work start time, end and intended for
implementation at the time the job. To add someone to your schedule for the day, choose its name in the drop-down list, then press the 'Add' button. Our actions can end up with three classes of shares. The first of them, and most obvious is the addition of the employee. This means that the employee meets all the criteria. The second is connected to share feedback with the condition 'isWorkingDay'. When he is not passed the employee, as in the first case, will be added to the list but at the same time the user will be given additional information in a message indicating the situation. The third and final possibility is due to a positive test 'isOnHoliday' result. This results in displaying only the message, without placing the chosen employee on the schedule.
V. SECURITY Written by us application is not a random access system. This means that before seeing most of the content user is required to authenticate him self. This is understandable requirement. Because of the purpose of application it will contain the confidential contents, such as employees personal data. The second important issue related to security, which
had to be taken into account, is to protect those personal data. The need to impose on us the law on the protection of personal data. In practice this meant encryption of information before being placed in the database. This meant the need of implementation a mechanism for encryption and decryption and to concatenate the processed data with the GORM mechanism. To protect the data has been AES cipher used. Connecting it to the application was divided into two stages. The first of these was the creation of a convenient interface to encrypt and decrypt information. Then it was to connect those method to the data model in way which will not disrupt the activities of the portal. This meant a need to define own validators for each value, and additional features that would display decrypted data in to the form after saved the information in the database. To this, have been used methods, which are used by Grails'a appropriately before writing to the database, after the record, and after collecting data from the server: def beforeInsert, def beforeUpdate, def afterInsert, def afterUpdate, def afterLoad. The data is encrypted just before sending to the server and decrypted immediately after recording, or by downloading from the database. The way of user authentication used in application is popular in each web site having a protected access. It is based on admission to most parts of the site, only persons who have on the site registered and an active account. After examining the design assumptions we found that the required number of access levels is three. Because of the site destination, users can be divided into two groups. The first level of access to basic ROLE_USER corresponding serial workers, whose impact on the planning work is limited, and the second with a level of ROLE_SUPERUSER. Users belonging to the second group have access to more advanced service options. They can manage their employees by adding, editing or deleting the account, create and modify graphics work. In addition, the system has a user-level permissions ROLE_ADMIN allowing system administration. In the application, there are two ways of registration of new users. The first in which the new company and user account are created, and the second where new user is attached to the company. Register a new business is divided into two stages, during which in turn are placed on the company and user. When creating a new business account is the company's unique code generated. It will be particularly important for companies that have many employees. The purpose of its creation is to enable workers to hand-registration which will speed up the process.
VI. DATA CONSISTENCY By allowing multiple users to edit the same information, such as personal data, introduces the consideration of data integrity issues. Since two different people, can change the same content, at the same time, the question arises that the data is valid and should be stored in the database on the server. As written by us was applied to the strategy that says the pool of all modified data Ax, from A collection, where x = 1 .. n, A1 will be saved. This means that when two users change the content of the downloaded information, and will
want to save them back to the server, will be introduced modification of the user who will do it first.
VII. SUMMARY The project has been used only Open Source solutions. This shows that based solely on free tools, the programmer is able to create a fully functional web application. These technologies are fully match the paid solutions, and in some respects even better. A rich source of information gathered on the Internet is a great help in working with both the Groovy language and Grails framework. They fully compensate the small number of specialist books resulting from the relatively "young age" of technology used.
VII. BIBLIOGRAPHY
Fig. 4: Update decision tree With the additional variable we are able to easily and quickly downloaded and modified locally information compare with those located on the server. Chart included in Fig. 6 shows the update process. Before recording the data is collected from the server version field value. If it agrees with the value taken in advance, that means that the data on a server not been updated in the meantime by another user and the program can start recording. Before the write-down versions of the variable is incremented and sent with the new data to the server. The negative comparison of this will mean that the data on which we have operated are no longer valid, the entry will be interrupted and remote data will be reached.
Dominik Szymajda, PhD.Eng. Wojciech Zabierowski Departament of Microelectronics and Computer Science Technical University Of Lodz Wolczanska Str. 221/223 B18, 90-924 Lodz, POLAND E-mail:
[email protected]
[1] Christopher M. Judd, Joseph Faisal Nusairat, James Shingler „Beginning Groovy and Grails From Novice to Professional”, ©2008 by Christopher M. Judd, Joseph Faisal Nusairat, James Shingler, ISBN-13 (electronic): 978-1-4302-1046-7 [2] Grails project web page: http://www.grails.org (checked 14.09.2010) [3] PILICHOWSKI M., SAKOWICZ B., CHŁAPIŃSKI J.; “Real-time Auction Service Application Based on Frameworks Available fpr J2EE Platform”, pp. 166-169, Proceedings of the Xth International Conference TCSET’2010, “Modern Problems of Radio Engineering, Telecommunications and Computer Science”, LvivSlavsko, Ukraina, 23-27 February 2010, s.380, A4, wyd. Publishing House of Lviv Polytechnic National University 2010, ISBN 978-966-553-875-2