Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery-listentryinfo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kjetil Thuen
jquery-listentryinfo
Commits
bf2db246
Commit
bf2db246
authored
Apr 08, 2013
by
Kjetil Thuen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Java code
parent
f301f371
Changes
40
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
0 additions
and
4775 deletions
+0
-4775
README.md
README.md
+0
-0
component.json
component.json
+0
-0
css/overlay.css
css/overlay.css
+0
-0
images/apple-touch-icon.png
images/apple-touch-icon.png
+0
-0
images/detail.png
images/detail.png
+0
-0
js/SettingsView.js
js/SettingsView.js
+0
-0
js/StudyList.js
js/StudyList.js
+0
-0
js/Tabulation.js
js/Tabulation.js
+0
-0
js/VariableList.js
js/VariableList.js
+0
-0
js/_ListMixin.js
js/_ListMixin.js
+0
-0
pom.xml
pom.xml
+0
-139
src/main/java/com/nesstar/NesstarMobile.java
src/main/java/com/nesstar/NesstarMobile.java
+0
-298
src/main/java/com/nesstar/ServerHttpSessionListener.java
src/main/java/com/nesstar/ServerHttpSessionListener.java
+0
-33
src/main/java/com/nesstar/StaticVariables.java
src/main/java/com/nesstar/StaticVariables.java
+0
-194
src/main/java/com/nesstar/TabulateAnalysisDAO.java
src/main/java/com/nesstar/TabulateAnalysisDAO.java
+0
-503
src/main/java/com/nesstar/URLParser.java
src/main/java/com/nesstar/URLParser.java
+0
-139
src/main/java/com/nesstar/analysis/CorrelationDAO.java
src/main/java/com/nesstar/analysis/CorrelationDAO.java
+0
-406
src/main/java/com/nesstar/analysis/RegressionDAO.java
src/main/java/com/nesstar/analysis/RegressionDAO.java
+0
-228
src/main/java/com/nesstar/server/SingletonServer.java
src/main/java/com/nesstar/server/SingletonServer.java
+0
-89
src/main/java/com/nesstar/study/Command.java
src/main/java/com/nesstar/study/Command.java
+0
-17
src/main/java/com/nesstar/study/ExtractInformationBackgroundThread.java
...com/nesstar/study/ExtractInformationBackgroundThread.java
+0
-97
src/main/java/com/nesstar/study/StudyMetadataCommand.java
src/main/java/com/nesstar/study/StudyMetadataCommand.java
+0
-54
src/main/java/com/nesstar/study/StudyMetadataDAO.java
src/main/java/com/nesstar/study/StudyMetadataDAO.java
+0
-546
src/main/java/com/nesstar/study/StudyVariablesCommand.java
src/main/java/com/nesstar/study/StudyVariablesCommand.java
+0
-103
src/main/java/com/nesstar/tabulate/ParseTabulate.java
src/main/java/com/nesstar/tabulate/ParseTabulate.java
+0
-875
src/main/java/com/nesstar/tabulate/TabulateDAO.java
src/main/java/com/nesstar/tabulate/TabulateDAO.java
+0
-214
src/main/java/com/nesstar/variable/SessionData.java
src/main/java/com/nesstar/variable/SessionData.java
+0
-204
src/main/java/com/nesstar/variable/VariableInformationDAO.java
...ain/java/com/nesstar/variable/VariableInformationDAO.java
+0
-146
src/main/resources/log4j.properties
src/main/resources/log4j.properties
+0
-5
src/main/resources/nesstar.properties
src/main/resources/nesstar.properties
+0
-4
src/main/resources/study.json
src/main/resources/study.json
+0
-37
src/main/resources/studylist.json
src/main/resources/studylist.json
+0
-19
src/main/resources/studymetadata.json
src/main/resources/studymetadata.json
+0
-33
src/main/resources/variable.json
src/main/resources/variable.json
+0
-21
src/main/resources/variablegroups.json
src/main/resources/variablegroups.json
+0
-16
src/main/resources/variablelist.json
src/main/resources/variablelist.json
+0
-86
src/main/resources/variablesingroups.json
src/main/resources/variablesingroups.json
+0
-24
src/main/webapp/META-INF/MANIFEST.MF
src/main/webapp/META-INF/MANIFEST.MF
+0
-3
src/main/webapp/WEB-INF/web.xml
src/main/webapp/WEB-INF/web.xml
+0
-25
src/main/webapp/index.html
src/main/webapp/index.html
+0
-217
No files found.
src/main/webapp/
README.md
→
README.md
View file @
bf2db246
File moved
src/main/webapp/
component.json
→
component.json
View file @
bf2db246
File moved
src/main/webapp/
css/overlay.css
→
css/overlay.css
View file @
bf2db246
File moved
src/main/webapp/
images/apple-touch-icon.png
→
images/apple-touch-icon.png
View file @
bf2db246
File moved
src/main/webapp/
images/detail.png
→
images/detail.png
View file @
bf2db246
File moved
src/main/webapp/
js/SettingsView.js
→
js/SettingsView.js
View file @
bf2db246
File moved
src/main/webapp/
js/StudyList.js
→
js/StudyList.js
View file @
bf2db246
File moved
src/main/webapp/
js/Tabulation.js
→
js/Tabulation.js
View file @
bf2db246
File moved
src/main/webapp/
js/VariableList.js
→
js/VariableList.js
View file @
bf2db246
File moved
src/main/webapp/
js/_ListMixin.js
→
js/_ListMixin.js
View file @
bf2db246
File moved
pom.xml
deleted
100644 → 0
View file @
f301f371
<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/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.nesstar
</groupId>
<artifactId>
NesstarMobile
</artifactId>
<packaging>
war
</packaging>
<version>
1.0-SNAPSHOT
</version>
<name>
NesstarMobile Maven Webapp
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.6
</maven.compiler.source>
<maven.compiler.target>
1.6
</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>
Nesstar
</id>
<name>
Nesstar Maven Repository
</name>
<url>
http://nesstar-dev.nsd.uib.no/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
sourceforge
</id>
<url>
http://oss.sonatype.org/content/groups/sourceforge/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>
net.sf.json-lib
</groupId>
<artifactId>
json-lib
</artifactId>
<version>
2.4
</version>
<classifier>
jdk15
</classifier>
</dependency>
<dependency>
<groupId>
com.nesstar
</groupId>
<artifactId>
nesstar-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<!-- <<version>0.5</version> -->
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.9
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.hamcrest
</groupId>
<artifactId>
hamcrest-all
</artifactId>
<version>
1.1
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<version>
2.5
</version>
</dependency>
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache
</artifactId>
<version>
2.6.2
</version>
<type>
pom
</type>
</dependency>
</dependencies>
<build>
<finalName>
NesstarMobile
</finalName>
<plugins>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
tomcat-maven-plugin
</artifactId>
<configuration>
<server>
LocalTomcat
</server>
<path>
/NesstarMobile
</path>
</configuration>
</plugin>
<!-- Run the application using "mvn jetty" -->
<plugin>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
maven-jetty-plugin
</artifactId>
<version>
6.1.10
</version>
<configuration>
<scanIntervalSeconds>
7
</scanIntervalSeconds>
<stopKey>
foo
</stopKey>
<stopPort>
9998
</stopPort>
<scanTargetPatterns>
<!-- Redeploy whenever any of the following files change -->
<scanTargetPattern>
<directory>
src/main/webapp
</directory>
<includes>
<include>
**/*.html
</include>
<include>
**/*.js
</include>
<include>
**/*.css
</include>
<include>
**/*.less
</include>
</includes>
</scanTargetPattern>
<scanTargetPattern>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.java
</include>
</includes>
</scanTargetPattern>
</scanTargetPatterns>
</configuration>
<executions>
<!-- Launch maven when running integration tests -->
<execution>
<id>
start-jetty
</id>
<phase>
pre-integration-test
</phase>
<goals>
<goal>
run
</goal>
</goals>
<configuration>
<scanIntervalSeconds>
0
</scanIntervalSeconds>
<daemon>
true
</daemon>
</configuration>
</execution>
<execution>
<id>
stop-jetty
</id>
<phase>
post-integration-test
</phase>
<goals>
<goal>
stop
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
2.1
</version>
<configuration>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
src/main/java/com/nesstar/NesstarMobile.java
deleted
100644 → 0
View file @
f301f371
This diff is collapsed.
Click to expand it.
src/main/java/com/nesstar/ServerHttpSessionListener.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSessionEvent
;
import
javax.servlet.http.HttpSessionListener
;
import
org.apache.log4j.Logger
;
public
class
ServerHttpSessionListener
implements
HttpSessionListener
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
ServerHttpSessionListener
.
class
);
@Override
public
void
sessionCreated
(
HttpSessionEvent
se
)
{
logger
.
info
(
"Session created: "
+
se
.
getSession
().
getId
());
}
@Override
public
void
sessionDestroyed
(
HttpSessionEvent
event
)
{
HttpSession
session
=
event
.
getSession
();
// remove the cache of this session
if
(
null
!=
session
.
getAttribute
(
StaticVariables
.
DAO
))
{
((
TabulateAnalysisDAO
)
session
.
getAttribute
(
StaticVariables
.
DAO
)).
endCache
();
}
logger
.
info
(
"Clear the cache of session: "
+
session
.
getId
());
logger
.
info
(
"Session destroyed: "
+
session
.
getId
());
}
}
src/main/java/com/nesstar/StaticVariables.java
deleted
100644 → 0
View file @
f301f371
This diff is collapsed.
Click to expand it.
src/main/java/com/nesstar/TabulateAnalysisDAO.java
deleted
100644 → 0
View file @
f301f371
This diff is collapsed.
Click to expand it.
src/main/java/com/nesstar/URLParser.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar
;
class
URLParser
{
private
String
path
;
private
String
objectType
;
private
String
objectId
,
subId
;
private
String
operation
,
subOperation
;
/*
* "/login
* "/study/list"
* "/study/{studyId}"
* "/study/{studyId}/metadata"
* "/study/{studyId}/metadata/full"
* "/study/{studyId}/tabulation"
* "/study/{studyId}/variable/{variableId}"
* "/study/{studyId}/variablegroups"
* "/study/{studyId}/variablegroup/{groupId}/variables"
* "/study/{studyId}/variablegroup/{groupId}/variablegroups"
* "/study/{studyId}/variables"
* "/study/{studyId}/correlation"
* "/study/{studyId}/regression"
*/
URLParser
(
String
path
)
{
this
.
path
=
path
;
parse
();
}
private
void
parse
()
{
if
(
path
.
equalsIgnoreCase
(
"/"
))
{
return
;
}
if
(
path
.
startsWith
(
"/"
))
{
path
=
path
.
substring
(
1
);
}
String
[]
parts
=
path
.
split
(
"/"
);
if
(
parts
.
length
==
1
)
{
operation
=
parts
[
0
];
return
;
}
objectType
=
parts
[
0
];
if
(
"list"
.
equalsIgnoreCase
(
parts
[
1
]))
{
operation
=
parts
[
1
];
}
else
{
if
(
2
<
parts
.
length
)
{
operation
=
parts
[
2
];
}
objectId
=
parts
[
1
];
}
if
(
parts
.
length
>
3
)
{
if
(
"variable"
.
equalsIgnoreCase
(
parts
[
2
])
||
"variablegroup"
.
equalsIgnoreCase
(
parts
[
2
]))
{
subId
=
parts
[
3
];
if
(
parts
.
length
>
4
)
{
subOperation
=
parts
[
4
];
}
}
}
}
public
boolean
isStudyListRequest
()
{
return
isStudy
()
&&
objectId
==
null
;
}
public
boolean
isStudyRequest
()
{
return
isStudyObject
()
&&
operation
==
null
;
}
public
boolean
isStudyMetadataRequest
()
{
return
isStudyObject
()
&&
"metadata"
.
equalsIgnoreCase
(
operation
);
}
public
boolean
isTabulationRequest
()
{
return
isStudyObject
()
&&
"tabulation"
.
equalsIgnoreCase
(
operation
);
}
public
boolean
isVariableRequest
()
{
return
isStudyObject
()
&&
"variable"
.
equalsIgnoreCase
(
operation
)
&&
subId
!=
null
;
}
public
boolean
isVariableGroupListRequest
()
{
return
isStudyObject
()
&&
"variablegroups"
.
equalsIgnoreCase
(
operation
);
}
public
boolean
isVariableGroupVariablesRequest
()
{
return
isStudyObject
()
&&
"variablegroup"
.
equalsIgnoreCase
(
operation
)
&&
subId
!=
null
&&
"variables"
.
equalsIgnoreCase
(
subOperation
);
}
public
boolean
isVariableGroupGroupsRequest
()
{
return
isStudyObject
()
&&
"variablegroup"
.
equalsIgnoreCase
(
operation
)
&&
subId
!=
null
&&
"variablegroups"
.
equalsIgnoreCase
(
subOperation
);
}
public
boolean
isVariableListRequest
()
{
return
isStudyObject
()
&&
"variables"
.
equalsIgnoreCase
(
operation
);
}
public
boolean
isCorrelationRequest
()
{
return
isStudyObject
()
&&
"correlation"
.
equalsIgnoreCase
(
operation
);
}
public
boolean
isRegressionRequest
()
{
return
isStudyObject
()
&&
"regression"
.
equalsIgnoreCase
(
operation
);
}
public
String
getObjectType
()
{
return
objectType
;
}
public
String
getObjectId
()
{
return
objectId
;
}
public
String
getSubId
()
{
return
subId
;
}
public
String
getOperation
()
{
return
operation
;
}
public
String
getSubOperation
()
{
return
subOperation
;
}
private
boolean
isStudy
()
{
return
"study"
.
equalsIgnoreCase
(
objectType
);
}
private
boolean
isStudyObject
()
{
return
isStudy
()
&&
objectId
!=
null
;
}
public
boolean
isLogin
()
{
return
"login"
.
equalsIgnoreCase
(
operation
);
}
}
src/main/java/com/nesstar/analysis/CorrelationDAO.java
deleted
100644 → 0
View file @
f301f371
This diff is collapsed.
Click to expand it.
src/main/java/com/nesstar/analysis/RegressionDAO.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar.analysis
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONSerializer
;
import
org.apache.log4j.Logger
;
import
com.nesstar.StaticVariables
;
import
com.nesstar.api.DdiList
;
import
com.nesstar.api.NotAuthorizedException
;
import
com.nesstar.api.Study
;
import
com.nesstar.api.Variable
;
import
com.nesstar.api.analysis.LinearRegressionBuilder
;
import
com.nesstar.api.analysis.LinearRegressionResult
;
/**
* This class is used to do the regression calculation.
*
*/
public
class
RegressionDAO
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
RegressionDAO
.
class
);
/**
* Used to do the correlation calculation.
*/
private
Study
study
;
/**
* The correlation variables.
*/
private
DdiList
<
Variable
>
variables
;
/**
* The result of regression.
*/
private
LinearRegressionResult
result
;
/**
* Set the study and variables manually.
*
* @param study
* The study gonna be used
* @param variables
* The variables
*/
public
void
setStudyAndVariables
(
Study
study
,
DdiList
<
Variable
>
variables
)
{
this
.
study
=
study
;
this
.
variables
=
variables
;
}
/**
* Calculate the regression with dependent and independent variables sent in the http request.
*
* @param request
* The Http request
* @param response
* The response
* @throws IOException
* @throws NotAuthorizedException
*/
public
String
calculateRegression
(
String
data
)
throws
NotAuthorizedException
,
IOException
{
JSONObject
jsonData
=
(
JSONObject
)
JSONSerializer
.
toJSON
(
data
);
Variable
[]
breakVariables
=
getIndependentVariables
(
jsonData
);
Variable
dependentVariable
=
getDependentVariable
(
jsonData
);
regression
(
dependentVariable
,
breakVariables
);
return
new
JSONObject
().
element
(
"regression"
,
packageRegressionToJSON
()).
toString
();
}
/**
* Get the dependent variable.
*
* @param jsonData
* The variables of json type containing dependent variable
* @return The dependent variable in Variable type
* @throws NotAuthorizedException
* @throws IOException
*/
private
Variable
getDependentVariable
(
JSONObject
jsonData
)
throws
NotAuthorizedException
,
IOException
{
Variable
dependentVariable
=
null
;
if
(
jsonData
.
has
(
"Dependent"
))
{
JSONArray
jsonDependentVariable
=
jsonData
.
getJSONArray
(
"Dependent"
);
for
(
Variable
var
:
variables
)
{
if
(
jsonDependentVariable
.
get
(
0
).
equals
(
var
.
getName
()))
{
dependentVariable
=
var
;
}
else
if
(
jsonDependentVariable
.
get
(
0
).
equals
(
var
.
getLabel
()))
{
dependentVariable
=
var
;
}
}
logger
.
info
(
"Regression: get dependent variable"
);
}
return
dependentVariable
;
}
/**
* Get the independent variables.
*
* @param jsonData
* The variables of json type containing independent variables
* @return The independent variables in Variable type
* @throws NotAuthorizedException
* @throws IOException
*/
private
Variable
[]
getIndependentVariables
(
JSONObject
jsonData
)
throws
NotAuthorizedException
,
IOException
{
Variable
[]
independentVariables
=
null
;
if
(
jsonData
.
has
(
"Independent"
))
{
JSONArray
jsonIndependentVariables
=
jsonData
.
getJSONArray
(
"Independent"
);
independentVariables
=
new
Variable
[
jsonIndependentVariables
.
size
()];
ArrayList
<
Variable
>
listVariable
=
new
ArrayList
<
Variable
>();
for
(
int
i
=
0
;
i
<
jsonIndependentVariables
.
size
();
i
++)
{
for
(
Variable
var
:
variables
)
{
if
(
jsonIndependentVariables
.
get
(
i
).
equals
(
var
.
getLabel
())
||
jsonIndependentVariables
.
get
(
i
).
equals
(
var
.
getName
()))
{
listVariable
.
add
(
var
);
}
}
}
// convert the list to array
independentVariables
=
listVariable
.
toArray
(
independentVariables
);
logger
.
info
(
"Regression: get independent variables"
);
}
return
independentVariables
;
}
/**
* Do the regression calculation with independent and dependent variables.
*
* @param dependentVariable
* The dependent variable
* @param independentVariables
* The independent variables
* @throws IOException
* @throws NotAuthorizedException
*/
private
void
regression
(
Variable
dependentVariable
,
Variable
...
independentVariables
)
throws
NotAuthorizedException
,
IOException
{
LinearRegressionBuilder
regressionBuilder
=
new
LinearRegressionBuilder
();
if
(
null
!=
dependentVariable
)
{
regressionBuilder
.
setDependentVariable
(
dependentVariable
);
}
if
(
null
!=
independentVariables
)
{
for
(
Variable
var
:
independentVariables
)
{
regressionBuilder
.
addIndependentVariable
(
var
);
}
}
this
.
result
=
(
LinearRegressionResult
)
study
.
regress
(
regressionBuilder
);
logger
.
info
(
"Regression: regression"
);
}
/**
* Parse the regression result to JSON type.
*
* @param regressionResult
* The regression result
* @return The result of json type
* @throws IOException
* @throws NotAuthorizedException
*/
private
JSONObject
packageRegressionToJSON
()
throws
NotAuthorizedException
,
IOException
{
JSONObject
jsonResult
=
new
JSONObject
();
JSONArray
jsonData
=
new
JSONArray
();
String
tempVariableName
=
""
;
for
(
Variable
variable
:
this
.
result
.
getIndependentVariables
())
{
// add one part of the result
jsonData
.
add
(
parseRegressionPartOne
(
variable
));
}
jsonResult
.
element
(
StaticVariables
.
NESSTAR_TEXT_DATA
,
jsonData
);
tempVariableName
=
this
.
result
.
getDependentVariable
().
getLabel
();
if
(
null
==
tempVariableName
||
""
.
equals
(
tempVariableName
))
{
jsonResult
.
element
(
"DependentVariable"
,
this
.
result
.
getDependentVariable
().
getName
());
}
else
{
jsonResult
.
element
(
"DependentVariable"
,
tempVariableName
);
}
jsonResult
.
element
(
"Intercept"
,
Double
.
toString
(
this
.
result
.
getIntercept
()));
jsonResult
.
element
(
"ValidN"
,
Double
.
toString
(
this
.
result
.
getCaseCount
()));
jsonResult
.
element
(
"MultipleR"
,
Double
.
toString
(
this
.
result
.
getR
()));
jsonResult
.
element
(
"MultipleRSquared"
,
Double
.
toString
(
this
.
result
.
getrSquared
()));
jsonResult
.
element
(
"AdjustedRSquared"
,
Double
.
toString
(
this
.
result
.
getAdjustedRSquared
()));
jsonResult
.
element
(
"F"
,
Double
.
toString
(
this
.
result
.
getF
()));
jsonResult
.
element
(
"FSignificance"
,
Double
.
toString
(
this
.
result
.
getfSignificance
()));
logger
.
info
(
"Regression: package regression result to JSON type"
);
return
jsonResult
;
}
private
JSONObject
parseRegressionPartOne
(
Variable
variable
)
throws
NotAuthorizedException
,
IOException
{
JSONObject
jsonObject
=
new
JSONObject
();
String
tempVariableName
=
variable
.
getLabel
();
if
(
null
==
tempVariableName
||
""
.
equals
(
tempVariableName
))
{
jsonObject
.
element
(
"name"
,
variable
.
getName
());
}
else
{
jsonObject
.
element
(
"name"
,
tempVariableName
);
}
jsonObject
.
element
(
"B"
,
Double
.
toString
(
this
.
result
.
getUnstandarizedCoefficient
(
variable
)));
jsonObject
.
element
(
"SEB"
,
Double
.
toString
(
this
.
result
.
getUnstandarizedCoefficientStandardError
(
variable
)));
jsonObject
.
element
(
"Beta"
,
Double
.
toString
(
this
.
result
.
getStandarizedCoefficient
(
variable
)));
jsonObject
.
element
(
"T"
,
Double
.
toString
(
this
.
result
.
getT
(
variable
)));
jsonObject
.
element
(
"TSignificance"
,
Double
.
toString
(
this
.
result
.
getTSignificance
(
variable
)));
jsonObject
.
element
(
"Tolerance"
,
Double
.
toString
(
this
.
result
.
getTolerance
(
variable
)));
return
jsonObject
;
}
}
src/main/java/com/nesstar/server/SingletonServer.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar.server
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.util.Properties
;
import
org.apache.log4j.Logger
;
import
com.nesstar.api.NesstarDB
;
import
com.nesstar.api.NesstarDBFactory
;
import
com.nesstar.api.NesstarList
;
import
com.nesstar.api.NotAuthorizedException
;
import
com.nesstar.api.Server
;
import
com.nesstar.api.Study
;
public
class
SingletonServer
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
SingletonServer
.
class
);
/**
* The object of nesstar database.
*/
private
static
NesstarDB
nesstarDB
;
private
static
Server
server
;
private
static
NesstarList
<
Study
>
studys
;
private
SingletonServer
()
{
nesstarDB
=
NesstarDBFactory
.
getInstance
();
}
public
static
Server
getServer
()
{
if
(
null
==
server
)
{
try
{
server
=
nesstarDB
.
getServer
(
getServerURI
());
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
return
server
;
}
public
static
NesstarList
<
Study
>
getStudys
()
throws
NotAuthorizedException
{
if
(
null
==
studys
)
{
server
=
getServer
();
try
{
studys
=
server
.
getBank
(
Study
.
class
).
getAll
();
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
return
studys
;
}
private
static
URI
getServerURI
()
throws
IOException
{
Properties
properties
=
new
Properties
();
InputStream
is
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
"nesstar.properties"
);
URI
serverURI
=
null
;
try
{
properties
.
load
(
is
);
serverURI
=
new
URI
(
properties
.
getProperty
(
"serverURI"
));
}
catch
(
IOException
e1
)
{
logger
.
error
(
e1
.
getMessage
());
throw
e1
;
}
catch
(
URISyntaxException
e
)
{
logger
.
error
(
e
.
getMessage
());
}
return
serverURI
;
}
public
static
void
setSession
(
String
id
)
{
if
(
null
==
nesstarDB
)
{
nesstarDB
=
NesstarDBFactory
.
getInstance
();
}
nesstarDB
.
setSession
(
id
);
}
public
static
void
endSession
()
{
nesstarDB
.
endSession
();
}
}
src/main/java/com/nesstar/study/Command.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar.study
;
import
java.io.IOException
;
import
com.nesstar.TabulateAnalysisDAO
;
import
com.nesstar.api.NotAuthorizedException
;
import
com.nesstar.api.Study
;
/**
* The interface Command, used to apply Command Pattern.
*
* @author feng xue
*
*/
public
interface
Command
{
Object
execute
(
TabulateAnalysisDAO
data
,
Study
study
,
Boolean
force
)
throws
NotAuthorizedException
,
IOException
;
}
src/main/java/com/nesstar/study/ExtractInformationBackgroundThread.java
deleted
100644 → 0
View file @
f301f371
package
com.nesstar.study
;
import
java.io.IOException
;
import
org.apache.log4j.Logger
;
import
com.nesstar.TabulateAnalysisDAO
;
import
com.nesstar.api.NotAuthorizedException
;
import
com.nesstar.api.Study
;
/**
* The thread class used to extract the details of study background.
*
* @author feng xue
*
*/
public
class
ExtractInformationBackgroundThread
implements
Runnable
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
ExtractInformationBackgroundThread
.
class
);
/**