Commit 8f0fee74 by john

Finish 20171023

parents 1576dac4 b7132697
......@@ -10,7 +10,7 @@
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="importance" type="String" nullable="false" length="200"/>
<column name="culture_element_id" type="Long" length="11" nullable="false"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="false"/>
<column name="culture_element_rating_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="template_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -10,7 +10,7 @@ CREATE TABLE tl_culture_criteria (
,
importance varchar(200) NOT NULL,
culture_element_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NULL,
job_id numeric(12) NULL,
template_id numeric(12) NULL
);
......
......@@ -11,7 +11,7 @@ CREATE TABLE tl_culture_criteria (
,
importance varchar2(200) NOT NULL,
culture_element_id number(12) NOT NULL,
culture_element_rating_id number(12) NOT NULL,
culture_element_rating_id number(12) NULL,
job_id number(12) NULL,
template_id number(12) NULL
);
......
......@@ -11,7 +11,7 @@ CREATE TABLE tl_culture_criteria (
,
importance varchar(200) NOT NULL,
culture_element_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NOT NULL,
culture_element_rating_id numeric(12) NULL,
job_id numeric(12) NULL,
template_id numeric(12) NULL
);
......
package performa.form;
import oneit.servlets.forms.*;
import oneit.utils.*;
import performa.orm.CultureCriteria;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.process.ORMProcessState;
import performa.orm.Job;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.process.ProcessRedirectResult;
import oneit.servlets.process.SaveFP;
public class ProcessCultureFP extends SaveFP
{
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
return new ProcessRedirectResult((String) submission.getRequest().getAttribute("nextPage"), new String[0]);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
super.validate(process, submission, exceptions, params);
HttpServletRequest request = submission.getRequest();
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null, "No job found . Call from " + getClass().getName());
for(CultureCriteria criteria: job.getCultureCriteriasSet())
{
if(criteria.isRatingRequired())
{
BusinessObjectParser.assertFieldCondition(criteria.getCultureElementRating() != null, criteria , CultureCriteria.SINGLEREFERENCE_CultureElementRating, "mandatory", exceptions, true, request);
}
}
}
}
\ No newline at end of file
......@@ -49,7 +49,11 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor
criteriaCopy.setCultureElement(criteria.getCultureElement().getInTransaction(newObjTran));
criteriaCopy.setImportance(criteria.getImportance());
if(criteria.getCultureElementRating()!=null)
{
criteriaCopy.setCultureElementRating(criteria.getCultureElementRating().getInTransaction(newObjTran));
}
newTemplate.addToCultureCriterias(criteriaCopy);
}
......@@ -71,6 +75,14 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
for(CultureCriteria criteria: job.getCultureCriteriasSet())
{
if(criteria.isRatingRequired())
{
BusinessObjectParser.assertFieldCondition(criteria.getCultureElementRating() != null, criteria , CultureCriteria.SINGLEREFERENCE_CultureElementRating, "mandatory", exceptions, true, request);
}
}
BusinessObjectParser.assertFieldCondition(job.getCultureTemplateName() != null, job , Job.FIELD_CultureTemplateName, "mandatory", exceptions, true, request);
super.validate(process, submission, exceptions, params);
......
......@@ -14,7 +14,6 @@ import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.DateDiff;
import performa.orm.Job;
import performa.orm.ShortenedURL;
import performa.orm.types.JobStatus;
......@@ -25,6 +24,7 @@ public class SaveJobFP extends SaveFP
{
HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob");
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In SaveJobFP saving job : ", job );
......@@ -36,6 +36,15 @@ public class SaveJobFP extends SaveFP
job.setOpenDate(new Date());
}
if(openJob==Boolean.TRUE)
{
job.setJobStatus(JobStatus.OPEN);
job.setApplyBy(DateDiff.add(DateDiff.getToday(), Calendar.DATE, 30));
job.setOpenDate(new Date());
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"Job status changed as Open. ", job );
}
if(job.getJobStatus() == JobStatus.OPEN && job.getShortenedURL() == null)
{
job.createShortenedURL();
......
......@@ -130,7 +130,7 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "culture_element_rating_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "CultureElementRating");
metaInfo.put ("type", "CultureElementRating");
......@@ -704,7 +704,6 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
*/
public void setCultureElementRating (CultureElementRating newCultureElementRating) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newCultureElementRating != null, this, SINGLEREFERENCE_CultureElementRating, "mandatory");
if (_CultureElementRating.wouldReferencedChange (newCultureElementRating))
......@@ -1231,8 +1230,6 @@ public abstract class BaseCultureCriteria extends BaseBusinessClass
context.check (getCultureElementID() != null, this, SINGLEREFERENCE_CultureElement, "mandatory");
context.check (getCultureElementRatingID() != null, this, SINGLEREFERENCE_CultureElementRating, "mandatory");
}
......
package performa.orm;
import performa.orm.types.Importance;
public class CultureCriteria extends BaseCultureCriteria
{
......@@ -10,4 +12,10 @@ public class CultureCriteria extends BaseCultureCriteria
{
// Do not add any code to this, always put it in initialiseNewObject
}
public Boolean isRatingRequired()
{
return getImportance()!=null && getImportance()!=Importance.NOT_APPLICABLE;
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<ATTRIB name="Importance" type="Importance" dbcol="importance" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="Importance.NOT_APPLICABLE"/>
<SINGLEREFERENCE name="CultureElement" type="CultureElement" dbcol="culture_element_id" mandatory="true" />
<SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id" mandatory="true" />
<SINGLEREFERENCE name="CultureElementRating" type="CultureElementRating" dbcol="culture_element_rating_id" mandatory="false" />
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="CultureCriterias"/>
<SINGLEREFERENCE name="Template" type="CultureCriteriaTemplate" dbcol="template_id" backreferenceName="CultureCriterias"/>
......
......@@ -52,6 +52,7 @@
</FORM>
<FORM name="*.saveClient" factory="Participant" class="performa.form.SaveClientFP"/>
<FORM name="*.saveCompany" factory="Participant" class="performa.form.SaveCompanyFP"/>
<FORM name="*.processCulture" factory="Participant" class="performa.form.ProcessCultureFP"/>
</NODE>
<NODE name="job_assessment_criteria_add_jsp" factory="Participant">
......
......@@ -29,7 +29,7 @@
</oneit:button>
</li>
<li class="<%= pageNumber == "2" ? "active" : CollectionUtils.equals(job.getCompletedAssessmentType(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>">
......@@ -38,7 +38,7 @@
</oneit:button>
</li>
<li class="<%= pageNumber == "3" ? "active" : CollectionUtils.equals(job.getCompletedCulture(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>">
......@@ -47,7 +47,7 @@
</oneit:button>
</li>
<li class="<%= pageNumber == "4" ? "active" : CollectionUtils.equals(job.getCompletedRequirements(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fourthPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>">
......@@ -56,7 +56,7 @@
</oneit:button>
</li>
<li class="<%= pageNumber == "5" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", fifthPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>">
......
......@@ -215,6 +215,7 @@
<oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fifthPage)
.mapEntry ("openJob", Boolean.TRUE)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" />
......
......@@ -188,6 +188,7 @@
</span>
</div>
</div>
<oneit:recalcClass htmlTag="div" classScript="criteria.isRatingRequired() ? 'show': 'hide'" criteria="<%= criteria %>">
<%
for (CultureElementRating rating : criteria.getCultureElement().getRatingsSet())
{
......@@ -203,6 +204,7 @@
<%
}
%>
</oneit:recalcClass>
</div>
<div class="form-brack-line-sub"></div>
<%
......@@ -239,8 +241,9 @@
</div>
</oneit:recalcClass>
<div class="text-center">
<oneit:button value="Proceed to Requirements" name="gotoPage" cssClass="btn btn-primary top-margin-25 largeBtn"
<oneit:button value="Proceed to Requirements" name="processCulture" cssClass="btn btn-primary top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job", job)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.toMap() %>" />
</div>
......
-- @AutoRun
ALTER TABLE tl_culture_criteria ALTER COLUMN culture_element_rating_id DROP NOT NULL;
\ 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