Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
bafa58d8
Commit
bafa58d8
authored
Apr 08, 2019
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
S28813350 # Client - Incoming Issues (raised by Client) #Location to be mandatory
parent
a1cb6437
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
2 deletions
+197
-2
SendVerificationMailFP.java
cmsWebApp/src/performa/form/SendVerificationMailFP.java
+3
-0
BaseCandidate.java
cmsWebApp/src/performa/orm/BaseCandidate.java
+177
-0
Candidate.xml
cmsWebApp/src/performa/orm/Candidate.xml
+1
-0
verify_identity.jsp
...pp/webroot/extensions/applicantportal/verify_identity.jsp
+7
-2
google_address.js
cmsWebApp/webroot/scripts/google_address.js
+9
-0
No files found.
cmsWebApp/src/performa/form/SendVerificationMailFP.java
View file @
bafa58d8
...
...
@@ -62,6 +62,9 @@ public class SendVerificationMailFP extends SaveFP
BusinessObjectParser
.
assertFieldCondition
(
jobApplication
.
getCV
()
!=
null
,
jobApplication
,
JobApplication
.
FIELD_CV
,
"uploadCV"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
jobApplication
.
getCoverLetter
()
!=
null
,
jobApplication
,
JobApplication
.
FIELD_CoverLetter
,
"uploadCover"
,
exceptions
,
true
,
request
);
}
BusinessObjectParser
.
assertFieldCondition
(
candidate
.
getGoogleAddressText
()
!=
null
,
candidate
,
Candidate
.
FIELD_GoogleAddressText
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
candidate
.
isTrue
(
candidate
.
getHasValidAddress
()),
candidate
,
Candidate
.
FIELD_GoogleAddressText
,
"invalid"
,
exceptions
,
true
,
request
);
}
super
.
validate
(
process
,
submission
,
exceptions
,
params
);
...
...
cmsWebApp/src/performa/orm/BaseCandidate.java
View file @
bafa58d8
...
...
@@ -53,6 +53,7 @@ public abstract class BaseCandidate extends SecUserExtension
public
static
final
String
FIELD_KnownAsAlias
=
"KnownAsAlias"
;
public
static
final
String
FIELD_PrivacyPolicyAgreed
=
"PrivacyPolicyAgreed"
;
public
static
final
String
FIELD_ConditionsAgreed
=
"ConditionsAgreed"
;
public
static
final
String
FIELD_HasValidAddress
=
"HasValidAddress"
;
public
static
final
String
SINGLEREFERENCE_TestInput
=
"TestInput"
;
public
static
final
String
BACKREF_TestInput
=
""
;
public
static
final
String
MULTIPLEREFERENCE_TestAnalysises
=
"TestAnalysises"
;
...
...
@@ -84,6 +85,7 @@ public abstract class BaseCandidate extends SecUserExtension
private
static
final
DefaultAttributeHelper
<
Candidate
>
HELPER_KnownAsAlias
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Candidate
>
HELPER_PrivacyPolicyAgreed
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Candidate
>
HELPER_ConditionsAgreed
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Candidate
>
HELPER_HasValidAddress
=
DefaultAttributeHelper
.
INSTANCE
;
// Private attributes corresponding to business object data
...
...
@@ -100,6 +102,7 @@ public abstract class BaseCandidate extends SecUserExtension
private
String
_KnownAsAlias
;
private
Boolean
_PrivacyPolicyAgreed
;
private
Boolean
_ConditionsAgreed
;
private
Boolean
_HasValidAddress
;
// Private attributes corresponding to single references
...
...
@@ -119,6 +122,7 @@ public abstract class BaseCandidate extends SecUserExtension
// Arrays of validators for each attribute
private
static
final
AttributeValidator
[]
FIELD_PrivacyPolicyAgreed_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ConditionsAgreed_Validators
;
private
static
final
AttributeValidator
[]
FIELD_HasValidAddress_Validators
;
private
static
final
AttributeValidator
[]
FIELD_Phone_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ForgotPasswordMailSendDate_Validators
;
private
static
final
AttributeValidator
[]
FIELD_ForgotPasswordKey_Validators
;
...
...
@@ -155,6 +159,7 @@ public abstract class BaseCandidate extends SecUserExtension
setupAssocMetaData_TestInput
();
FIELD_PrivacyPolicyAgreed_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_PrivacyPolicyAgreed
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ConditionsAgreed_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ConditionsAgreed
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_HasValidAddress_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_HasValidAddress
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_Phone_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_Phone
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ForgotPasswordMailSendDate_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ForgotPasswordMailSendDate
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_ForgotPasswordKey_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_ForgotPasswordKey
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
...
...
@@ -288,6 +293,24 @@ public abstract class BaseCandidate extends SecUserExtension
}
// Meta Info setup
private
static
List
setupAttribMetaData_HasValidAddress
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"defaultValue"
,
"Boolean.FALSE"
);
metaInfo
.
put
(
"name"
,
"HasValidAddress"
);
metaInfo
.
put
(
"type"
,
"Boolean"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Candidate.HasValidAddress:"
,
metaInfo
);
ATTRIBUTES_METADATA_Candidate
.
put
(
FIELD_HasValidAddress
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Candidate
.
class
,
"HasValidAddress"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Candidate.HasValidAddress:"
,
validators
);
return
validators
;
}
// Meta Info setup
private
static
List
setupAttribMetaData_Phone
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
...
...
@@ -534,6 +557,7 @@ public abstract class BaseCandidate extends SecUserExtension
_KnownAsAlias
=
(
String
)(
HELPER_KnownAsAlias
.
initialise
(
_KnownAsAlias
));
_PrivacyPolicyAgreed
=
(
Boolean
)(
Boolean
.
FALSE
);
_ConditionsAgreed
=
(
Boolean
)(
Boolean
.
FALSE
);
_HasValidAddress
=
(
Boolean
)(
Boolean
.
FALSE
);
}
...
...
@@ -1842,6 +1866,104 @@ public abstract class BaseCandidate extends SecUserExtension
}
}
/**
* Get the attribute HasValidAddress
*/
public
Boolean
getHasValidAddress
()
{
assertValid
();
Boolean
valToReturn
=
_HasValidAddress
;
for
(
CandidateBehaviourDecorator
bhd
:
Candidate_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getHasValidAddress
((
Candidate
)
this
,
valToReturn
);
}
return
valToReturn
;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected
void
preHasValidAddressChange
(
Boolean
newHasValidAddress
)
throws
FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected
void
postHasValidAddressChange
()
throws
FieldException
{
}
public
FieldWriteability
getWriteability_HasValidAddress
()
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
/**
* Set the attribute HasValidAddress. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public
void
setHasValidAddress
(
Boolean
newHasValidAddress
)
throws
FieldException
{
boolean
oldAndNewIdentical
=
HELPER_HasValidAddress
.
compare
(
_HasValidAddress
,
newHasValidAddress
);
try
{
for
(
CandidateBehaviourDecorator
bhd
:
Candidate_BehaviourDecorators
)
{
newHasValidAddress
=
bhd
.
setHasValidAddress
((
Candidate
)
this
,
newHasValidAddress
);
oldAndNewIdentical
=
HELPER_HasValidAddress
.
compare
(
_HasValidAddress
,
newHasValidAddress
);
}
if
(
FIELD_HasValidAddress_Validators
.
length
>
0
)
{
Object
newHasValidAddressObj
=
HELPER_HasValidAddress
.
toObject
(
newHasValidAddress
);
if
(
newHasValidAddressObj
!=
null
)
{
int
loopMax
=
FIELD_HasValidAddress_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Candidate
.
get
(
FIELD_HasValidAddress
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
FIELD_HasValidAddress_Validators
[
v
].
checkAttribute
(
this
,
FIELD_HasValidAddress
,
metadata
,
newHasValidAddressObj
);
}
}
}
}
catch
(
FieldException
e
)
{
if
(!
oldAndNewIdentical
)
{
e
.
setWouldModify
();
}
throw
e
;
}
if
(!
oldAndNewIdentical
)
{
assertValid
();
Debug
.
assertion
(
getWriteability_HasValidAddress
()
!=
FieldWriteability
.
FALSE
,
"Field HasValidAddress is not writeable"
);
preHasValidAddressChange
(
newHasValidAddress
);
markFieldChange
(
FIELD_HasValidAddress
);
_HasValidAddress
=
newHasValidAddress
;
postFieldChange
(
FIELD_HasValidAddress
);
postHasValidAddressChange
();
}
}
/**
...
...
@@ -2909,6 +3031,7 @@ public abstract class BaseCandidate extends SecUserExtension
_KnownAsAlias
=
sourceCandidate
.
_KnownAsAlias
;
_PrivacyPolicyAgreed
=
sourceCandidate
.
_PrivacyPolicyAgreed
;
_ConditionsAgreed
=
sourceCandidate
.
_ConditionsAgreed
;
_HasValidAddress
=
sourceCandidate
.
_HasValidAddress
;
}
}
...
...
@@ -2979,6 +3102,7 @@ public abstract class BaseCandidate extends SecUserExtension
_KnownAsAlias
=
(
String
)(
HELPER_KnownAsAlias
.
readExternal
(
_KnownAsAlias
,
vals
.
get
(
FIELD_KnownAsAlias
)));
//
_PrivacyPolicyAgreed
=
(
Boolean
)(
HELPER_PrivacyPolicyAgreed
.
readExternal
(
_PrivacyPolicyAgreed
,
vals
.
get
(
FIELD_PrivacyPolicyAgreed
)));
//
_ConditionsAgreed
=
(
Boolean
)(
HELPER_ConditionsAgreed
.
readExternal
(
_ConditionsAgreed
,
vals
.
get
(
FIELD_ConditionsAgreed
)));
//
_HasValidAddress
=
(
Boolean
)(
HELPER_HasValidAddress
.
readExternal
(
_HasValidAddress
,
vals
.
get
(
FIELD_HasValidAddress
)));
//
_TestInput
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_TestInput
));
_TestAnalysises
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_TestAnalysises
));
_JobApplications
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_JobApplications
));
...
...
@@ -3008,6 +3132,7 @@ public abstract class BaseCandidate extends SecUserExtension
vals
.
put
(
FIELD_KnownAsAlias
,
HELPER_KnownAsAlias
.
writeExternal
(
_KnownAsAlias
));
vals
.
put
(
FIELD_PrivacyPolicyAgreed
,
HELPER_PrivacyPolicyAgreed
.
writeExternal
(
_PrivacyPolicyAgreed
));
vals
.
put
(
FIELD_ConditionsAgreed
,
HELPER_ConditionsAgreed
.
writeExternal
(
_ConditionsAgreed
));
vals
.
put
(
FIELD_HasValidAddress
,
HELPER_HasValidAddress
.
writeExternal
(
_HasValidAddress
));
vals
.
put
(
SINGLEREFERENCE_TestInput
,
_TestInput
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_TestAnalysises
,
_TestAnalysises
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_JobApplications
,
_JobApplications
.
writeExternalData
());
...
...
@@ -3091,6 +3216,7 @@ public abstract class BaseCandidate extends SecUserExtension
visitor
.
visitField
(
this
,
FIELD_PrivacyPolicyAgreed
,
HELPER_PrivacyPolicyAgreed
.
toObject
(
getPrivacyPolicyAgreed
()));
visitor
.
visitField
(
this
,
FIELD_ConditionsAgreed
,
HELPER_ConditionsAgreed
.
toObject
(
getConditionsAgreed
()));
visitor
.
visitField
(
this
,
FIELD_HasValidAddress
,
HELPER_HasValidAddress
.
toObject
(
getHasValidAddress
()));
}
...
...
@@ -3590,6 +3716,10 @@ public abstract class BaseCandidate extends SecUserExtension
{
return
HELPER_ConditionsAgreed
.
toObject
(
getConditionsAgreed
());
}
else
if
(
attribName
.
equals
(
FIELD_HasValidAddress
))
{
return
HELPER_HasValidAddress
.
toObject
(
getHasValidAddress
());
}
else
{
return
super
.
getAttribute
(
attribName
);
...
...
@@ -3655,6 +3785,10 @@ public abstract class BaseCandidate extends SecUserExtension
{
return
HELPER_ConditionsAgreed
;
}
else
if
(
attribName
.
equals
(
FIELD_HasValidAddress
))
{
return
HELPER_HasValidAddress
;
}
else
{
return
super
.
getAttributeHelper
(
attribName
);
...
...
@@ -3720,6 +3854,10 @@ public abstract class BaseCandidate extends SecUserExtension
{
setConditionsAgreed
((
Boolean
)(
HELPER_ConditionsAgreed
.
fromObject
(
_ConditionsAgreed
,
attribValue
)));
}
else
if
(
attribName
.
equals
(
FIELD_HasValidAddress
))
{
setHasValidAddress
((
Boolean
)(
HELPER_HasValidAddress
.
fromObject
(
_HasValidAddress
,
attribValue
)));
}
else
{
super
.
setAttribute
(
attribName
,
attribValue
);
...
...
@@ -3812,6 +3950,10 @@ public abstract class BaseCandidate extends SecUserExtension
{
return
getWriteability_ConditionsAgreed
();
}
else
if
(
fieldName
.
equals
(
FIELD_HasValidAddress
))
{
return
getWriteability_HasValidAddress
();
}
else
{
return
super
.
getWriteable
(
fieldName
);
...
...
@@ -3887,6 +4029,11 @@ public abstract class BaseCandidate extends SecUserExtension
fields
.
add
(
FIELD_ConditionsAgreed
);
}
if
(
getWriteability_HasValidAddress
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_HasValidAddress
);
}
super
.
putUnwriteable
(
fields
);
}
...
...
@@ -3909,6 +4056,7 @@ public abstract class BaseCandidate extends SecUserExtension
result
.
add
(
HELPER_KnownAsAlias
.
getAttribObject
(
getClass
(),
_KnownAsAlias
,
false
,
FIELD_KnownAsAlias
));
result
.
add
(
HELPER_PrivacyPolicyAgreed
.
getAttribObject
(
getClass
(),
_PrivacyPolicyAgreed
,
false
,
FIELD_PrivacyPolicyAgreed
));
result
.
add
(
HELPER_ConditionsAgreed
.
getAttribObject
(
getClass
(),
_ConditionsAgreed
,
false
,
FIELD_ConditionsAgreed
));
result
.
add
(
HELPER_HasValidAddress
.
getAttribObject
(
getClass
(),
_HasValidAddress
,
false
,
FIELD_HasValidAddress
));
return
result
;
}
...
...
@@ -4193,6 +4341,24 @@ public abstract class BaseCandidate extends SecUserExtension
return
newConditionsAgreed
;
}
/**
* Get the attribute HasValidAddress
*/
public
Boolean
getHasValidAddress
(
Candidate
obj
,
Boolean
original
)
{
return
original
;
}
/**
* Change the value set for attribute HasValidAddress.
* May modify the field beforehand
* Occurs before validation.
*/
public
Boolean
setHasValidAddress
(
Candidate
obj
,
Boolean
newHasValidAddress
)
throws
FieldException
{
return
newHasValidAddress
;
}
}
...
...
@@ -4269,6 +4435,10 @@ public abstract class BaseCandidate extends SecUserExtension
{
return
toConditionsAgreed
();
}
if
(
name
.
equals
(
"HasValidAddress"
))
{
return
toHasValidAddress
();
}
if
(
name
.
equals
(
"Phone"
))
{
return
toPhone
();
...
...
@@ -4327,6 +4497,8 @@ public abstract class BaseCandidate extends SecUserExtension
public
PipeLine
<
From
,
Boolean
>
toConditionsAgreed
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Boolean
>(
FIELD_ConditionsAgreed
));
}
public
PipeLine
<
From
,
Boolean
>
toHasValidAddress
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Boolean
>(
FIELD_HasValidAddress
));
}
public
PipeLine
<
From
,
String
>
toPhone
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_Phone
));
}
public
PipeLine
<
From
,
Date
>
toForgotPasswordMailSendDate
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Date
>(
FIELD_ForgotPasswordMailSendDate
));
}
...
...
@@ -4394,6 +4566,11 @@ public abstract class BaseCandidate extends SecUserExtension
return
true
;
}
if
(
CollectionUtils
.
equals
(
attribName
,
"HasValidAddress"
))
{
return
true
;
}
return
super
.
isTransientAttrib
(
attribName
);
}
...
...
cmsWebApp/src/performa/orm/Candidate.xml
View file @
bafa58d8
...
...
@@ -13,6 +13,7 @@
<TRANSIENT
name=
"PrivacyPolicyAgreed"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"ConditionsAgreed"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"HasValidAddress"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TABLE
name=
"oneit_sec_user_extension"
tablePrefix=
"object"
polymorphic=
"TRUE"
>
...
...
cmsWebApp/webroot/extensions/applicantportal/verify_identity.jsp
View file @
bafa58d8
...
...
@@ -54,7 +54,9 @@
{
response.sendRedirect(candidate.isFalse(candidate.getIsAccountVerified()) ? successPage : nextPage +"&JobApplicationID="+ jobApplication.getID().toString());
}
candidate.setHasValidAddress(candidate.getGoogleAddressText() != null);
process.setAttribute("JobApplication", jobApplication);
%>
<oneit:script>
...
...
@@ -243,7 +245,10 @@
<hr class="seperate-line">
<div class="form-group text-left">
<label>Location</label>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" />
<div class="googleAddress">
<oneit:ormInput obj="<%= candidate %>" class="has-valid-address" attributeName="HasValidAddress" type="checkbox"/>
<oneit:ormInput obj="<%= candidate %>" type="text" attributeName="GoogleAddressText" class="autoAddress" id="<%= "gAddress_"+candidate.getObjectID() %>" placeholder="Enter your address" cssClass="form-control" />
</div>
</div>
<div class="form-group text-left" style="margin-top: 30px;">
<div class="styled_checkboxes">
...
...
cmsWebApp/webroot/scripts/google_address.js
View file @
bafa58d8
...
...
@@ -30,6 +30,12 @@ function addGoogleAddressListener(domSelector)
parentDiv
.
find
(
"."
+
component
).
val
(
''
);
}
}
if
(
$
(
this
).
val
()
&&
trim
(
$
(
this
).
val
()))
{
var
parentDiv
=
$
(
domSelector
).
closest
(
'.googleAddress'
);
parentDiv
.
find
(
".has-valid-address"
).
prop
(
"checked"
,
false
);
}
})
$
(
domSelector
).
keypress
(
function
(
e
)
{
...
...
@@ -43,6 +49,9 @@ function addGoogleAddressListener(domSelector)
place
=
autocomplete
.
getPlace
();
googleAutoComplete
[
domSelector
]
=
place
;
placeChanged
(
domSelector
);
var
parentDiv
=
$
(
domSelector
).
closest
(
'.googleAddress'
);
parentDiv
.
find
(
".has-valid-address"
).
prop
(
"checked"
,
true
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment