Ejemplo n.º 1
0
 /**
  * Will dump all created keys of the current localizer via log4j and returns an empty response.
  *
  * @return empty response
  */
 public WOActionResults dumpCreatedKeysAction() {
   if (ERXApplication.isDevelopmentModeSafe()) {
     session();
     ERXLocalizer.currentLocalizer().dumpCreatedKeys();
     return new ERXResponse();
   }
   return null;
 }
Ejemplo n.º 2
0
 @Override
 public void finishInitialization() {
 	super.finishInitialization();
 	
 	// Setup main navigation
 	ERXNavigationManager.manager().configureNavigation();
 	
 }
Ejemplo n.º 3
0
  /**
   * Terminates the application when in development.
   *
   * @return "OK" if application has been shut down
   */
  public WOActionResults stopAction() {
    ERXResponse response = new ERXResponse();
    response.setHeader("text/plain", "Content-Type");

    if (ERXApplication.isDevelopmentModeSafe()) {
      WOApplication.application().terminate();
      response.setContent("OK");
    } else {
      response.setStatus(401);
    }

    return response;
  }
 public <T extends WOComponent> T pageWithName(Class<T> componentClass) {
   if (log.isDebugEnabled())
     log.debug(
         "Controller named '"
                     + getClass().getName()
                     + "' which was originally created on "
                     + pageNameThatCreated
                     + "' is creating pageWithName '"
                     + componentClass.getName()
                     + "' while performing action in page '"
                     + ERXWOContext.currentContext()
                 == null
             ? "Unknown"
             : ERXWOContext.currentContext().page().name() + "'");
   return ERXApplication.erxApplication().pageWithName(componentClass);
 }
Ejemplo n.º 5
0
 /**
  * Checks if the action can be executed.
  *
  * @param passwordKey the password to test
  * @return <code>true</code> if action is allowed to be invoked
  */
 protected boolean canPerformActionWithPasswordKey(String passwordKey) {
   if (ERXApplication.isDevelopmentModeSafe()) {
     return true;
   }
   String password = ERXProperties.decryptedStringForKey(passwordKey);
   if (password == null || password.length() == 0) {
     log.error("Attempt to use action when key is not set: " + passwordKey);
     return false;
   }
   String requestPassword = request().stringFormValueForKey("pw");
   if (requestPassword == null) {
     requestPassword = (String) context().session().objectForKey("ERXDirectAction." + passwordKey);
   } else {
     context().session().setObjectForKey(requestPassword, "ERXDirectAction." + passwordKey);
   }
   if (requestPassword == null || requestPassword.length() == 0) {
     return false;
   }
   return password.equals(requestPassword);
 }
Ejemplo n.º 6
0
 /**
  * Opens the localizer edit page if the app is in development mode.
  *
  * @return localizer editor
  */
 public WOActionResults editLocalizedFilesAction() {
   if (ERXApplication.isDevelopmentModeSafe()) {
     return pageWithName(ERXLocalizationEditor.class);
   }
   return null;
 }
Ejemplo n.º 7
0
	public static void main(String[] argv) {
		ERXApplication.main(argv, Application.class);
	}