View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:Resources And Reservation Management/Technical Documentation

Contents

Module Definition


Database Code

Tables

OBRE_CALENDAR

Column Datatype Nullable
OBRE_CALENDAR_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No
DESCRIPTION NVARCHAR2(255 CHAR) Yes
RESERVATION_UOM VARCHAR2(60 BYTE) No
ISSHOWWEEKEND CHAR(1 BYTE) No


OBRE_CALEN_UNAVAILABILITY

Column Datatype Nullable
OBRE_CALEN_UNAVAILABILITY_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_CALENDAR_ID VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No
ISMONDAY CHAR(1 BYTE) No
ISTUESDAY CHAR(1 BYTE) No
ISWEDNESDAY CHAR(1 BYTE) No
ISTHURSDAY CHAR(1 BYTE) No
ISFRIDAY CHAR(1 BYTE) No
ISSATURDAY CHAR(1 BYTE) No
ISSUNDAY CHAR(1 BYTE) No
ISALLDAYS CHAR(1 BYTE) No
START_DATE DATE Yes
END_DATE DATE Yes
ISFULLDAY CHAR(1 BYTE) No
START_TIME DATE Yes
END_TIME DATE Yes


OBRE_RESERVATION

Column Datatype Nullable
OBRE_RESERVATION_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
C_PROJECT_ID VARCHAR2(32 BYTE) Yes
OBRE_RESOURCE_ID VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) Yes
DESCRIPTION NVARCHAR2(255 CHAR) Yes
START_TIME DATE No
END_TIME DATE Yes
C_BPARTNER_ID VARCHAR2(32 BYTE) No
AD_USER_ID VARCHAR2(32 BYTE) Yes
C_ORDERLINE_ID VARCHAR2(32 BYTE) Yes
ISALLDAY CHAR(1 BYTE) No
AUXILIARY VARCHAR2(2000 BYTE) Yes
LINKED_TO_RESERVATION VARCHAR2(32 BYTE) Yes


OBRE_RESERVATION_EXTRA_I

Column Datatype Nullable
OBRE_RESERVATION_EXTRA_I_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_RESERVATION_ID VARCHAR2(32 BYTE) No
OBRE_RES_EXTRA_ID VARCHAR2(32 BYTE) No


OBRE_RESERVATION_TEMPLATE

Column Datatype Nullable
OBRE_RESERVATION_TEMPLATE_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
TEMPLATE NVARCHAR2(2000 CHAR) No


OBRE_RES_EXTRA

Column Datatype Nullable
OBRE_RES_EXTRA_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No
M_PRODUCT_ID VARCHAR2(32 BYTE) No
CHARGE_TYPE VARCHAR2(60 BYTE) No
QUANTITY NUMBER No


OBRE_RES_EXTRA_GROUP

Column Datatype Nullable
OBRE_RES_EXTRA_GROUP_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No


OBRE_RES_EXTRAGROUP_LINK

Column Datatype Nullable
OBRE_RES_EXTRAGROUP_LINK_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_RES_EXTRA_GROUP_ID VARCHAR2(32 BYTE) No
OBRE_RES_EXTRA_ID VARCHAR2(32 BYTE) No
SEQNO NUMBER(10,0) No

OBRE_RESOURCE

Column Datatype Nullable
OBRE_RESOURCE_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
VALUE NVARCHAR2(40 CHAR) No
NAME NVARCHAR2(60 CHAR) No
DESCRIPTION NVARCHAR2(255 CHAR) Yes
RESOURCE_TYPE VARCHAR2(60 BYTE) No
OBRE_RESOURCE_CATEGORY_ID VARCHAR2(32 BYTE) No
C_LOCATION_ID VARCHAR2(32 BYTE) Yes
C_BPARTNER_ID VARCHAR2(32 BYTE) Yes
M_PRODUCT_CATEGORY_ID VARCHAR2(32 BYTE) No
HASCAPACITY CHAR(1 BYTE) No
C_UOM_ID VARCHAR2(32 BYTE) Yes
CAPACITY_DEFAULT NUMBER(10,0) Yes
CAPACITY_MAX NUMBER(10,0) Yes
ISOVERLAPALLOWED CHAR(1 BYTE) No
IMAGE VARCHAR2(32 BYTE) Yes
A_ASSET_ID VARCHAR2(32 BYTE) Yes
OBRE_CALENDAR_ID VARCHAR2(32 BYTE) No
RESERVATIONCONTROLLER VARCHAR2(60 BYTE) Yes
M_PRODUCT_ID VARCHAR2(32 BYTE) Yes
ISBOOKABLEONLINE CHAR(1 BYTE) No
ISBOOKABLEBYALLUSERS CHAR(1 BYTE) No
ISBACKDATEDRESERVATIONS CHAR(1 BYTE) No
ISRESERVATIONCHANGES CHAR(1 BYTE) No
TIME_AHEAD_BEFORE_CHANGES NUMBER No
OBRE_RESOURCE_GROUP_ID VARCHAR2(32 BYTE) Yes
MIN_RESERVATION_DURATION NUMBER Yes
MAX_RESERVATION_DURATION NUMBER Yes
MULTIPLE_RESERVATION_DURATION NUMBER Yes
OBRE_RES_EXTRA_GROUP_ID VARCHAR2(32 BYTE) Yes
ISRESOURCEPACK CHAR(1 BYTE) No
ISMUTUALLYEXCLUDEDPACKMEMBERS CHAR(1 BYTE) No
OBRE_RES_DISCOUNT_ID VARCHAR2(32 BYTE) Yes

OBRE_RESOURCE_AUTHUSERS

Column Datatype Nullable
OBRE_RESOURCE_AUTHUSERS_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_RESOURCE_ID VARCHAR2(32 BYTE) No
AD_USER_ID VARCHAR2(32 BYTE) No


OBRE_RESOURCE_CATEGORY

Column Datatype Nullable
OBRE_RESOURCE_CATEGORY_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No
DESCRIPTION NVARCHAR2(255 CHAR) Yes
ISSUMMARY CHAR(1 BYTE) No


OBRE_RESOURCE_GROUP

Column Datatype Nullable
OBRE_RESOURCE_GROUP_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
SEQNO NUMBER(10,0) No
NAME NVARCHAR2(60 CHAR) No
DESCRIPTION NVARCHAR2(255 CHAR) Yes

OBRE_RESOURCE_PACKMEMBERS

Column Datatype Nullable
OBRE_RESOURCE_PACKMEMBERS_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_RESOURCE_ID VARCHAR2(32 BYTE) No
PACKMEMBER_ID VARCHAR2(32 BYTE) No


OBRE_RES_DISCOUNT

Column Datatype Nullable
OBRE_RES_DISCOUNT_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No


OBRE_RES_DISCOUNT_RULES

Column Datatype Nullable
OBRE_RES_DISCOUNT_RULES_ID VARCHAR2(32 BYTE) No
AD_CLIENT_ID VARCHAR2(32 BYTE) No
AD_ORG_ID VARCHAR2(32 BYTE) No
ISACTIVE CHAR(1 BYTE) No
CREATED DATE No
CREATEDBY VARCHAR2(32 BYTE) No
UPDATED DATE No
UPDATEDBY VARCHAR2(32 BYTE) No
OBRE_RES_DISCOUNT_ID VARCHAR2(32 BYTE) No
NAME NVARCHAR2(60 CHAR) No
DISCOUNT NUMBER Yes
PRIORITY NUMBER(10,0) No
ISMONDAY CHAR(1 BYTE) No
ISTUESDAY CHAR(1 BYTE) No
ISWEDNESDAY CHAR(1 BYTE) No
ISTHURSDAY CHAR(1 BYTE) No
ISFRIDAY CHAR(1 BYTE) No
ISSATURDAY CHAR(1 BYTE) No
ISSUNDAY CHAR(1 BYTE) No
ISALLDAYS CHAR(1 BYTE) No
START_DATE DATE Yes
END_DATE DATE Yes
ISFULLDAY CHAR(1 BYTE) No
START_TIME DATE Yes
END_TIME DATE Yes

Functions

OBRE_GETRESERVATIONDURATION

OBRE_GETRESERVATIONS

Triggers

OBRE_RESOURCE_CATEGORY_TRG

Java Code

The module's java code is divided into the following packages and classes:

Obre resource class diagram.png

org.openbravo.module.resources.calendar

org.openbravo.module.resources.calendar.ReservationController

Abstract class that must be implemented by the ReservationControllers. ReservationControllers are invoked when a resource is created/updated, they are in charge of doing additional stuff needed for the resource, such as creating Order for it. Different resources can have different controllers, matching between controllers and resources is done based on the Qualifier the ReservationController has. In case no ReservationController is found, the BasicReservationController is used.

It defines the following abstract methods: abstract public void doPreInsert(Map<String, String> parameters, JSONObject toInsert);

abstract public void doPreUpdate(Map<String, String> parameters, JSONObject toUpdate);
abstract public void doPreRemove(Map<String, String> parameters, JSONObject toRemove);
abstract public void doPostFetch(Map<String, String> parameters, JSONObject fetched);
abstract public void doPostInsert(Map<String, String> parameters, JSONObject inserted,
      String originalToInsert);
abstract public void doPostUpdate(Map<String, String> parameters, JSONObject updated,
      String originalToUpdate);
abstract public void doPostRemove(Map<String, String> parameters, JSONObject removed);

org.openbravo.module.resources.calendar.BasicReservationController

BasicReservationController is the Default ReservationController which is used in case there is no controller for the given resource. It creates a sales order for the reservation

org.openbravo.module.resources.calendar.ReservationAvailabilityUtilities

Java implementation of the Javascript code in /web/org.openbravo.modules.resources/js/calendar/ob-datetimeavailability-functions.js

Contains a list of utilities methods used for working with the Calendar widget.


org.openbravo.module.resources.calendar.ReservationUtilities

List of utilities methods used mainly by the BasicReservationController to create the Sales Order associated to the reservation


org.openbravo.module.resources.calendar.ResourcesCalendarActionHandler

ActionHandler associated to the Calendar widget that manages the reservations


org.openbravo.module.resources.calendar.ResourcesCalendarDataSource

DataSource associated with the OBRE_Reservation class (that represents the reservations).


org.openbravo.module.resources.calendar.email

org.openbravo.module.resources.calendar.email.ReservationEmailBody

Class that extends PortalEmailBody, which is in charge of providing the necessary data to fill the email Freemaker template sent when creating/updating/cancelling a reservation.

The email template can be either defined by organization (stored in the OBRE_Reservation_Template table). In case no template is defined for the organization, the default reservation-body.ftl is used instead.

The class contains methods for getting: the Sales Order object, the user that created the reservation, the starting or ending time for the reservation, etc.


When customizing the template, the available non-static texts (i.e., the text that dynamically changes in the template, like the order no., reservation's starting date, etc.) are associated with those methods. For example, the ${data.orderDocNo} variable in the template is associated with the getOrderDocNo() method. This basically means that the dynamic text is restricted, and you can only include into the template the info provided by them (which are usually enough for the reservation email purpose).


org.openbravo.module.resources.calendar.email.ReservationEmailGenerator

Class implementing the EmailEventContentGenerator interface. It is in charge of generating the reservation email. The getAttachments() method generates an iCalendar file with the reservation info that is attached to the email.


org.openbravo.module.resources.callout

Contains module's callouts

org.openbravo.module.resources.callout.UpdateAllDay

Callout that sets the Is All Day field (Reservation info) to Yes in case the associated reservation calendar is set to Daily


org.openbravo.module.resources.constants

Define constants

org.openbravo.module.resources.constants.OBRE_Constant

Defines a few public static constants referenced by other classes in the module


org.openbravo.module.resources.event

Contain classes that extend from EntityPersistenceEventObserver

org.openbravo.module.resources.event.ReservationEventObserver

Class that extends EntityPersistenceEventObserver and it's in charge of the backend validations before saving/updating/deleting a reservation. For example, it checks there is no reservation overlap for the same resource, that the reservation respects the resource's minimum and maximum duration, etc. It's also a way to ensure no hacks are done by the user in the frontend.


org.openbravo.module.resources.event.ResourceEventObserver

Class that extends EntityPersistenceEventObserver and it's in charge of the backend validations before saving/updating/deleting a resource.


org.openbravo.module.resources.initializer

Implementations of ApplicationInitializer

org.openbravo.module.resources.initializer.ResourcesInitializer

Class that implements the ApplicationInitializer interface. It registers the following SQL functions in order to be used by DAL:


org.openbravo.module.resources.util

Contains Utility classes

org.openbravo.module.resources.util.CloneRecordActionHandler

Class that extends the BaseActionHandler, which manages the process of cloning a resource available as an icon at the Resource window toolbar


org.openbravo.module.resources.util.GenericDateUtils

Contains utility methods for working with dates, like getYear(), getMinute(), getMinDate, getLastDateOfMonth(), etc.


org.openbravo.module.resources.util.Utility

Contains general utility methods for the module


org.openbravo.module.resources.widget

org.openbravo.module.resources.widget.OBREWidgetComponentProvider

Class that extends BaseComponentProvider which defines the JS scripts implemented by the module

Javascript Code

web/org.openbravo.module.resources/js/calendar

ob-datetimeavailability-functions.js

Contains a list of functions used for handling time availabilities

ob-myorderswithreservationinfo-widget.js

OBGridLink extension to provide a link to direct reservation edition

ob-resourcescalendar-widget.js

It contains the custom code in charge of build the reservation multicalendar. It has two parts:


ob-toolbar-customizations.js

It registers the clone button for the needed windows. Related to org.openbravo.module.resources.util.CloneRecordActionHandler

Retrieved from "http://wiki.openbravo.com/wiki/Projects:Resources_And_Reservation_Management/Technical_Documentation"

This page has been accessed 1,336 times. This page was last modified on 2 July 2013, at 18:07. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.