Package org.apdplat.module.module.model

Examples of org.apdplat.module.module.model.Module


            return modules;
        }
       
        for(Command command : commands){
            if(command!=null){
                Module module=command.getModule();
                if(module!=null){
                    modules.add(module);
                    assemblyModule(modules,module);
                }
            }
View Full Code Here


        }
        return modules;
    }
    private void assemblyModule(List<Module> modules,Module module){
        if(module!=null){
            Module parentModule=module.getParentModule();
            if(parentModule!=null){
                modules.add(parentModule);
                assemblyModule(modules,parentModule);
            }
        }
View Full Code Here

       
        Set<Integer> moduleIds=new HashSet<>();
       
        for(Command command : this.commands){
            ids.append("command-").append(command.getId()).append(",");
            Module module=command.getModule();
            moduleIds.add(module.getId());
            module=module.getParentModule();
            while(module!=null){
                moduleIds.add(module.getId());
                module=module.getParentModule();
            }
        }
        for(Integer moduleId : moduleIds){
            ids.append("module-").append(moduleId).append(",");
        }
View Full Code Here

       
        Set<Integer> moduleIds=new HashSet<>();
       
        for(Command command : this.commands){
            ids.append("command-").append(command.getId()).append(",");
            Module module=command.getModule();
            moduleIds.add(module.getId());
            module=module.getParentModule();
            while(module!=null){
                moduleIds.add(module.getId());
                module=module.getParentModule();
            }
        }
        for(Integer moduleId : moduleIds){
            ids.append("module-").append(moduleId).append(",");
        }
View Full Code Here

            rootModule=module;
            data.add(module);
        }else{
            LOG.info("以前已经注册过模块");
            LOG.info("查找出根模块");
            Module root=null;
            Module existRoot=moduleService.getRootModule();
            if(existRoot!=null){
                root=existRoot;
                LOG.info("找到以前导入的根模块: "+root.getChinese());
            }else{
                LOG.info("没有找到以前导入的根模块");
View Full Code Here

        }
    }
   
    private void chechCommand(Module module){
        Set<String> existCommands=new HashSet<>();
        Module existsModule=moduleService.getModule(module.getEnglish());
        if(existsModule!=null){
            for(Command command : existsModule.getCommands()){
                existCommands.add(command.getEnglish());
            }
            for(Command command : module.getCommands()){
                if(!existCommands.contains(command.getEnglish())){
                    command.setModule(existsModule);
                    serviceFacade.create(command);
                    LOG.info("注册新增命令: "+command.getChinese()+" ,模块:"+existsModule.getChinese());
                }
            }
        }
    }
View Full Code Here

                }
            }
        }
    }
    private boolean hasRegisteModule(Module module){
        Module existsModule=moduleService.getModule(module.getEnglish());
        if(existsModule==null){
            return false;
        }
        return true;
    }
View Full Code Here

        }
        try {
            String moduleFile=workspaceModuleBasePath.replace("/src/main/java/", "/src/main/resources/META-INF/services/module.xml");
           
            //获取所有叶子模块
            Module rootModule = ModuleParser.getRootModule(new FileInputStream(moduleFile));
            List<Module> modules=ModuleService.getLeafModule(rootModule);
            //计算基本包名
            String actionPackageBase=findPackageName(workspaceModuleBasePath);
            int index=actionPackageBase.indexOf("\\src\\main\\java\\");
            actionPackageBase=actionPackageBase.substring(index).replace("\\src\\main\\java\\", "").replace("\\", ".");
View Full Code Here

        actionNamespace = packageName.substring(indexOf).replace(".module.", "").replace(".model", "").replace(".", "/");
       
        //普通情况下一个模型对应一个Action,如果某些模型不需要Action(即没有在module.xml中进行声明),则忽略生成此模型对应的Action
        //从module.xml中查找该model是否配置在模块文件中
        String shortModel=Character.toLowerCase(model.charAt(0))+model.substring(1);
        Module m=ModuleService.getModuleFromXml(shortModel);
        if(m==null){
            LOG.info(shortModel+" 没有在module.xml中进行声明,忽略生成Action");
            return ;
        }       
        //添加自定义的方法
View Full Code Here

TOP

Related Classes of org.apdplat.module.module.model.Module

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.