Commit a50e806c by nilu

adding web service for create job visibility - for header functions

parent 835682f0
package performa.ws;
import java.util.Set;
import oneit.appservices.ws.JSONServiceRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.BaseBusinessClass;
import oneit.objstore.ObjectTransaction;
import oneit.utils.BusinessException;
import oneit.utils.MultiException;
import org.json.JSONException;
import org.json.JSONObject;
import performa.orm.HiringTeam;
public class CreateJobVisibilityFP extends BaseCreateJobVisibilityFP
{
private static final long serialVersionUID = 0L;
public static LoggingArea LOG = LoggingArea.createLoggingArea("CreateJobVisibilityFP");
// This constructor should not be called
public CreateJobVisibilityFP ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public void processForm(JSONServiceRequest request, ObjectTransaction objTran, JSONObject result, MultiException exceptions,
Set<BaseBusinessClass> createdBBCs, Set<BaseBusinessClass> updatedBBCs) throws BusinessException, JSONException
{
HiringTeam selectedTeam = getSelectedTeam();
LogMgr.log(LOG, LogLevel.PROCESSING1, "Checking Create Job Visibility. Selected Team: ", selectedTeam , " Company User: " , getCompanyUser());
if(getCompanyUser() != null && selectedTeam != null)
{
boolean canCreateJob = selectedTeam.allowJobCreation();
boolean trialNotAllowed = selectedTeam.trialJobNotAllowed();
result.append("AllowCreateJob", canCreateJob ? "SUCCESS" : trialNotAllowed ? "TRIAL" : "REACHED_CAP");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Can Create Job : " , canCreateJob , " Trial Not Allowed: ", trialNotAllowed);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name='CreateJobVisibilityFP' package='performa.ws' superclass='WebServicesFormProcessor'>
       <IMPORT value="oneit.appservices.ws.services.*"/>
<IMPORT value="performa.orm.*"/>
<TABLE tablePrefix="object" polymorphic="FALSE">
<SINGLEREFERENCE name="SelectedTeam" type="HiringTeam" mandatory="true" />
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" mandatory="true" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
...@@ -108,6 +108,10 @@ ...@@ -108,6 +108,10 @@
<Overview>This service will set all messages to read in given job application</Overview> <Overview>This service will set all messages to read in given job application</Overview>
</NODE> </NODE>
<NODE name="CreateJobVisibility" factory="Participant" class="oneit.appservices.ws.services.ORMFormProcessorService" fpClass="performa.ws.CreateJobVisibilityFP" privilege="*">
<Overview>This service will return whether a job can be created for the selected hiring team</Overview>
</NODE>
<NODE name="JobApplications" factory="Participant" class="oneit.appservices.ws.services.ORMSearchJSONService" boClass="performa.orm.JobApplication" privilege="*"> <NODE name="JobApplications" factory="Participant" class="oneit.appservices.ws.services.ORMSearchJSONService" boClass="performa.orm.JobApplication" privilege="*">
<Overview>This service returns all the Job Applications</Overview> <Overview>This service returns all the Job Applications</Overview>
......
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