* INITIAL POPULATIONS OF THIS REPO
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.fourelementscapital</groupId>
|
||||
<artifactId>iexec</artifactId>
|
||||
<version>3.0.0-Beta1</version>
|
||||
<name>iexec</name>
|
||||
<url>http://www.fourelementscapital.com</url>
|
||||
<dependencies>
|
||||
|
||||
<!--Cache system-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-jcs-core</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--JCS's required dependency-->
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--4ECAP Libs-->
|
||||
<dependency>
|
||||
<groupId>com.fourelementscapital</groupId>
|
||||
<artifactId>lib-db</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--Log dependencies-->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright: Intellectual Property of Four Elements Capital Pte Ltd, Singapore.
|
||||
* All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
package com.fourelementscapital.iexec.common;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import com.fourelementscapital.db.IExecDB;
|
||||
import com.fourelementscapital.db.vo.ValueObject;
|
||||
|
||||
|
||||
/**
|
||||
* Use lib-db to generate tree menu on iExec
|
||||
*/
|
||||
|
||||
public class IExecMgmt{
|
||||
|
||||
private HttpServletRequest request=null;
|
||||
private Logger log = LogManager.getLogger(IExecMgmt.class.getName());
|
||||
|
||||
public IExecMgmt() throws Exception {
|
||||
super();
|
||||
|
||||
}
|
||||
|
||||
public Map getTreeViewData() throws Exception {
|
||||
|
||||
IExecDB iedb=IExecDB.getIExcecDB();
|
||||
|
||||
try{
|
||||
HashMap rtn=new HashMap();
|
||||
|
||||
iedb.connectDB();
|
||||
|
||||
List glist=iedb.listGroups();
|
||||
List folders=iedb.listFolders();
|
||||
List strategies=iedb.listStrategies();
|
||||
|
||||
Vector groups=new Vector();
|
||||
HashMap colors=new HashMap();
|
||||
for(Iterator it=glist.iterator();it.hasNext();){
|
||||
Map data=(Map)it.next();
|
||||
|
||||
ValueObject vo=new ValueObject();
|
||||
vo.setKey((String)data.get("group_uid"));
|
||||
vo.setValue((String)data.get("group_name"));
|
||||
groups.add(vo);
|
||||
colors.put(data.get("group_uid"), data.get("color_code"));
|
||||
}
|
||||
rtn.put("folders", folders);
|
||||
rtn.put("groups",groups);
|
||||
rtn.put("group_colors",colors);
|
||||
rtn.put("strategies",strategies);
|
||||
|
||||
return rtn;
|
||||
|
||||
}catch(Exception e){
|
||||
throw e;
|
||||
}finally{
|
||||
iedb.closeDB();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user