use of net.heartsome.cat.common.bean.DatabaseModelBean in project translationstudio8 by heartsome.
the class NewProjectTmPage method addToCurrDbList.
/**
* 将选中的内容添加到列表中
* @param selection
* ;
*/
private void addToCurrDbList(List<DatabaseModelBean> hasSelection) {
StringBuffer existDbNames = new StringBuffer();
for (int i = 0; i < hasSelection.size(); i++) {
DatabaseModelBean dbModel = hasSelection.get(i);
checkDbHashMatch(dbModel, "M");
if (!checkDbIsExist(curDbList, dbModel)) {
if (curDbList.size() == 0) {
// 第一个添加的库为默认库
dbModel.setDefault(true);
}
curDbList.add(dbModel);
this.tableViewer.refresh();
} else {
existDbNames.append(dbModel.getDbName());
existDbNames.append("\n");
}
}
if (existDbNames.length() != 0) {
MessageDialog.openInformation(getShell(), Messages.getString("newproject.NewProjectTmPage.msgTitle"), Messages.getString("newproject.NewProjectTmPage.msg2") + existDbNames.toString());
}
}
use of net.heartsome.cat.common.bean.DatabaseModelBean in project translationstudio8 by heartsome.
the class DatabaseConfiger method getServersConfigByType.
/**
* 获取指定类型数据库的所有服务器配置信息
* @param type
* 数据库类型
* @return ;
*/
public List<DatabaseModelBean> getServersConfigByType(String type) {
List<DatabaseModelBean> list = new ArrayList<DatabaseModelBean>();
try {
vu.getVTDNav().push();
ap.selectXPath("/servers/server[@type='" + type + "']");
while (ap.evalXPath() != -1) {
DatabaseModelBean dbm = new DatabaseModelBean();
dbm.setId(vu.getCurrentElementAttribut("id", ""));
dbm.setItlDBLocation(vu.getChildContent("location"));
dbm.setInstance(vu.getChildContent("instance"));
dbm.setHost(vu.getChildContent("host"));
dbm.setPort(vu.getChildContent("port"));
dbm.setUserName(vu.getChildContent("user"));
dbm.setPassword(DESImpl.decrypt(vu.getChildContent("password")));
dbm.setDbType(type);
list.add(dbm);
}
ap.resetXPath();
vu.getVTDNav().pop();
} catch (XPathParseException e) {
logger.error("", e);
} catch (XPathEvalException e) {
logger.error("", e);
} catch (NavException e) {
logger.error("", e);
}
return list;
}
use of net.heartsome.cat.common.bean.DatabaseModelBean in project translationstudio8 by heartsome.
the class ProjectSettingTMPage method setProjectInfoBean.
@Override
public void setProjectInfoBean(ProjectInfoBean projInfoBean) {
super.projectInfoBean = projInfoBean;
this.curDbList = projInfoBean.getTmDb();
for (DatabaseModelBean bean : this.curDbList) {
checkDbHashMatch(bean);
}
}
use of net.heartsome.cat.common.bean.DatabaseModelBean in project translationstudio8 by heartsome.
the class ProjectSettingTMPage method getAvailableDatabase.
public List<DatabaseModelBean> getAvailableDatabase() {
Set<String> availableDatabase = getSysAvailableDatabase();
List<DatabaseModelBean> rs = new ArrayList<DatabaseModelBean>();
for (DatabaseModelBean dmb : this.curDbList) {
if (availableDatabase.contains(dmb.getDbType())) {
rs.add(dmb);
}
}
return rs;
}
use of net.heartsome.cat.common.bean.DatabaseModelBean in project translationstudio8 by heartsome.
the class ProjectSettingTMPage method getUnAvailableDatabase.
public List<DatabaseModelBean> getUnAvailableDatabase() {
Set<String> availableDatabase = getSysAvailableDatabase();
List<DatabaseModelBean> rs = new ArrayList<DatabaseModelBean>();
for (DatabaseModelBean dmb : this.curDbList) {
if (!availableDatabase.contains(dmb.getDbType())) {
rs.add(dmb);
}
}
return rs;
}
Aggregations