Package

Source Code of EditConfiguration

// Generated by the WebObjects Wizard Mon Apr 02 09:50:19 America/Boise 2001

import com.gammastream.validity.GSVRule;
import com.webobjects.appserver.WOApplication;
import com.webobjects.appserver.WOComponent;
import com.webobjects.appserver.WOContext;
import com.webobjects.foundation.NSMutableArray;
import com.webobjects.foundation.NSMutableDictionary;

public class EditConfiguration extends WOComponent {

    protected Application app = (Application)WOApplication.application();
    protected boolean showPassword;
    protected boolean showFontList;
    protected boolean showQuickRules;
    protected boolean showRecent;
    protected GSVRule currentRule;
    protected String currentPath;
    protected boolean showBlank=true;


    public EditConfiguration(WOContext arg0) {
    super(arg0);
    // TODO Auto-generated constructor stub
  }

  public WOComponent recentAction() {
        showPassword = false;
        showQuickRules = false;
        showRecent = true;
        showBlank = false;
        showFontList = false;
        return null;
    }

    public WOComponent quickRulesAction() {
        showPassword = false;
        showQuickRules = true;
        showRecent = false;
        showBlank = false;
        showFontList = false;
        return null;
    }

    public WOComponent passwordAction() {
        showPassword = true;
        showQuickRules = false;
        showRecent = false;
        showBlank = false;
        showFontList = false;
        return null;
    }

    public WOComponent displayFontsAction() {
        showPassword = false;
        showQuickRules = false;
        showRecent = false;
        showBlank = false;
        showFontList = true;
        return null;
    }

    public WOComponent saveChanges() {
        app.saveConfiguration();
        showBlank = true;
        showPassword = false;
        return null;
    }

    public WOComponent deleteRuleAction() {
        app.config().removeRule(currentRule);
        app.saveConfiguration();
        return quickRulesAction();
    }

    public WOComponent deletePathAction() {
        app.config().removePath(currentPath);
        app.saveConfiguration();
        return recentAction();
    }
    public WOComponent restoreDefaults(){
        NSMutableArray rules= new NSMutableArray();
        NSMutableDictionary dict;
        GSVRule rule;

        rule = new GSVRule("compareTo","com.gammastream.validity.GSVNumberMethods","compareTo","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","Operator");
        rule.parameters().setObjectForKey("","RightOperand");
        rules.addObject(rule);

        rule = new GSVRule("isPositiveNumber","com.gammastream.validity.GSVNumberMethods","isPositiveNumber","","");
        rules.addObject(rule);

        rule = new GSVRule("isNegativeNumber","com.gammastream.validity.GSVNumberMethods","isNegativeNumber","","");
        rules.addObject(rule);

        rule = new GSVRule("isInRange","com.gammastream.validity.GSVNumberMethods","isInRange","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","Low");
        rule.parameters().setObjectForKey("","High");
        rules.addObject(rule);
       
        rule = new GSVRule("isStringEmpty","com.gammastream.validity.GSVStringMethods","isStringEmpty","","");
        rules.addObject(rule);

        rule = new GSVRule("toUpperCase","com.gammastream.validity.GSVStringMethods","toUpperCase","","");
        rules.addObject(rule);

        rule = new GSVRule("toLowerCase","com.gammastream.validity.GSVStringMethods","toLowerCase","","");
        rules.addObject(rule);

        rule = new GSVRule("length","com.gammastream.validity.GSVStringMethods","length","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","Operator");
        rule.parameters().setObjectForKey("","RightOperand");
        rules.addObject(rule);

        rule = new GSVRule("contains","com.gammastream.validity.GSVStringMethods","contains","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","Contains");
        rules.addObject(rule);

        rule = new GSVRule("endsWith","com.gammastream.validity.GSVStringMethods","endsWith","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","EndsWith");
        rules.addObject(rule);

        rule = new GSVRule("startsWith","com.gammastream.validity.GSVStringMethods","startsWith","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","StartsWith");
        rules.addObject(rule);

        rule = new GSVRule("isAlphaNumeric","com.gammastream.validity.GSVStringMethods","isAlphaNumeric","","");
        rules.addObject(rule);

        rule = new GSVRule("stripHTML","com.gammastream.validity.GSVStringMethods","stripHTML","","");
        rules.addObject(rule);

        rule = new GSVRule("isValidURL","com.gammastream.validity.GSVStringMethods","isValidURL","","");
        rules.addObject(rule);

        rule = new GSVRule("isValidEmailAddress","com.gammastream.validity.GSVStringMethods","isValidEmailAddress","","");
        rules.addObject(rule);


        rule = new GSVRule("compareTo","com.gammastream.validity.GSVStringMethods","compareTo","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","Operator");
        rule.parameters().setObjectForKey("","RightOperand");
        rules.addObject(rule);
       
        rule = new GSVRule("isNull","com.gammastream.validity.GSVOtherMethods","isNull","","");
        rules.addObject(rule);

        rule = new GSVRule("isArrayEmpty","com.gammastream.validity.GSVOtherMethods","isArrayEmpty","","");
        dict = new NSMutableDictionary();
        rule.setParameters(dict);
        rule.parameters().setObjectForKey("","RelationshipKey");
        rules.addObject(rule);
       
        rule = new GSVRule("isUnique","com.gammastream.validity.GSVOtherMethods","isUnique","","");
        rules.addObject(rule);
       
        rule = new GSVRule("updateTimestamp","com.gammastream.validity.GSVDateMethods","updateTimestamp","","");
        rules.addObject(rule);

        app.config().setQuickRules(rules);
        app.saveConfiguration();
        return null;
    }

}
TOP

Related Classes of EditConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.