📄 exphelper.java
字号:
package cn.myapps.core.expimp.exp.action;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import cn.myapps.base.action.BaseHelper;
import cn.myapps.base.action.ParamsTable;
import cn.myapps.core.deploy.application.ejb.ApplicationProcess;
import cn.myapps.core.deploy.application.ejb.ApplicationVO;
import cn.myapps.core.deploy.module.ejb.ModuleProcess;
import cn.myapps.core.deploy.module.ejb.ModuleVO;
import cn.myapps.core.dynaform.component.action.ComponentHelper;
import cn.myapps.core.dynaform.dts.excelimport.config.action.ImpHelper;
import cn.myapps.core.dynaform.dts.exp.mappingconfig.action.MappingConfigHelper;
import cn.myapps.core.dynaform.form.action.FormHelper;
import cn.myapps.core.dynaform.view.action.ViewHelper;
import cn.myapps.core.image.repository.action.ImageRepositoryHelper;
import cn.myapps.core.macro.repository.action.RepositoryActionHelper;
import cn.myapps.core.page.action.PageHelper;
import cn.myapps.core.report.reportconfig.action.ReportConfigHepler;
import cn.myapps.core.resource.action.ResourceHelper;
import cn.myapps.core.style.repository.action.StyleRepositoryHelper;
import cn.myapps.core.workflow.storage.definition.action.BillDefiHelper;
import cn.myapps.util.ProcessFactory;
public class ExpHelper extends BaseHelper {
public ExpHelper() throws ClassNotFoundException {
super(ProcessFactory.createProcess(ModuleProcess.class));
}
public Collection get_formList() throws Exception {
ParamsTable params = new ParamsTable();
params.setParameter("xi_type", new Integer(0));
return getListByModule(new FormHelper(), params);
}
public Collection get_viewList() throws Exception {
return getListByModule(new ViewHelper(), null);
}
public Collection get_flowList() throws Exception {
return getListByModule(new BillDefiHelper(), null);
}
public Collection get_imglibList() throws Exception {
return getListByApplication(new ImageRepositoryHelper(), null);
}
public Collection get_stylibList() throws Exception {
return getListByApplication(new StyleRepositoryHelper(), null);
}
public Collection get_mcolibList() throws Exception {
return getListByModule(new RepositoryActionHelper(), null);
}
public Collection get_compList() throws Exception {
return getListByApplication(new ComponentHelper(), null);
}
public Collection get_repcfgList() throws Exception {
ReportConfigHepler helper = new ReportConfigHepler();
if (applicationid.equals("none")) {
return getListAll(helper, null);
} else {
return getListByModule(new ReportConfigHepler(), null);
}
}
public Collection get_resList() throws Exception {
ResourceHelper helper = new ResourceHelper();
if (applicationid.equals("none")) {
return getListAll(helper, null);
} else {
return getListByModule(helper, null);
}
}
public Collection get_pageList() throws Exception {
PageHelper helper = new PageHelper();
if (moduleid.equals("none")) {
return getListByApplication(helper, null);
} else {
return getListByModule(helper, null);
}
}
public Collection get_excelMappcfgList() throws Exception {
return getListByModule(new ImpHelper(), null);
}
/**
* @return MappingConfing列表
* @throws Exception
*/
public Collection get_mappcfgList() throws Exception {
MappingConfigHelper mch = new MappingConfigHelper();
return mch.proxy.doSimpleQuery(null, applicationid);
}
private Collection getListByModule(BaseHelper helper, ParamsTable params)
throws Exception {
Collection list = new ArrayList();
ApplicationProcess ap = (ApplicationProcess) ProcessFactory
.createProcess(ApplicationProcess.class);
ApplicationVO app = (ApplicationVO) ap.doView(this.applicationid);
Collection colls = app.getModules(); // get all modules of the
// application
ModuleVO startNode = (ModuleVO) ((ModuleProcess) proxy)
.doView(this.moduleid);
Map map = new LinkedHashMap();
if (colls != null) {
map = ((ModuleProcess) proxy).deepSearchModuleTree(colls,
this.applicationid, startNode, null);
} else {
map.put(startNode.getId(), startNode.getName());
}
for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
String moduleid = (String) iter.next();
if (params != null) {
params.setParameter("s_module", moduleid);
} else {
params = new ParamsTable();
params.setParameter("s_module", moduleid);
}
list.addAll(helper.proxy.doSimpleQuery(params, applicationid));
}
return list;
}
private Collection getListByApplication(BaseHelper helper,
ParamsTable params) throws Exception {
Collection list = new ArrayList();
if (params != null) {
params.setParameter("s_application", applicationid);
} else {
params = new ParamsTable();
params.setParameter("s_application", applicationid);
}
Collection datas = helper.proxy.doSimpleQuery(params, applicationid);
if (datas.size() > 0) {
list.addAll(datas);
}
return list;
}
private Collection getListAll(BaseHelper helper, ParamsTable params)
throws Exception {
return helper.proxy.doSimpleQuery(params, applicationid);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -