Class ModuleManager

java.lang.Object
org.openxava.controller.ModuleManager
All Implemented Interfaces:
Serializable

public class ModuleManager extends Object implements Serializable
Author:
Javier Paniza
See Also:
  • Constructor Details

    • ModuleManager

      public ModuleManager()
  • Method Details

    • getProduct

      public static final String getProduct()
    • getVersion

      public static final String getVersion()
    • getFormAction

      public String getFormAction(javax.servlet.http.HttpServletRequest request)
      HTML action bind to the current form.
      Returns:
    • addMetaAction

      public void addMetaAction(MetaAction action)
    • removeMetaAction

      public void removeMetaAction(MetaAction action)
    • registerAction

      public void registerAction(String qualifiedActionName)
      Since:
      7.6.3
    • getRowActionsNames

      public Collection<String> getRowActionsNames()
    • getSubcontrollerMetaActions

      public Collection<MetaAction> getSubcontrollerMetaActions(String controllerName)
      Since:
      5.5.1
    • getMetaControllerElements

      public Collection<MetaControllerElement> getMetaControllerElements()
    • getSubcontrollers

      public Collection<MetaSubcontroller> getSubcontrollers()
    • getMetaActions

      public Collection<MetaAction> getMetaActions()
    • getMetaActionsOnInit

      public Collection getMetaActionsOnInit()
    • getMetaActionsMode

      public Collection getMetaActionsMode()
    • getAllMetaActionsIterator

      public Iterator getAllMetaActionsIterator()
      An iterator over getMetaActions() and getMetaActionsMode().

    • getGoListAction

      public String getGoListAction()
      Since:
      6.1.2
    • hasProcessRequest

      public boolean hasProcessRequest(javax.servlet.http.HttpServletRequest request)
    • execute

      public void execute(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • log

      public void log(javax.servlet.http.HttpServletRequest request, String message)
    • isExecutingAction

      public boolean isExecutingAction()
      Since:
      5.9
    • executeAction

      public void executeAction(String qualifiedActionName, Messages errors, Messages messages, javax.servlet.http.HttpServletRequest request)
      Since:
      5.7
    • executeAction

      public void executeAction(String qualifiedActionName, Messages errors, Messages messages, String propertyValues, javax.servlet.http.HttpServletRequest request)
      Since:
      6.2
    • executeAction

      public void executeAction(IAction action, Messages errors, Messages messages, javax.servlet.http.HttpServletRequest request)
    • isActionAvailable

      public boolean isActionAvailable(MetaAction metaAction, Messages errors, Messages messages, String propertyValues, javax.servlet.http.HttpServletRequest request)
      Since:
      5.9
    • setControllers

      public void setControllers(String[] nextControllers)
      Since:
      4.2.2
    • manageException

      public static Messages manageException(Exception ex)
      Manages the exception using the same logic when executing an action and it fails.

      It includes the rollback if needed and log the error.

      Parameters:
      ex - The exception to manage.
      Returns:
      The errors extracted and curated from the exception and its causes.
      Since:
      7.6
    • resetPersistence

      public void resetPersistence()
      Init JPA in order to process the current request.
    • resetPersistence

      public static void resetPersistence(javax.servlet.http.HttpSession session)
      Init JPA in order to process the current request. Static version that accepts the session as parameter.
      Since:
      7.7
    • commit

      public static void commit()
      Commit the current JPA manager and Hibernate session, if they exist. Never fails.

      If fails it does a rollback and put a message in log, but it does not throw an exception. This method is intended to be used after rendering the UI content, not for commit in your own logic. If you want commit from your logic use BaseAction.commit(), XPersistence.commit() or XHibernate.commit().

    • parseMultipartRequest

      public void parseMultipartRequest(javax.servlet.http.HttpServletRequest request) throws org.apache.commons.fileupload.FileUploadException
      Throws:
      org.apache.commons.fileupload.FileUploadException
    • formUploadNextTime

      public void formUploadNextTime()
    • getEnvironment

      public Environment getEnvironment() throws XavaException
      Throws:
      XavaException
    • setControllersNames

      public void setControllersNames(String[] names)
    • restorePreviousControllers

      public void restorePreviousControllers() throws XavaException
      Throws:
      XavaException
    • memorizeControllers

      public void memorizeControllers() throws XavaException
      Throws:
      XavaException
    • getSession

      public javax.servlet.http.HttpSession getSession()
    • setSession

      public void setSession(javax.servlet.http.HttpSession session)
    • getViewURL

      public String getViewURL()
    • getApplicationName

      public String getApplicationName()
    • setApplicationName

      public void setApplicationName(String newName) throws XavaException
      Throws:
      XavaException
    • getModuleName

      public String getModuleName()
    • setModuleName

      public void setModuleName(String newModule) throws XavaException
      Throws:
      XavaException
    • getMetaModule

      public MetaModule getMetaModule() throws ElementNotFoundException, XavaException
      Throws:
      ElementNotFoundException
      XavaException
    • getModuleDescription

      public String getModuleDescription()
    • setModuleDescription

      public void setModuleDescription(String moduleDescription)
    • getModelName

      public String getModelName() throws XavaException
      Throws:
      XavaException
    • getTabName

      public String getTabName() throws XavaException
      Throws:
      XavaException
    • isListMode

      public boolean isListMode()
    • isSplitMode

      @Deprecated public boolean isSplitMode()
      Deprecated.
    • isDetailMode

      public boolean isDetailMode()
      Since:
      4m6
    • isDetailModeOnly

      public boolean isDetailModeOnly()
      Since:
      6.0
    • getModeName

      public String getModeName()
    • getDefaultActionQualifiedName

      public String getDefaultActionQualifiedName()
    • getDefaultMetaAction

      public MetaAction getDefaultMetaAction()
      Returns:
      null if not current default action.
      Since:
      5.4.1
    • isXavaView

      public boolean isXavaView(javax.servlet.http.HttpServletRequest request) throws XavaException
      Throws:
      XavaException
    • getXavaViewName

      public String getXavaViewName() throws XavaException
      Throws:
      XavaException
    • preInitModule

      public void preInitModule(javax.servlet.http.HttpServletRequest request)
    • initModule

      public void initModule(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • executeBeforeEachRequestActions

      public void executeBeforeEachRequestActions(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • executeBeforeLoadPage

      public void executeBeforeLoadPage(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • hasInitForwardActions

      public boolean hasInitForwardActions()
    • executeOnEachRequestActions

      public void executeOnEachRequestActions(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • executeAfterEachRequestActions

      public void executeAfterEachRequestActions(javax.servlet.http.HttpServletRequest request, Messages errors, Messages messages)
    • getEnctype

      public String getEnctype()
    • isButtonBarVisible

      public boolean isButtonBarVisible()
    • isCoreViaAJAX

      public boolean isCoreViaAJAX(javax.servlet.http.HttpServletRequest request)
      If true the first load of the core of the page on enter in a module is done via AJAX.
      It takes the value from xava.coreViaAJAX of the servlet session, so if you want it return false, write this code:
       session.setAttribute("xava.coreViaAJAX", false);
       
      Put it to false when you need several modules in the same page.
    • isBottomButtonsVisible

      public boolean isBottomButtonsVisible()
      Since:
      5.8
    • showButtons

      public void showButtons()
      Shows the top button bar and the buttons on bottom if they are hidden.
      Since:
      5.8
    • hideButtons

      public void hideButtons()
      Hides the top button bar and the buttons on bottom.
      Since:
      5.8
    • isFormUpload

      public boolean isFormUpload()
    • getNextModule

      public String getNextModule()
    • setNextModule

      public void setNextModule(String nextModule)
    • actionApplies

      public boolean actionApplies(MetaAction action)
    • isReloadAllUINeeded

      public boolean isReloadAllUINeeded()
    • isActionsChanged

      public boolean isActionsChanged()
      Is actions list change since the last action execution ?.

    • setActionsChanged

      public void setActionsChanged(boolean actionsChanged)
      Since:
      5.7
    • isReloadViewNeeded

      public boolean isReloadViewNeeded()
    • getPreviousModules

      public Stack<String> getPreviousModules()
    • setPreviousModules

      public void setPreviousModules(Stack<String> previousModules)
    • reset

      public void reset()
    • isShowDialog

      public boolean isShowDialog()
    • isHideDialog

      public boolean isHideDialog()
    • showDialog

      public void showDialog()
    • closeDialog

      public void closeDialog()
    • setRefiner

      public static void setRefiner(Object newRefiner)
    • setReseter

      public static void setReseter(Object newReseter)
      Since:
      5.2
    • getPermanlinkAction

      public String getPermanlinkAction()
      Since:
      5.7
    • getLastExecutedMetaAction

      public MetaAction getLastExecutedMetaAction()
    • getDialogLevel

      public int getDialogLevel()
    • setResetFormPostNeeded

      public void setResetFormPostNeeded(boolean resetFormPostNeeded)
    • isResetFormPostNeeded

      public boolean isResetFormPostNeeded()
    • getModuleURL

      public String getModuleURL()
      Since:
      5.9
    • setModuleURL

      public void setModuleURL(javax.servlet.http.HttpServletRequest request)
      Since:
      5.9
    • getDialogTitle

      public String getDialogTitle()
      Gets the dialog title based on the view title, last executed action and model name.
      Returns:
      The dialog title to be displayed
      Since:
      7.5