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
794aa598
Commit
794aa598
authored
Sep 25, 2017
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review changes
parent
615d5f78
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
279 additions
and
213 deletions
+279
-213
SendCompanyUserInvitesFP.java
cmsWebApp/src/performa/form/SendCompanyUserInvitesFP.java
+8
-12
SendVerificationMailFP.java
cmsWebApp/src/performa/form/SendVerificationMailFP.java
+2
-2
SignInCandidateFP.java
cmsWebApp/src/performa/form/SignInCandidateFP.java
+1
-0
VerifyCompanyUserFP.java
cmsWebApp/src/performa/form/VerifyCompanyUserFP.java
+0
-172
BaseCompany.java
cmsWebApp/src/performa/orm/BaseCompany.java
+177
-0
Company.java
cmsWebApp/src/performa/orm/Company.java
+15
-0
Company.xml
cmsWebApp/src/performa/orm/Company.xml
+1
-0
Utils.java
cmsWebApp/src/performa/utils/Utils.java
+11
-0
WebUtils.java
cmsWebApp/src/performa/utils/WebUtils.java
+2
-0
CustomServlets_adminPortal.xml
...oot/extensions/adminportal/CustomServlets_adminPortal.xml
+0
-3
company_profile.jsp
cmsWebApp/webroot/extensions/adminportal/company_profile.jsp
+7
-7
company_profile_tabs.jsp
...broot/extensions/adminportal/inc/company_profile_tabs.jsp
+40
-0
invite_users.jsp
cmsWebApp/webroot/extensions/adminportal/invite_users.jsp
+6
-11
fieldnamesOverride.txt
...ot/extensions/adminportal/messages/fieldnamesOverride.txt
+1
-0
verify_company.jsp
cmsWebApp/webroot/extensions/adminportal/verify_company.jsp
+8
-6
No files found.
cmsWebApp/src/performa/form/SendCompanyUserInvitesFP.java
View file @
794aa598
...
...
@@ -23,7 +23,7 @@ import performa.utils.Utils;
import
performa.utils.WebUtils
;
public
class
SendCompanyUserInvitesFP
extends
ORMProcessFormProcessor
public
class
SendCompanyUserInvitesFP
extends
SaveFP
{
private
static
final
LoggingArea
LOG
=
LoggingArea
.
createLoggingArea
(
"SendCompanyUserInvites"
);
...
...
@@ -49,6 +49,11 @@ public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
}
}
if
(!
company
.
isTrue
(
company
.
getIsVerified
()))
{
BusinessObjectParser
.
assertFieldCondition
(
company
.
getCompanyName
()!=
null
,
company
,
Company
.
FIELD_CompanyName
,
"mandatory"
,
exceptions
,
true
,
request
);
}
super
.
validate
(
process
,
submission
,
exceptions
,
params
);
}
...
...
@@ -61,7 +66,6 @@ public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
Company
company
=
(
Company
)
process
.
getAttribute
(
"Company"
);
CompanyUser
companyUser
=
company
.
getAddedByUser
();
SecUser
secUser
=
companyUser
.
getUser
();
String
nextPage
=
(
String
)
request
.
getAttribute
(
"nextPage"
);
Boolean
socialLogin
=
CollectionUtils
.
equals
(
process
.
getAttribute
(
"socialLogin"
),
Boolean
.
TRUE
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Verifing Company User"
,
companyUser
,
secUser
);
...
...
@@ -73,7 +77,6 @@ public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
if
(!
socialLogin
)
{
secUser
.
setAttribute
(
"md5:"
+
SecUser
.
FIELD_Password
,
companyUser
.
getPassword
());
request
.
getSession
().
setAttribute
(
SecUser
.
SEC_USER_ID
,
secUser
);
request
.
getSession
().
setAttribute
(
SessionSecUserDecorator
.
REFRESH_SECURITY
,
Boolean
.
TRUE
);
...
...
@@ -89,16 +92,11 @@ public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
{
if
(!
CollectionUtils
.
equals
(
cUser
,
companyUser
))
{
Tuple
.
T2
<
SecUser
,
Boolean
>
userdata
=
Utils
.
getSecUserForCompanyIfAvailable
(
cUser
);
SecUser
sUser
=
userdata
.
get0
();
SecUser
sUser
=
cUser
.
getUser
();
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Started to send invitaion email."
,
cUser
);
if
(!
userdata
.
get1
())
//check user availablility
{
sUser
.
setUserName
(
sUser
.
getEmail
().
toLowerCase
());
}
sUser
.
setAttribute
(
"md5:"
+
SecUser
.
FIELD_Password
,
CompanyUser
.
DEFAULT_PASSWORD
);
sUser
.
addRole
(
Utils
.
getRole
(
Utils
.
ROLE_CLIENT
,
objTran
));
...
...
@@ -116,9 +114,7 @@ public class SendCompanyUserInvitesFP extends ORMProcessFormProcessor
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
);
process
.
completeAndRestart
();
return
new
ProcessRedirectResult
(
nextPage
,
new
String
[
0
]);
return
super
.
processForm
(
process
,
submission
,
params
);
}
...
...
cmsWebApp/src/performa/form/SendVerificationMailFP.java
View file @
794aa598
...
...
@@ -42,11 +42,11 @@ public class SendVerificationMailFP extends SaveFP
CompanyUser
companyUser
=
company
.
getAddedByUser
();
SecUser
secUser
=
companyUser
.
getUser
();
BusinessObjectParser
.
assertFieldCondition
(!
Utils
.
isCompanyUserEmailFound
(
process
.
getTransaction
(),
secUser
.
getEmail
()),
secUser
,
SecUser
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(!
Utils
.
emailExists
(
process
.
getTransaction
(),
secUser
.
getEmail
()),
secUser
,
SecUser
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
}
else
{
BusinessObjectParser
.
assertFieldCondition
(!
job
.
isEmailFound
(
),
job
,
Job
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(!
Utils
.
emailExists
(
process
.
getTransaction
(),
job
.
getEmail
()
),
job
,
Job
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
}
super
.
validate
(
process
,
submission
,
exceptions
,
params
);
...
...
cmsWebApp/src/performa/form/SignInCandidateFP.java
View file @
794aa598
...
...
@@ -57,6 +57,7 @@ public class SignInCandidateFP extends LoginProcessor
BusinessObjectParser
.
assertFieldCondition
(
job
.
getEmail
()!=
null
,
job
,
Job
.
FIELD_Email
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
job
.
getPassword
()!=
null
,
job
,
Job
.
FIELD_Password
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(!
Utils
.
emailExists
(
job
.
getTransaction
(),
job
.
getEmail
()),
job
,
Job
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
return
super
.
validate
(
submission
,
exceptions
);
}
...
...
cmsWebApp/src/performa/form/VerifyCompanyUserFP.java
deleted
100644 → 0
View file @
615d5f78
package
performa
.
form
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
oneit.appservices.config.ConfigMgr
;
import
oneit.components.ParticipantInitialisationContext
;
import
oneit.email.ConfigurableArticleTemplateEmailer
;
import
oneit.email.ConfigurableEmailerException
;
import
oneit.logging.*
;
import
oneit.objstore.StorageException
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.validator.AttributeValidator
;
import
oneit.security.SecUser
;
import
oneit.servlets.forms.*
;
import
oneit.servlets.process.*
;
import
oneit.servlets.security.SessionSecUserDecorator
;
import
oneit.utils.*
;
import
oneit.utils.parsers.FieldException
;
import
performa.intercom.utils.IntercomUtils
;
import
performa.orm.*
;
import
performa.utils.Utils
;
import
performa.utils.WebUtils
;
public
class
VerifyCompanyUserFP
extends
ORMProcessFormProcessor
{
private
static
final
LoggingArea
LOG
=
LoggingArea
.
createLoggingArea
(
"VerifyCompanyUser"
);
protected
ConfigurableArticleTemplateEmailer
emailer
;
@Override
public
void
validate
(
ORMProcessState
process
,
SubmissionDetails
submission
,
MultiException
exceptions
,
Map
params
)
throws
StorageException
{
HttpServletRequest
request
=
submission
.
getRequest
();
CompanyUser
companyUser
=
(
CompanyUser
)
process
.
getAttribute
(
"CompanyUser"
);
Boolean
socialLogin
=
(
Boolean
)
request
.
getAttribute
(
"socialLogin"
);
SecUser
secUser
=
companyUser
.
getUser
();
Company
company
=
companyUser
.
getCompany
();
if
(
socialLogin
)
{
BusinessObjectParser
.
assertFieldCondition
(
secUser
.
getEmail
()!=
null
,
secUser
,
SecUser
.
FIELD_Email
,
"invalid"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(!
Utils
.
isCompanyUserEmailFound
(
secUser
.
getTransaction
(),
secUser
.
getEmail
()),
secUser
,
SecUser
.
FIELD_Email
,
"emailExists"
,
exceptions
,
true
,
request
);
}
else
{
BusinessObjectParser
.
assertFieldCondition
(
StringUtils
.
isEmailAddress
(
secUser
.
getUserName
()),
secUser
,
SecUser
.
FIELD_Email
,
"invalid"
,
exceptions
,
true
,
request
);
}
BusinessObjectParser
.
assertFieldCondition
(
secUser
.
getFirstName
()!=
null
,
secUser
,
SecUser
.
FIELD_FirstName
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
secUser
.
getLastName
()!=
null
,
secUser
,
SecUser
.
FIELD_LastName
,
"mandatory"
,
exceptions
,
true
,
request
);
if
(!
company
.
isTrue
(
company
.
getIsVerified
()))
{
BusinessObjectParser
.
assertFieldCondition
(
company
.
getCompanyName
()!=
null
,
company
,
Company
.
FIELD_CompanyName
,
"mandatory"
,
exceptions
,
true
,
request
);
}
if
(!
socialLogin
)
{
BusinessObjectParser
.
assertFieldCondition
(
companyUser
.
getPassword
()!=
null
,
companyUser
,
CompanyUser
.
FIELD_Password
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
companyUser
.
getConfirmPassword
()!=
null
,
companyUser
,
CompanyUser
.
FIELD_ConfirmPassword
,
"mandatory"
,
exceptions
,
true
,
request
);
BusinessObjectParser
.
assertFieldCondition
(
CollectionUtils
.
equals
(
companyUser
.
getPassword
(),
companyUser
.
getConfirmPassword
()),
companyUser
,
CompanyUser
.
FIELD_ConfirmPassword
,
"passwordNotMatch"
,
exceptions
,
true
,
request
);
//to validate password
AttributeValidator
passwordValidator
=
(
AttributeValidator
)(
ConfigMgr
.
getConfigObject
(
"CONFIG.ORMVALIDATOR"
,
"PasswordValidator"
,
null
));
try
{
//execute if not null
if
(
passwordValidator
!=
null
)
{
passwordValidator
.
validate
(
null
,
secUser
,
"Password"
,
companyUser
.
getPassword
());
}
}
catch
(
FieldException
e
)
{
exceptions
.
addException
(
new
FieldException
(
e
,
CompanyUser
.
FIELD_Password
));
}
catch
(
Exception
e
)
{
throw
NestedException
.
wrap
(
e
);
}
}
super
.
validate
(
process
,
submission
,
exceptions
,
params
);
}
@Override
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
params
)
throws
BusinessException
,
StorageException
{
HttpServletRequest
request
=
submission
.
getRequest
();
CompanyUser
companyUser
=
(
CompanyUser
)
process
.
getAttribute
(
"CompanyUser"
);
SecUser
secUser
=
companyUser
.
getUser
();
Company
company
=
companyUser
.
getCompany
();
String
nextPage
=
(
String
)
request
.
getAttribute
(
"nextPage"
);
Boolean
socialLogin
=
(
Boolean
)
request
.
getAttribute
(
"socialLogin"
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Verifing User"
,
companyUser
,
secUser
);
if
(
CollectionUtils
.
equals
(
companyUser
.
getPassword
(),
companyUser
.
getConfirmPassword
()))
{
if
(!
company
.
isTrue
(
company
.
getIsVerified
())
&&
CollectionUtils
.
equals
(
company
.
getAddedByUser
(),
companyUser
))
{
process
.
setAttribute
(
"Company"
,
company
);
process
.
setAttribute
(
"socialLogin"
,
socialLogin
);
return
new
ProcessRedirectResult
(
nextPage
,
new
String
[
0
]);
}
else
{
nextPage
=
WebUtils
.
getArticleByShortCut
(
process
.
getTransaction
(),
WebUtils
.
ADMIN_HOME
).
getLink
(
request
);
// Create company user in intercom
performa
.
intercom
.
resources
.
Company
intercomCompany
=
IntercomUtils
.
findCompanyByID
(
company
);
IntercomUtils
.
createIntercomUser
(
secUser
,
"Hiring Team"
,
intercomCompany
);
}
if
(!
socialLogin
)
{
secUser
.
setAttribute
(
"md5:"
+
SecUser
.
FIELD_Password
,
companyUser
.
getPassword
());
}
companyUser
.
setIsAccountVerified
(
Boolean
.
TRUE
);
sendMail
(
companyUser
,
request
);
request
.
getSession
().
setAttribute
(
SecUser
.
SEC_USER_ID
,
secUser
);
request
.
getSession
().
setAttribute
(
SessionSecUserDecorator
.
REFRESH_SECURITY
,
Boolean
.
TRUE
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Password resetted"
,
companyUser
,
secUser
);
}
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Verifing User finished"
,
companyUser
,
secUser
);
process
.
completeAndRestart
();
return
new
ProcessRedirectResult
(
nextPage
,
new
String
[
0
]);
}
@Override
public
void
init
(
ParticipantInitialisationContext
context
)
throws
InitialisationException
{
super
.
init
(
context
);
emailer
=
(
ConfigurableArticleTemplateEmailer
)
(
context
.
getSingleChild
(
"AccountCreatedEmailer"
));
}
protected
void
sendMail
(
CompanyUser
companyUser
,
HttpServletRequest
request
)
throws
BusinessException
{
try
{
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Sending Account Created mail from VerifyCompanyUserFP to :: "
,
companyUser
);
Map
defaultParams
=
CollectionUtils
.
EMPTY_MAP
;
ObjectTransform
transform
=
Utils
.
createCompoundTransform
(
defaultParams
,
companyUser
);
Utils
.
sendMail
(
emailer
,
transform
,
new
String
[]{
companyUser
.
getEmailAddressFromUser
()},
null
,
companyUser
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Sent Account Created mail successfully from "
+
VerifyCompanyUserFP
.
class
+
" to :: "
,
companyUser
);
}
catch
(
ConfigurableEmailerException
ex
)
{
LogMgr
.
log
(
LOG
,
LogLevel
.
SYSTEMERROR1
,
ex
,
"Error occured while sending mail for CompanyUser :: "
+
companyUser
);
throw
new
BusinessException
(
"We are unable to send mail. Please try again or contact Talentology for more details."
);
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/BaseCompany.java
View file @
794aa598
...
...
@@ -60,6 +60,7 @@ public abstract class BaseCompany extends BaseBusinessClass
public
static
final
String
FIELD_LastName
=
"LastName"
;
public
static
final
String
FIELD_RoleType
=
"RoleType"
;
public
static
final
String
FIELD_IsLogoDeleted
=
"IsLogoDeleted"
;
public
static
final
String
FIELD_CompletedInvites
=
"CompletedInvites"
;
public
static
final
String
SINGLEREFERENCE_AddedByUser
=
"AddedByUser"
;
public
static
final
String
MULTIPLEREFERENCE_Users
=
"Users"
;
public
static
final
String
BACKREF_Users
=
""
;
...
...
@@ -87,6 +88,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_LastName
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
EnumeratedAttributeHelper
<
Company
,
RoleType
>
HELPER_RoleType
=
new
EnumeratedAttributeHelper
<
Company
,
RoleType
>
(
RoleType
.
FACTORY_RoleType
);
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_IsLogoDeleted
=
DefaultAttributeHelper
.
INSTANCE
;
private
static
final
DefaultAttributeHelper
<
Company
>
HELPER_CompletedInvites
=
DefaultAttributeHelper
.
INSTANCE
;
// Private attributes corresponding to business object data
...
...
@@ -106,6 +108,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private
String
_LastName
;
private
RoleType
_RoleType
;
private
Boolean
_IsLogoDeleted
;
private
Boolean
_CompletedInvites
;
// Private attributes corresponding to single references
...
...
@@ -126,6 +129,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private
static
final
AttributeValidator
[]
FIELD_LastName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_RoleType_Validators
;
private
static
final
AttributeValidator
[]
FIELD_IsLogoDeleted_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompletedInvites_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyName_Validators
;
private
static
final
AttributeValidator
[]
FIELD_CompanyLogo_Validators
;
private
static
final
AttributeValidator
[]
FIELD_HiringTeamType_Validators
;
...
...
@@ -160,6 +164,7 @@ public abstract class BaseCompany extends BaseBusinessClass
FIELD_LastName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_LastName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_RoleType_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_RoleType
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_IsLogoDeleted_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_IsLogoDeleted
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompletedInvites_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompletedInvites
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyName_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyName
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_CompanyLogo_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_CompanyLogo
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
FIELD_HiringTeamType_Validators
=
(
AttributeValidator
[])
setupAttribMetaData_HiringTeamType
(
validatorMapping
).
toArray
(
new
AttributeValidator
[
0
]);
...
...
@@ -318,6 +323,24 @@ public abstract class BaseCompany extends BaseBusinessClass
}
// Meta Info setup
private
static
List
setupAttribMetaData_CompletedInvites
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
metaInfo
.
put
(
"defaultValue"
,
"Boolean.FALSE"
);
metaInfo
.
put
(
"name"
,
"CompletedInvites"
);
metaInfo
.
put
(
"type"
,
"Boolean"
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG2
,
"Metadata for Company.CompletedInvites:"
,
metaInfo
);
ATTRIBUTES_METADATA_Company
.
put
(
FIELD_CompletedInvites
,
Collections
.
unmodifiableMap
(
metaInfo
));
List
validators
=
BaseBusinessClass
.
getAttribValidators
(
Company
.
class
,
"CompletedInvites"
,
metaInfo
,
validatorMapping
);
LogMgr
.
log
(
BUSINESS_OBJECTS
,
LogLevel
.
DEBUG1
,
"Validators for Company.CompletedInvites:"
,
validators
);
return
validators
;
}
// Meta Info setup
private
static
List
setupAttribMetaData_CompanyName
(
Map
validatorMapping
)
{
Map
metaInfo
=
new
HashMap
();
...
...
@@ -583,6 +606,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_LastName
=
(
String
)(
HELPER_LastName
.
initialise
(
_LastName
));
_RoleType
=
(
RoleType
)(
RoleType
.
STANDARD
);
_IsLogoDeleted
=
(
Boolean
)(
Boolean
.
FALSE
);
_CompletedInvites
=
(
Boolean
)(
Boolean
.
FALSE
);
}
...
...
@@ -2182,6 +2206,104 @@ public abstract class BaseCompany extends BaseBusinessClass
}
}
/**
* Get the attribute CompletedInvites
*/
public
Boolean
getCompletedInvites
()
{
assertValid
();
Boolean
valToReturn
=
_CompletedInvites
;
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
valToReturn
=
bhd
.
getCompletedInvites
((
Company
)
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
preCompletedInvitesChange
(
Boolean
newCompletedInvites
)
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
postCompletedInvitesChange
()
throws
FieldException
{
}
public
FieldWriteability
getWriteability_CompletedInvites
()
{
return
getFieldWritabilityUtil
(
FieldWriteability
.
TRUE
);
}
/**
* Set the attribute CompletedInvites. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public
void
setCompletedInvites
(
Boolean
newCompletedInvites
)
throws
FieldException
{
boolean
oldAndNewIdentical
=
HELPER_CompletedInvites
.
compare
(
_CompletedInvites
,
newCompletedInvites
);
try
{
for
(
CompanyBehaviourDecorator
bhd
:
Company_BehaviourDecorators
)
{
newCompletedInvites
=
bhd
.
setCompletedInvites
((
Company
)
this
,
newCompletedInvites
);
oldAndNewIdentical
=
HELPER_CompletedInvites
.
compare
(
_CompletedInvites
,
newCompletedInvites
);
}
if
(
FIELD_CompletedInvites_Validators
.
length
>
0
)
{
Object
newCompletedInvitesObj
=
HELPER_CompletedInvites
.
toObject
(
newCompletedInvites
);
if
(
newCompletedInvitesObj
!=
null
)
{
int
loopMax
=
FIELD_CompletedInvites_Validators
.
length
;
Map
metadata
=
(
Map
)
ATTRIBUTES_METADATA_Company
.
get
(
FIELD_CompletedInvites
);
for
(
int
v
=
0
;
v
<
loopMax
;
++
v
)
{
FIELD_CompletedInvites_Validators
[
v
].
checkAttribute
(
this
,
FIELD_CompletedInvites
,
metadata
,
newCompletedInvitesObj
);
}
}
}
}
catch
(
FieldException
e
)
{
if
(!
oldAndNewIdentical
)
{
e
.
setWouldModify
();
}
throw
e
;
}
if
(!
oldAndNewIdentical
)
{
assertValid
();
Debug
.
assertion
(
getWriteability_CompletedInvites
()
!=
FieldWriteability
.
FALSE
,
"Field CompletedInvites is not writeable"
);
preCompletedInvitesChange
(
newCompletedInvites
);
markFieldChange
(
FIELD_CompletedInvites
);
_CompletedInvites
=
newCompletedInvites
;
postFieldChange
(
FIELD_CompletedInvites
);
postCompletedInvitesChange
();
}
}
/**
...
...
@@ -2982,6 +3104,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_LastName
=
sourceCompany
.
_LastName
;
_RoleType
=
sourceCompany
.
_RoleType
;
_IsLogoDeleted
=
sourceCompany
.
_IsLogoDeleted
;
_CompletedInvites
=
sourceCompany
.
_CompletedInvites
;
}
}
...
...
@@ -3055,6 +3178,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_LastName
=
(
String
)(
HELPER_LastName
.
readExternal
(
_LastName
,
vals
.
get
(
FIELD_LastName
)));
//
_RoleType
=
(
RoleType
)(
HELPER_RoleType
.
readExternal
(
_RoleType
,
vals
.
get
(
FIELD_RoleType
)));
//
_IsLogoDeleted
=
(
Boolean
)(
HELPER_IsLogoDeleted
.
readExternal
(
_IsLogoDeleted
,
vals
.
get
(
FIELD_IsLogoDeleted
)));
//
_CompletedInvites
=
(
Boolean
)(
HELPER_CompletedInvites
.
readExternal
(
_CompletedInvites
,
vals
.
get
(
FIELD_CompletedInvites
)));
//
_AddedByUser
.
readExternalData
(
vals
.
get
(
SINGLEREFERENCE_AddedByUser
));
_Users
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Users
));
_Clients
.
readExternalData
(
vals
.
get
(
MULTIPLEREFERENCE_Clients
));
...
...
@@ -3085,6 +3209,7 @@ public abstract class BaseCompany extends BaseBusinessClass
vals
.
put
(
FIELD_LastName
,
HELPER_LastName
.
writeExternal
(
_LastName
));
vals
.
put
(
FIELD_RoleType
,
HELPER_RoleType
.
writeExternal
(
_RoleType
));
vals
.
put
(
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
writeExternal
(
_IsLogoDeleted
));
vals
.
put
(
FIELD_CompletedInvites
,
HELPER_CompletedInvites
.
writeExternal
(
_CompletedInvites
));
vals
.
put
(
SINGLEREFERENCE_AddedByUser
,
_AddedByUser
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Users
,
_Users
.
writeExternalData
());
vals
.
put
(
MULTIPLEREFERENCE_Clients
,
_Clients
.
writeExternalData
());
...
...
@@ -3167,6 +3292,7 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor
.
visitField
(
this
,
FIELD_LastName
,
HELPER_LastName
.
toObject
(
getLastName
()));
visitor
.
visitField
(
this
,
FIELD_RoleType
,
HELPER_RoleType
.
toObject
(
getRoleType
()));
visitor
.
visitField
(
this
,
FIELD_IsLogoDeleted
,
HELPER_IsLogoDeleted
.
toObject
(
getIsLogoDeleted
()));
visitor
.
visitField
(
this
,
FIELD_CompletedInvites
,
HELPER_CompletedInvites
.
toObject
(
getCompletedInvites
()));
}
...
...
@@ -3484,6 +3610,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return
HELPER_IsLogoDeleted
.
toObject
(
getIsLogoDeleted
());
}
else
if
(
attribName
.
equals
(
FIELD_CompletedInvites
))
{
return
HELPER_CompletedInvites
.
toObject
(
getCompletedInvites
());
}
else
{
return
super
.
getAttribute
(
attribName
);
...
...
@@ -3561,6 +3691,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return
HELPER_IsLogoDeleted
;
}
else
if
(
attribName
.
equals
(
FIELD_CompletedInvites
))
{
return
HELPER_CompletedInvites
;
}
else
{
return
super
.
getAttributeHelper
(
attribName
);
...
...
@@ -3638,6 +3772,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
setIsLogoDeleted
((
Boolean
)(
HELPER_IsLogoDeleted
.
fromObject
(
_IsLogoDeleted
,
attribValue
)));
}
else
if
(
attribName
.
equals
(
FIELD_CompletedInvites
))
{
setCompletedInvites
((
Boolean
)(
HELPER_CompletedInvites
.
fromObject
(
_CompletedInvites
,
attribValue
)));
}
else
{
super
.
setAttribute
(
attribName
,
attribValue
);
...
...
@@ -3734,6 +3872,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return
getWriteability_IsLogoDeleted
();
}
else
if
(
fieldName
.
equals
(
FIELD_CompletedInvites
))
{
return
getWriteability_CompletedInvites
();
}
else
{
return
super
.
getWriteable
(
fieldName
);
...
...
@@ -3824,6 +3966,11 @@ public abstract class BaseCompany extends BaseBusinessClass
fields
.
add
(
FIELD_IsLogoDeleted
);
}
if
(
getWriteability_CompletedInvites
()
!=
FieldWriteability
.
TRUE
)
{
fields
.
add
(
FIELD_CompletedInvites
);
}
super
.
putUnwriteable
(
fields
);
}
...
...
@@ -3849,6 +3996,7 @@ public abstract class BaseCompany extends BaseBusinessClass
result
.
add
(
HELPER_LastName
.
getAttribObject
(
getClass
(),
_LastName
,
false
,
FIELD_LastName
));
result
.
add
(
HELPER_RoleType
.
getAttribObject
(
getClass
(),
_RoleType
,
false
,
FIELD_RoleType
));
result
.
add
(
HELPER_IsLogoDeleted
.
getAttribObject
(
getClass
(),
_IsLogoDeleted
,
false
,
FIELD_IsLogoDeleted
));
result
.
add
(
HELPER_CompletedInvites
.
getAttribObject
(
getClass
(),
_CompletedInvites
,
false
,
FIELD_CompletedInvites
));
return
result
;
}
...
...
@@ -4205,6 +4353,24 @@ public abstract class BaseCompany extends BaseBusinessClass
return
newIsLogoDeleted
;
}
/**
* Get the attribute CompletedInvites
*/
public
Boolean
getCompletedInvites
(
Company
obj
,
Boolean
original
)
{
return
original
;
}
/**
* Change the value set for attribute CompletedInvites.
* May modify the field beforehand
* Occurs before validation.
*/
public
Boolean
setCompletedInvites
(
Company
obj
,
Boolean
newCompletedInvites
)
throws
FieldException
{
return
newCompletedInvites
;
}
}
...
...
@@ -4285,6 +4451,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return
toIsLogoDeleted
();
}
if
(
name
.
equals
(
"CompletedInvites"
))
{
return
toCompletedInvites
();
}
if
(
name
.
equals
(
"CompanyName"
))
{
return
toCompanyName
();
...
...
@@ -4349,6 +4519,8 @@ public abstract class BaseCompany extends BaseBusinessClass
public
PipeLine
<
From
,
Boolean
>
toIsLogoDeleted
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Boolean
>(
FIELD_IsLogoDeleted
));
}
public
PipeLine
<
From
,
Boolean
>
toCompletedInvites
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
Boolean
>(
FIELD_CompletedInvites
));
}
public
PipeLine
<
From
,
String
>
toCompanyName
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
String
>(
FIELD_CompanyName
));
}
public
PipeLine
<
From
,
BinaryContent
>
toCompanyLogo
()
{
return
pipe
(
new
ORMAttributePipe
<
Me
,
BinaryContent
>(
FIELD_CompanyLogo
));
}
...
...
@@ -4419,6 +4591,11 @@ public abstract class BaseCompany extends BaseBusinessClass
return
true
;
}
if
(
CollectionUtils
.
equals
(
attribName
,
"CompletedInvites"
))
{
return
true
;
}
return
super
.
isTransientAttrib
(
attribName
);
}
...
...
cmsWebApp/src/performa/orm/Company.java
View file @
794aa598
package
performa
.
orm
;
import
oneit.logging.LoggingArea
;
import
oneit.objstore.ObjectStatus
;
import
oneit.objstore.ValidationContext
;
import
oneit.security.SecUser
;
import
oneit.utils.CollectionUtils
;
import
oneit.utils.parsers.FieldException
;
...
...
@@ -45,4 +47,16 @@ public class Company extends BaseCompany
}
return
addUser
;
}
@Override
public
void
validate
(
ValidationContext
context
)
{
if
(
getStatus
()
!=
ObjectStatus
.
NEW
)
{
context
.
check
(
getHiringTeamType
()
!=
null
,
this
,
FIELD_HiringTeamType
,
"mandatory"
);
}
super
.
validate
(
context
);
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/Company.xml
View file @
794aa598
...
...
@@ -16,6 +16,7 @@
<TRANSIENT
name=
"LastName"
type=
"String"
/>
<TRANSIENT
name=
"RoleType"
type=
"RoleType"
defaultValue=
"RoleType.STANDARD"
attribHelper=
"EnumeratedAttributeHelper"
/>
<TRANSIENT
name=
"IsLogoDeleted"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TRANSIENT
name=
"CompletedInvites"
type=
"Boolean"
defaultValue=
"Boolean.FALSE"
/>
<TABLE
name=
"tl_company"
tablePrefix=
"object"
>
...
...
cmsWebApp/src/performa/utils/Utils.java
View file @
794aa598
...
...
@@ -328,6 +328,17 @@ public class Utils
}
public
static
Boolean
emailExists
(
ObjectTransaction
objTran
,
String
email
)
{
if
(
email
!=
null
)
{
return
SecUser
.
searchNAME
(
objTran
,
email
.
toLowerCase
())
!=
null
;
}
return
Boolean
.
FALSE
;
}
public
static
Boolean
isCompanyUserEmailFound
(
ObjectTransaction
objTran
,
String
email
)
{
if
(
email
!=
null
)
...
...
cmsWebApp/src/performa/utils/WebUtils.java
View file @
794aa598
...
...
@@ -45,6 +45,8 @@ public class WebUtils
public
static
final
String
COMPANY_ACCOUNT_VERIFICATION
=
"CompanyAccountVerification"
;
public
static
final
String
MY_DETAILS
=
"MyDetails"
;
public
static
final
String
RESET_PASSWORD
=
"ResetPassword"
;
public
static
final
String
COMPANY_PROFILE
=
"CompanyProfile"
;
public
static
final
String
INVITE_USERS
=
"InviteUsers"
;
public
static
String
getArticleLink
(
HttpServletRequest
request
,
ObjectTransaction
objTran
,
String
articleShortcut
,
String
renderMode
)
...
...
cmsWebApp/webroot/extensions/adminportal/CustomServlets_adminPortal.xml
View file @
794aa598
...
...
@@ -32,9 +32,6 @@
<FORM
name=
"*.changeApplicationStatus"
factory=
"Participant"
class=
"performa.form.ChangeApplicationStatusFP"
/>
<FORM
name=
"*.bulkupdate"
factory=
"Participant"
class=
"performa.form.BulkUpdateFP"
/>
<FORM
name=
"*.navigateBetweenStatus"
factory=
"Participant"
class=
"performa.form.NavigateBetweenStatusFP"
/>
<FORM
name=
"*.verifyCompanyUser"
factory=
"Participant"
class=
"performa.form.VerifyCompanyUserFP"
>
<AccountCreatedEmailer
factory=
"Participant"
class=
"oneit.email.ConfigurableArticleTemplateEmailer"
templateShortcut=
"AccountCreatedMail"
/>
</FORM>
<FORM
name=
"*.sendCompanyUserInvites"
factory=
"Participant"
class=
"performa.form.SendCompanyUserInvitesFP"
>
<AccountCreatedEmailer
factory=
"Participant"
class=
"oneit.email.ConfigurableArticleTemplateEmailer"
templateShortcut=
"AccountCreatedMail"
/>
<InvitationEmailer
factory=
"Participant"
class=
"oneit.email.ConfigurableArticleTemplateEmailer"
templateShortcut=
"InvitationMail"
/>
...
...
cmsWebApp/webroot/extensions/adminportal/company_profile.jsp
View file @
794aa598
...
...
@@ -20,20 +20,20 @@
process.setAttribute("Company", company);
process.setAttribute("socialLogin", socialLogin);
company.setCompletedProfile(Boolean.TRUE);
%>
<div class="hello-company-name">Hello, <%= secUser.getFirstName() %></div>
<div class="section-tab-view">
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="active"><a href="#"><span>1</span><div>Company Profile</div></a></li>
<li><a href="#"><span>2</span><div>Invite Users</div></a></li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li>
</ul>
</div>
<oneit:form name="companyProfile" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<oneit:dynInclude page="/extensions/adminportal/inc/company_profile_tabs.jsp" TabNumber="1" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="section-page-area" style="text-align: left">
<div class="main-sc-section">
<div class="form-group">
...
...
cmsWebApp/webroot/extensions/adminportal/inc/company_profile_tabs.jsp
0 → 100644
View file @
794aa598
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%
Company company = (Company) process.getAttribute("Company");
String tabNumber = (String) getData(request, "TabNumber");
String firstTab = WebUtils.getSamePageInRenderMode(request, WebUtils.COMPANY_PROFILE);
String secondTab = WebUtils.getSamePageInRenderMode(request, WebUtils.INVITE_USERS);
%>
<oneit:dynIncluded>
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="<%= tabNumber == "1" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Company", company).toMap())
.toMap() %>">
<span><%= CollectionUtils.equals(company.getCompletedProfile(), Boolean.TRUE) ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
<div>Company Profile</div>
</oneit:button>
</li>
<li class="<%= tabNumber == "2" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Company", company).toMap())
.toMap() %>">
<span>2</span>
<div>Invite Users</div>
</oneit:button>
</li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li>
</ul>
</div>
</oneit:dynIncluded>
cmsWebApp/webroot/extensions/adminportal/invite_users.jsp
View file @
794aa598
...
...
@@ -41,18 +41,12 @@
</script>
<div class="hire-the-right-candi" style="">You're nearly there...</div>
<oneit:form name="companyProfile" method="post" enctype="multipart/form-data">
<div class="section-tab-view">
<oneit:form name="companyProfile" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="section-tab-view">
<div class="main-tab-form">
<ul class="nav nav-pills nav-justified">
<li class="complate"><a href="#"><span><img src="images/right-mark.svg"/></span><div>Company Profile</div></a></li>
<li class="active"><a href="#"><span>2</span><div>Invite Users</div></a></li>
<li><a href="#"><span>3</span><div>Create a Job</div></a></li>
</ul>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/company_profile_tabs.jsp" TabNumber="2" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="section-page-area" style="text-align: left">
<div class="main-sc-section">
...
...
@@ -88,8 +82,8 @@
.toMap() %>"/>
</div>
</div>
</
div
>
</
oneit:form
>
</
oneit:form
>
</
div
>
</oneit:dynIncluded>
<%@ include file="inc/htmlfooter_nopriv.jsp" %>
\ No newline at end of file
cmsWebApp/webroot/extensions/adminportal/messages/fieldnamesOverride.txt
View file @
794aa598
...
...
@@ -33,3 +33,4 @@ Company.FirstName = First Name
Company.LastName = Last Name
Company.RoleType = Role
Company.CompanyLogo = Company Logo
Company.HiringTeamType = Hiring Team
cmsWebApp/webroot/extensions/adminportal/verify_company.jsp
View file @
794aa598
...
...
@@ -14,12 +14,12 @@
//to process company user verification
String id = request.getParameter("id");
String
key
= request.getParameter("key");
String
verifyKey
= request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null &&
key
!=null)
if(id!=null &&
verifyKey
!=null)
{
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id),
k
ey);
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id),
verifyK
ey);
if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE)
{
...
...
@@ -96,21 +96,23 @@
<%
if(!socialLogin)
{
String key = Utils.getPwdKeyOfSecUser(request, secUser, true);
%>
<div class="form-group text-left">
<label>Password</label>
<oneit:
ormInput obj="<%= companyUser %>" type="password" attributeName="Password" cssClass="form-control second-style reset-pw" required="true
"/>
<oneit:
input type="password" name="<%= key %>" class="form-control second-style reset-pw
"/>
</div>
<div class="form-group text-left">
<label>Confirm password</label>
<oneit:
ormInput obj="<%= companyUser %>" type="password" attributeName="ConfirmPassword" cssClass="form-control second-style reset-pw " required="true
"/>
<oneit:
input type="password" name="<%= key + 2 %>" class="form-control second-style reset-pw
"/>
</div>
<%
}
%>
<oneit:button value="Verify and login" name="
verifyCompanyUser
" cssClass="box-btn verify-btn"
<oneit:button value="Verify and login" name="
gotoPage
" cssClass="box-btn verify-btn"
requestAttribs="<%= CollectionUtils.mapEntry("socialLogin", socialLogin)
.mapEntry("procParams", CollectionUtils.mapEntry("Company", companyUser.getCompany()).toMap())
.mapEntry("nextPage", nextPage).toMap() %>"/>
</div>
</oneit:form>
...
...
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