Package org.eweb4j.config.bean

Examples of org.eweb4j.config.bean.ConfigBean


   * @return
   */
  public static String checkORMProperty(List<Property> pList,
      List<ORMConfigBean> ormList, String beanID, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getOrm().getOpen())
        || "1".equals(cb.getOrm().getOpen())) {
      StringBuilder sb = new StringBuilder();
      // for (Property p : pList) {
      //
      //
      // }
View Full Code Here


   * @param mvc
   * @return
   */
  public static String checkMVCAction(ActionConfigBean mvc, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getMvc().getOpen())
        || "1".equals(cb.getMvc().getOpen())) {
      StringBuilder sb = new StringBuilder();
      if (!"".equals(mvc.getClazz())) {
        try {
          Class<?> clazz = Class.forName(mvc.getClazz());
          if (clazz == null) {
View Full Code Here

   * @return
   */
  public static String checkMVCResultPart(List<ResultConfigBean> rList,
      String beanID, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getMvc().getOpen())
        || "1".equals(cb.getMvc().getOpen())) {
      StringBuilder sb = new StringBuilder();

      for (Iterator<ResultConfigBean> it = rList.iterator(); it.hasNext();) {
        ResultConfigBean r = it.next();
        if (!"forward".equalsIgnoreCase(r.getType())
View Full Code Here

   * @return
   */
  public static String checkMVCValidator(List<ValidatorConfigBean> vList,
      String beanID, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equals(cb.getMvc().getOpen())
        || "1".equals(cb.getMvc().getOpen())) {
      if (vList != null && !vList.isEmpty()) {
        StringBuilder sb = new StringBuilder();
        for (Iterator<ValidatorConfigBean> it = vList.iterator(); it
            .hasNext();) {
          ValidatorConfigBean v = it.next();
View Full Code Here

* @since v1.a.0
*/
public class IOCConfig {
  public synchronized static String check() {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);
    if (cb == null)
      return null;

    List<String> iocXmlFilePaths = cb.getIoc().getIocXmlFiles().getPath();
    for (String filePath : iocXmlFilePaths) {
      if (filePath == null || filePath.length() == 0)
        continue;

      File configFile = new File(ConfigConstant.CONFIG_BASE_PATH
View Full Code Here

import org.eweb4j.orm.ORMLogger;


public class LogFactory {
  public static Logger getIOCLogger(String level) {
    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);

    String filePath = cb == null ? "" : ConfigConstant.CONFIG_BASE_PATH
        + cb.getIoc().getLogFile();
    String maxSize = cb == null ? "5" : cb.getIoc().getLogMaxSize();
    String debug = cb == null ? "false" : cb.getIoc().getDebug();
    boolean isDebug = false;
    if ("true".equalsIgnoreCase(debug) || "1".equalsIgnoreCase(debug))
      isDebug = true;

    return new IOCLogger(isDebug, level, filePath,
View Full Code Here

    return new IOCLogger(isDebug, level, filePath,
        Integer.parseInt(maxSize));
  }

  public static Logger getMVCLogger(String level) {
    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);

    String filePath = cb == null ? "" : ConfigConstant.CONFIG_BASE_PATH
        + cb.getMvc().getLogFile();
    String maxSize = cb == null ? "5" : cb.getMvc().getLogMaxSize();
    String debug = cb == null ? "false" : cb.getMvc().getDebug();
    boolean isDebug = false;
    if ("true".equalsIgnoreCase(debug) || "1".equalsIgnoreCase(debug))
      isDebug = true;

    return new MVCLogger(isDebug, level, filePath,
View Full Code Here

    return new MVCLogger(isDebug, level, filePath,
        Integer.parseInt(maxSize));
  }

  public static Logger getORMLogger(String level) {
    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);

    String filePath = cb == null ? "" : ConfigConstant.CONFIG_BASE_PATH
        + cb.getOrm().getLogFile();
    String maxSize = cb == null ? "5" : cb.getOrm().getLogMaxSize();

    String debug = cb == null ? "false" : cb.getOrm().getDebug();
    boolean isDebug = false;
    if ("true".equalsIgnoreCase(debug) || "1".equalsIgnoreCase(debug))
      isDebug = true;
    return new ORMLogger(isDebug, level, filePath,
        Integer.parseInt(maxSize));
View Full Code Here

   
    return this;
  }
 
  public static ConfigBean getConfigBean() {
    ConfigBean configBean = new ConfigBean();
   
    Properties props = new Properties();
    Prop file = new Prop();
    props.getFile().add(file);
    configBean.setProperties(props);
   
    ConfigIOC ioc = new ConfigIOC();
    IOCXmlFiles iocXmlFiles = new IOCXmlFiles();
    iocXmlFiles.setPath(new ArrayList<String>());
    ioc.setIocXmlFiles(iocXmlFiles);
    configBean.setIoc(ioc);

    ConfigORM orm = new ConfigORM();
    ORMXmlFiles ormXmlFiles = new ORMXmlFiles();
    orm.setOrmXmlFiles(ormXmlFiles);
    ScanPojoPackage spp = new ScanPojoPackage();
    orm.setScanPojoPackage(spp);

    DBInfoXmlFiles dbInfoXmlFiles = new DBInfoXmlFiles();
    dbInfoXmlFiles.setPath(new ArrayList<String>());
    orm.setDbInfoXmlFiles(dbInfoXmlFiles);

    configBean.setOrm(orm);

    ConfigMVC mvc = new ConfigMVC();
    ActionXmlFile actionFiles = new ActionXmlFile();
    actionFiles.setPath(new ArrayList<String>());
    mvc.setActionXmlFiles(actionFiles);
   
    InterXmlFile intFiles = new InterXmlFile();
    intFiles.setPath(new ArrayList<String>());
    mvc.setInterXmlFiles(intFiles);
   
    ScanActionPackage sap = new ScanActionPackage();
    sap.setPath(new ArrayList<String>());
    mvc.setScanActionPackage(sap);
   
    configBean.setMvc(mvc);

    return configBean;
  }
View Full Code Here

    String js = "<script>document.getElementById('ACTION_REDIRECT_FORM').submit();</script>";
    context.getWriter().print(form + js);
  }

  private void handleUpload() throws Exception{
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigConstant.CONFIGBEAN_ID);
   
    Upload upload = method.getAnnotation(Upload.class);
    UploadConfigBean ucb = cb.getMvc().getUpload();
    String tmpDir = ucb.getTmp();
    int memoryMax = StringUtil.strToInt(StringUtil.parseFileSize(ucb.getMaxMemorySize())+"");
    long sizeMax = StringUtil.parseFileSize(ucb.getMaxRequestSize());
    //String[] suffix = ucb.getSuffix().split(",");
    if (upload != null){
View Full Code Here

TOP

Related Classes of org.eweb4j.config.bean.ConfigBean

Copyright © 2018 www.massapicom. 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.