org.jbpm.formbuilder.client
Interface FormBuilderService

All Known Implementing Classes:
RestyFormBuilderModel

public interface FormBuilderService

Client's interface with the REST API server.


Nested Class Summary
static interface FormBuilderService.RolesResponseHandler
           
 
Method Summary
 void deleteFile(String url)
           
 void deleteForm(FormRepresentation form)
          Deletes a form from the server
 void deleteFormItem(String formItemName, FormItemRepresentation formItem)
          Deletes a UI component from the server
 void deleteMenuItem(String groupName, FBMenuItem item)
          Deletes a custom menu item from the server
 void generateForm(FormRepresentation form, String language, Map<String,Object> inputs)
          Translates a form.
 void getCurrentRoles(FormBuilderService.RolesResponseHandler handler)
           
 void getExistingIoAssociations(String filter)
          Returns the IoAssociations as matching on a simple string filter
 void getExistingValidations()
          Returns existing validations from the server
 void getFiles(List<String> types, FilesLoadedHandler handler)
           
 void getForm(String formName)
          Returns a single form
 void getForms()
          Returns all forms
 void getMenuItems()
          Gets a map of groups indexed by group name.
 void getMenuOptions()
          Gets a list of menu options, generally for a menu bar.
 String getUploadActionURL()
           
 String getUploadFileURL()
           
 void loadFormTemplate(FormRepresentation form, String language)
          Loads a file from the server that contains a given language's form template
 void logout()
           
 void populateRepresentationFactory()
          Populates the RepresentationFactory with the form items and representations that belong to them.
 void saveForm(FormRepresentation form)
          Saves a form on the server
 void saveFormItem(FormItemRepresentation formItem, String formItemName)
          Saves a UI component on the server
 void saveMenuItem(String groupName, FBMenuItem item)
          Saves a new (custom) menu item on the server
 void selectIoAssociation(String pkgName, String processName, String taskName)
          Fires a TaskSelectedEvent in case you can find the proper task in the server
 void setPackageName(String packageName)
           
 FormRepresentation toBasicForm(TaskRef task)
          Returns the form representation that basically describes a task
 

Method Detail

getMenuItems

void getMenuItems()
                  throws FormBuilderException
Gets a map of groups indexed by group name. Each group contains a list of menu items available in each group.

Throws:
FormBuilderException - in case of error.

getMenuOptions

void getMenuOptions()
                    throws FormBuilderException
Gets a list of menu options, generally for a menu bar. Each option has a name, and maybe a subMenu consisting of a list of menu options, or maybe a command, or maybe both.

Throws:
FormBuilderException - in case of error.

saveForm

void saveForm(FormRepresentation form)
              throws FormBuilderException
Saves a form on the server

Parameters:
form - The form to be saved
Throws:
FormBuilderException - in case of error

saveFormItem

void saveFormItem(FormItemRepresentation formItem,
                  String formItemName)
                  throws FormBuilderException
Saves a UI component on the server

Parameters:
formItem - the UI component to be saved
formItemName - the UI component name
Throws:
FormBuilderException - in case of error

deleteForm

void deleteForm(FormRepresentation form)
                throws FormBuilderException
Deletes a form from the server

Parameters:
form - The form to be deleted
Throws:
FormBuilderException - in case of error

deleteFile

void deleteFile(String url)
                throws FormBuilderException
Throws:
FormBuilderException

deleteFormItem

void deleteFormItem(String formItemName,
                    FormItemRepresentation formItem)
                    throws FormBuilderException
Deletes a UI component from the server

Parameters:
formItemName - The UI component name
formItem - the UI component to be deleted
Throws:
FormBuilderException - in case of error

generateForm

void generateForm(FormRepresentation form,
                  String language,
                  Map<String,Object> inputs)
                  throws FormBuilderException
Translates a form. An event exposes where to retrieve the form from.

Parameters:
form - Form to be translated
language - Language to translate the form
Throws:
FormBuilderException - in case of error

saveMenuItem

void saveMenuItem(String groupName,
                  FBMenuItem item)
                  throws FormBuilderException
Saves a new (custom) menu item on the server

Parameters:
groupName - Group name of the new menu item
item - The new menu item to be saved
Throws:
FormBuilderException - in case of error

deleteMenuItem

void deleteMenuItem(String groupName,
                    FBMenuItem item)
                    throws FormBuilderException
Deletes a custom menu item from the server

Parameters:
groupName - Group name of the custom menu item to be deleted
item - The custom menu item to be deleted
Throws:
FormBuilderException - in case of error

getExistingIoAssociations

void getExistingIoAssociations(String filter)
                               throws FormBuilderException
Returns the IoAssociations as matching on a simple string filter

Parameters:
filter - a filter for a google-like search textfield
Throws:
FormBuilderException - in case of error

selectIoAssociation

void selectIoAssociation(String pkgName,
                         String processName,
                         String taskName)
                         throws FormBuilderException
Fires a TaskSelectedEvent in case you can find the proper task in the server

Parameters:
pkgName - the name of the package
processName - the name of the process
taskName - the name of the task
Throws:
FormBuilderException - in case of error

getExistingValidations

void getExistingValidations()
                            throws FormBuilderException
Returns existing validations from the server

Throws:
FormBuilderException - in case of error

getForm

void getForm(String formName)
             throws FormBuilderException
Returns a single form

Parameters:
formName - the name of the form to be returned
Throws:
FormBuilderException - in case of error.

getForms

void getForms()
              throws FormBuilderException
Returns all forms

Throws:
FormBuilderException - in case of error.

populateRepresentationFactory

void populateRepresentationFactory()
                                   throws FormBuilderException
Populates the RepresentationFactory with the form items and representations that belong to them.

Parameters:
callback - callback to tell the client what to do once it finishes
Throws:
FormBuilderException - in case of error.

loadFormTemplate

void loadFormTemplate(FormRepresentation form,
                      String language)
                      throws FormBuilderException
Loads a file from the server that contains a given language's form template

Parameters:
form - the form representation to create a template from
language - the result template expected language
Throws:
FormBuilderException - in case of error.

getCurrentRoles

void getCurrentRoles(FormBuilderService.RolesResponseHandler handler)
                     throws FormBuilderException
Throws:
FormBuilderException

toBasicForm

FormRepresentation toBasicForm(TaskRef task)
Returns the form representation that basically describes a task

Parameters:
task - a task to be described
Returns:
a form representation for that task

getUploadFileURL

String getUploadFileURL()
Returns:
URL for uploading files to guvnor

getUploadActionURL

String getUploadActionURL()
Returns:
URL for mocking uploading files for form instances

setPackageName

void setPackageName(String packageName)

logout

void logout()

getFiles

void getFiles(List<String> types,
              FilesLoadedHandler handler)


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.