Commit 7b158927 by Nilu

Enable Notes facility as per original wireframe.

parent a353f770
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_note</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="comment" type="String" nullable="false" length="1000"/>
<column name="created_user_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_note" indexName="idx_tl_note_job_application_id" isUnique="false"><column name="job_application_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE tl_note;
CREATE TABLE tl_note (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
comment varchar(1000) NOT NULL,
created_user_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
ALTER TABLE tl_note ADD
CONSTRAINT PK_tl_note PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_note_job_application_id
ON tl_note (job_application_id);
-- DROP TABLE tl_note;
CREATE TABLE tl_note (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
comment varchar2(1000) NOT NULL,
created_user_id number(12) NOT NULL,
job_application_id number(12) NOT NULL
);
ALTER TABLE tl_note ADD
CONSTRAINT PK_tl_note PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_note_job_application_id
ON tl_note (job_application_id);
-- @AutoRun
-- drop table tl_note;
CREATE TABLE tl_note (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
comment varchar(1000) NOT NULL,
created_user_id numeric(12) NOT NULL,
job_application_id numeric(12) NOT NULL
);
ALTER TABLE tl_note ADD
CONSTRAINT pk_tl_note PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_note_job_application_id
ON tl_note (job_application_id);
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.MultiException;
import performa.orm.CompanyUser;
import performa.orm.JobApplication;
import performa.orm.Note;
public class AddNoteFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("AddNoteFP");
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
BusinessObjectParser.assertFieldCondition(jobApplication.getNote()!= null, jobApplication, JobApplication.FIELD_Note, "mandatory", exceptions, true, request);
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
ObjectTransaction objTran = process.getTransaction();
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Adding note to job application : ", jobApplication);
Note note = Note.createNote(objTran);
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
note.setComment(jobApplication.getNote());
note.setCreatedUser(companyUser);
note.setJobApplication(jobApplication);
LogMgr.log(LOG, LogLevel.PROCESSING1, "New note added : ", note);
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="AssessmentCriteriaAnswers" type="AssessmentCriteriaAnswer" backreferenceName="JobApplication" /> <MULTIPLEREFERENCE name="AssessmentCriteriaAnswers" type="AssessmentCriteriaAnswer" backreferenceName="JobApplication" />
<MULTIPLEREFERENCE name="Notes" type="Note" backreferenceName="JobApplication" />
<TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/> <TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="OverallRank" type="Integer" /> <TRANSIENT name="OverallRank" type="Integer" />
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
<TRANSIENT name="RequirementFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/> <TRANSIENT name="RequirementFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<TRANSIENT name="CultureFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/> <TRANSIENT name="CultureFit" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<TRANSIENT name="FactorScoreDetails" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/> <TRANSIENT name="FactorScoreDetails" type="Map" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE"/>
<TRANSIENT name="Note" type="String" />
<TRANSIENTSINGLE name="WorkFlow" type="WorkFlow" /> <TRANSIENTSINGLE name="WorkFlow" type="WorkFlow" />
......
package performa.orm;
public class Note extends BaseNote
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public Note ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="Note" package="performa.orm">
<IMPORT value="oneit.security.*"/>
<TABLE name="tl_note" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="Comment" type="String" dbcol="comment" length="1000" mandatory="true"/>
<SINGLEREFERENCE name="CreatedUser" type="CompanyUser" dbcol="created_user_id" mandatory="true" />
<SINGLEREFERENCE name="JobApplication" type="JobApplication" dbcol="job_application_id" mandatory="true" backreferenceName="Notes"/>
</TABLE>
<SEARCH type="All" paramFilter="object_id is not null"/>
</BUSINESSCLASS>
</ROOT>
...@@ -3693,7 +3693,7 @@ span.appli-progress-bar { ...@@ -3693,7 +3693,7 @@ span.appli-progress-bar {
margin-bottom: 10px; margin-bottom: 10px;
text-align: left; text-align: left;
} }
input.add-note-btn { button.add-note-btn {
display: inline-block; display: inline-block;
height: 30px; height: 30px;
border-radius: 100px; border-radius: 100px;
...@@ -3708,7 +3708,7 @@ input.add-note-btn { ...@@ -3708,7 +3708,7 @@ input.add-note-btn {
padding: 0; padding: 0;
width: 100px; width: 100px;
} }
input.add-note-btn:hover{ button.add-note-btn:hover{
background-color: #434c58; background-color: #434c58;
} }
.note-txt-box { .note-txt-box {
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<FORM name="*.loadRequirementsFromTemplate" factory="Participant" class="performa.form.LoadRequirementsFromTemplateFP"/> <FORM name="*.loadRequirementsFromTemplate" factory="Participant" class="performa.form.LoadRequirementsFromTemplateFP"/>
<FORM name="*.loadCultureFromTemplate" factory="Participant" class="performa.form.LoadCultureFromTemplateFP"/> <FORM name="*.loadCultureFromTemplate" factory="Participant" class="performa.form.LoadCultureFromTemplateFP"/>
<FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/> <FORM name="*.changeApplicationStatus" factory="Participant" class="performa.form.ChangeApplicationStatusFP"/>
<FORM name="*.addNote" factory="Participant" class="performa.form.AddNoteFP"/>
<FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/> <FORM name="*.bulkupdate" factory="Participant" class="performa.form.BulkUpdateFP"/>
<FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/> <FORM name="*.navigateBetweenStatus" factory="Participant" class="performa.form.NavigateBetweenStatusFP"/>
<FORM name="*.sendCompanyUserInvites" factory="Participant" class="performa.form.SendCompanyUserInvitesFP"> <FORM name="*.sendCompanyUserInvites" factory="Participant" class="performa.form.SendCompanyUserInvitesFP">
......
...@@ -657,24 +657,32 @@ ...@@ -657,24 +657,32 @@
} }
%> %>
</div> </div>
<%--
<div class="applicant-note" > <div class="applicant-note" >
<div class="applicant-note-title">Notes</div> <div class="applicant-note-title">Notes</div>
<div class="note-txt-box"> <div class="note-txt-box">
<textarea class="form-control"></textarea> <oneit:ormtextarea obj="<%= jobApplication %>" attributeName="Note" cssClass="form-control"/>
<input type="button" class="add-note-btn" value="ADD NOTE" /> <oneit:button name="addNote" value="ADD NOTE" cssClass="add-note-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).mapEntry("Job", job).toMap())
.mapEntry ("attribNamesToRestore", new HashSet<String> (Arrays.asList(new String[] {"Job", "JobApplication", "Applications"})))
.mapEntry("JobApplication", jobApplication)
.toMap() %>" />
</div> </div>
</div> </div>
<div class="admin-notes"> <div class="admin-notes">
<div class="admin-name">Admin name</div> <%
<div class="date-value">TODAY</div> for (Note note : jobApplication.getNotesSet())
<div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent accumsan interdum nisi, sed laoreet dui rhoncus.</div> {
<div class="admin-br-line"></div> %>
<div class="admin-name">Admin name</div> <div class="admin-name"><oneit:toString value="<%= note.getCreatedUser() %>" mode="EscapeHTML"/></div>
<div class="date-value">2 days ago</div> <div class="date-value"><oneit:toString value="<%= note.getObjectCreated() %>" mode="MidDate"/></div>
<div class="admin-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div> <div class="admin-text"><oneit:toString value="<%= note.getComment() %>" mode="EscapeHTML"/></div>
<div class="admin-br-line"></div>
<%
}
%>
</div> </div>
--%>
</div> </div>
</div> </div>
</div> </div>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_note</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="comment" type="String" nullable="false" length="1000"/>
<column name="created_user_id" type="Long" length="11" nullable="false"/>
<column name="job_application_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_note" indexName="idx_tl_note_job_application_id" isUnique="false">
<column name="job_application_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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