OBEROn SDK

com.oberon.client.common
Class Forms

java.lang.Object
  extended by com.oberon.client.common.Forms

public class Forms
extends java.lang.Object

Contains all static methods to manage OBEROn forms with SWT controls

Version:
5.0

Field Summary
static java.lang.String[] regExpressions
          Regular Expression Aliases for form fields: [ "USERNAME", "PASSWORD", "EMAIL", "WEB", "URL", "IP", "COLOR", "PHONE", "TIME", "PERC", "CREDIT-CARD" ]
 
Constructor Summary
Forms()
           
 
Method Summary
static void clearSearchResults(java.lang.String formHTMLName, ApplicationSession session)
          Remove the last search result from the session
static org.eclipse.swt.custom.ScrolledComposite createForm(org.eclipse.swt.widgets.Composite parent, java.lang.String actionPage, ObjectBase objlink, Form form, ApplicationRequest request)
          Generates the SWT form panel according to the OBEROn Form definition and the object/link values
static org.eclipse.swt.widgets.Composite createObjectMenu(org.eclipse.swt.widgets.Composite parent, ApplicationSession session)
          Creates the object contextual menu
static org.eclipse.swt.custom.ScrolledComposite createSearchForm(org.eclipse.swt.widgets.Composite parent, java.lang.String actionPage, Form form, ApplicationRequest request)
          Generates the SWT search form panel according to the OBEROn Form definition
static java.util.Comparator<?> displayTagComparator(java.lang.String formatTags, java.util.Locale locale)
          Returns the sort Comparator according to the format Tag
static void fillObjectPopUpMenu(org.eclipse.swt.widgets.Menu menu, org.eclipse.swt.widgets.Composite parent, java.lang.String sID, java.lang.String sLinkID, ApplicationSession session)
           
static java.lang.String getErrorMessage(ApplicationSession session)
          Checks and retrieves an error message for the latest operation from the session
static java.lang.String getFormHTMLName(Form form)
          Gets the form name removing the spaces and the '-' char
static java.util.Vector<java.lang.String> getSearchResults(java.lang.String formHTMLName, ApplicationSession session)
          Retrieve the last search result from the session
static java.lang.String getTranslatedValue(java.lang.String section, java.lang.String keyFormat, java.lang.String subKey, Framework framework)
          Returns a sub-keyword translation
static ApplicationRequest prepareRequest(org.eclipse.swt.widgets.Widget form, boolean clone)
           
static java.lang.String saveFormData(java.lang.String forwardPage, ObjectBase objlink, Form form, ApplicationRequest request)
          Update the object/link fields
static java.lang.String searchObjects(Form form, ApplicationRequest request)
          Perform the search process according to the search filters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regExpressions

public static final java.lang.String[] regExpressions
Regular Expression Aliases for form fields: [ "USERNAME", "PASSWORD", "EMAIL", "WEB", "URL", "IP", "COLOR", "PHONE", "TIME", "PERC", "CREDIT-CARD" ]

Constructor Detail

Forms

public Forms()
Method Detail

getTranslatedValue

public static java.lang.String getTranslatedValue(java.lang.String section,
                                                  java.lang.String keyFormat,
                                                  java.lang.String subKey,
                                                  Framework framework)
                                           throws java.lang.Exception
Returns a sub-keyword translation

Parameters:
section - the dictionary section
keyFormat - the format string including the label tag that represents the keyword name
subKey - the sub-keyword name
framework - the current framework
Throws:
java.lang.Exception

displayTagComparator

public static java.util.Comparator<?> displayTagComparator(java.lang.String formatTags,
                                                           java.util.Locale locale)
Returns the sort Comparator according to the format Tag

Parameters:
formatTags - format string including the item/column value format tag
locale - current locale

getFormHTMLName

public static java.lang.String getFormHTMLName(Form form)
Gets the form name removing the spaces and the '-' char


createForm

public static org.eclipse.swt.custom.ScrolledComposite createForm(org.eclipse.swt.widgets.Composite parent,
                                                                  java.lang.String actionPage,
                                                                  ObjectBase objlink,
                                                                  Form form,
                                                                  ApplicationRequest request)
Generates the SWT form panel according to the OBEROn Form definition and the object/link values

Parameters:
parent - the parent SWT widget
actionPage - the forward action page
objlink - the ObjectObj or Link object
form - the Form administrative object
request - the Application request including the input parameters

createSearchForm

public static org.eclipse.swt.custom.ScrolledComposite createSearchForm(org.eclipse.swt.widgets.Composite parent,
                                                                        java.lang.String actionPage,
                                                                        Form form,
                                                                        ApplicationRequest request)
Generates the SWT search form panel according to the OBEROn Form definition

Parameters:
parent - the parent SWT widget
actionPage - the forward search action page
form - the {link @Form} administrative object with search filters
request - the Application request including the input parameters

saveFormData

public static java.lang.String saveFormData(java.lang.String forwardPage,
                                            ObjectBase objlink,
                                            Form form,
                                            ApplicationRequest request)
                                     throws java.lang.Exception
Update the object/link fields

Parameters:
forwardPage - the forward page
objlink - the ObjectObj or Link object
form - the Form administrative object
request - the Application request including the input parameters (field values)
Throws:
java.lang.Exception

searchObjects

public static java.lang.String searchObjects(Form form,
                                             ApplicationRequest request)
                                      throws java.lang.Exception
Perform the search process according to the search filters

Parameters:
form - the Form administrative object
request - the Application request including the input parameters (filter values)
Throws:
java.lang.Exception

getSearchResults

public static java.util.Vector<java.lang.String> getSearchResults(java.lang.String formHTMLName,
                                                                  ApplicationSession session)
                                                           throws java.lang.Exception
Retrieve the last search result from the session

Parameters:
formHTMLName - the search form name
session - current Application session
Throws:
java.lang.Exception

clearSearchResults

public static void clearSearchResults(java.lang.String formHTMLName,
                                      ApplicationSession session)
                               throws java.lang.Exception
Remove the last search result from the session

Parameters:
formHTMLName - the search form name
session - current Application session
Throws:
java.lang.Exception

prepareRequest

public static ApplicationRequest prepareRequest(org.eclipse.swt.widgets.Widget form,
                                                boolean clone)

getErrorMessage

public static java.lang.String getErrorMessage(ApplicationSession session)
Checks and retrieves an error message for the latest operation from the session


createObjectMenu

public static org.eclipse.swt.widgets.Composite createObjectMenu(org.eclipse.swt.widgets.Composite parent,
                                                                 ApplicationSession session)
Creates the object contextual menu

Parameters:
parent - the SWT widget parent
session - the Application session
Returns:
the menu panel if object is stored inside the session; null otherwise

fillObjectPopUpMenu

public static void fillObjectPopUpMenu(org.eclipse.swt.widgets.Menu menu,
                                       org.eclipse.swt.widgets.Composite parent,
                                       java.lang.String sID,
                                       java.lang.String sLinkID,
                                       ApplicationSession session)
                                throws java.lang.Exception
Throws:
java.lang.Exception

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.