Commit 435b6daa by Nilu

Added candidate multiref to TestInput

parent 0d6d079a
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
<column name="location" type="String" nullable="true" length="80"/> <column name="location" type="String" nullable="true" length="80"/>
<column name="contact_phone" type="String" nullable="true" length="80"/> <column name="contact_phone" type="String" nullable="true" length="80"/>
<column name="email" type="String" nullable="true" length="60"/> <column name="email" type="String" nullable="true" length="60"/>
<column name="test_input_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="candidate" indexName="idx_candidate_test_input_id" isUnique="false"><column name="test_input_id"/></NODE>
</NODE></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
...@@ -21,7 +21,8 @@ CREATE TABLE candidate ( ...@@ -21,7 +21,8 @@ CREATE TABLE candidate (
date_taken datetime NULL, date_taken datetime NULL,
location varchar(80) NULL, location varchar(80) NULL,
contact_phone varchar(80) NULL, contact_phone varchar(80) NULL,
email varchar(60) NULL email varchar(60) NULL,
test_input_id numeric(12) NULL
); );
...@@ -33,4 +34,6 @@ ALTER TABLE candidate ADD ...@@ -33,4 +34,6 @@ ALTER TABLE candidate ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_candidate_test_input_id
ON candidate (test_input_id);
...@@ -22,7 +22,8 @@ CREATE TABLE candidate ( ...@@ -22,7 +22,8 @@ CREATE TABLE candidate (
date_taken date NULL, date_taken date NULL,
location varchar2(80) NULL, location varchar2(80) NULL,
contact_phone varchar2(80) NULL, contact_phone varchar2(80) NULL,
email varchar2(60) NULL email varchar2(60) NULL,
test_input_id number(12) NULL
); );
...@@ -34,4 +35,6 @@ ALTER TABLE candidate ADD ...@@ -34,4 +35,6 @@ ALTER TABLE candidate ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_candidate_test_input_id
ON candidate (test_input_id);
...@@ -22,7 +22,8 @@ CREATE TABLE candidate ( ...@@ -22,7 +22,8 @@ CREATE TABLE candidate (
date_taken timestamp NULL, date_taken timestamp NULL,
location varchar(80) NULL, location varchar(80) NULL,
contact_phone varchar(80) NULL, contact_phone varchar(80) NULL,
email varchar(60) NULL email varchar(60) NULL,
test_input_id numeric(12) NULL
); );
...@@ -34,4 +35,6 @@ ALTER TABLE candidate ADD ...@@ -34,4 +35,6 @@ ALTER TABLE candidate ADD
) ; ) ;
\ No newline at end of file CREATE INDEX idx_candidate_test_input_id
ON candidate (test_input_id);
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<ATTRIB name="Phone" type="String" dbcol="contact_phone" length="80"/> <ATTRIB name="Phone" type="String" dbcol="contact_phone" length="80"/>
<ATTRIB name="Email" type="String" dbcol="email" length="60"/> <ATTRIB name="Email" type="String" dbcol="email" length="60"/>
<SINGLEREFERENCE name="TestInput" type="TestInput" dbcol="test_input_id" backreferenceName="Candidates"/>
</TABLE> </TABLE>
<SEARCH type="All" paramFilter="candidate.object_id is not null" orderBy="candidate.object_id" /> <SEARCH type="All" paramFilter="candidate.object_id is not null" orderBy="candidate.object_id" />
......
...@@ -5,8 +5,12 @@ ...@@ -5,8 +5,12 @@
<IMPORT value="oneit.servlets.orm.*"/> <IMPORT value="oneit.servlets.orm.*"/>
<MULTIPLEREFERENCE name="Candidates" type="Candidate" backreferenceName="TestInput" owner="true"/>
<TABLE name="it_does_not_matter" tablePrefix="OBJECT" polymorphic="FALSE"> <TABLE name="it_does_not_matter" tablePrefix="OBJECT" polymorphic="FALSE">
<ATTRIB name="CSV" type="BinaryContent" dbcol="xxxx" binaryHandler="loggedin" mandatory="true" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" /> <ATTRIB name="CSV" type="BinaryContent" dbcol="xxxx" binaryHandler="loggedin" mandatory="true" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
</TABLE> </TABLE>
</BUSINESSCLASS> </BUSINESSCLASS>
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
<%! protected String getName (ServletConfig config) { return "testAnalysis_jsp"; } %> <%! protected String getName (ServletConfig config) { return "testAnalysis_jsp"; } %>
<% <%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
String module = "TestAnalysis"; String module = "TestAnalysis";
TestAnalysis testAnalysis = (TestAnalysis) process.getAttribute(module); TestInput testInput = (TestInput) process.getAttribute(module);
if(testAnalysis == null) if(testInput == null)
{ {
testAnalysis = TestAnalysis.createTestAnalysis(objTran); testInput = TestInput.createTestInput(objTran);
process.setAttribute(module, testAnalysis); process.setAttribute(module, testInput);
%><%@include file="/saferedirect.jsp"%><% %><%@include file="/saferedirect.jsp"%><%
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<strong style="line-height: 30px">CSV : </strong> <strong style="line-height: 30px">CSV : </strong>
</oneit:layout_label> </oneit:layout_label>
<oneit:layout_field width="1"> <oneit:layout_field width="1">
<oneit:ormInput obj="<%= testAnalysis %>" attributeName="<%= TestAnalysis.FIELD_CSV %>" type="file" class="form-control" required="required" style="padding:4px;" accept=".csv"/> <oneit:ormInput obj="<%= testInput %>" attributeName="CSV" type="file" class="form-control" required="required" style="padding:4px;" accept=".csv"/>
</oneit:layout_field> </oneit:layout_field>
<oneit:layout_field width="1"> <oneit:layout_field width="1">
<oneit:button value="Import CSV" name="importCSV" cssClass="btn btn-primary" requestAttribs='<%= CollectionUtils.EMPTY_MAP %>'/> <oneit:button value="Import CSV" name="importCSV" cssClass="btn btn-primary" requestAttribs='<%= CollectionUtils.EMPTY_MAP %>'/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment