<?xml version="1.0"?>
<OBJECTS name="AdminPortal">

    <NODE name="DecoratorFilter::performa">
        <DECORATOR  factory="Participant" class="performa.utils.ShortenedURLDecorator"/>
    </NODE>
    
    <NODE   name="dynamic_content_form_client"  factory="Participant">
        <INHERITS   factory="Named" nodename="dynamic_content_form"/>
        
        <DECORATOR id="auth" factory="MetaComponent" component="AdminPortalAuthDecorator"   priv="TL_AccessAdminPortal"/>
    </NODE>
    
    
    <NODE name="NavBarSkinConfig::ADMIN_PORTAL" factory="Participant"   class="oneit.servlets.forms.ErrorReportConfig">
        <format item="LI_A_Selected_Menu.level0.section.entry |
                      LI_A_Selected_Menu.level0.article.entry"><![CDATA[${BracklineSeparator:<span class="brack-line"></span>}<li class="${selected:active}${MenuItemDisable:disabled}"><a class="${position} ${attrib:Additional CSS Class}" href="${link}" ${isTarget:target="?"}><span class="${attrib:Menu Icon CSS}"></span>${divsOpen}${attrib:Menu Title|title}${divsClose}</a></li>]]></format>
    </NODE>
    
    <NODE name="AdminPortalAuthDecorator"   factory="Participant" class="oneit.servlets.utils.decorator.AuthenticatorDecorator">
        <AUTHENTICATOR factory="Participant" class="oneit.security.SecurityAuthenticator">
            <PRIVILEGE      factory="Parameter" param="priv"/>
            <FAILED_URL     factory="String"    value="extensions/adminportal/sign_in.jsp"/>
            <NO_USER_URL    factory="String"    value="extensions/adminportal/sign_in.jsp"/>
        </AUTHENTICATOR>
    </NODE>
    
    <NODE name="dynamic_content_form::ADMIN_PORTAL"     factory="Participant">
        <FORM   name="*.changeAssessmentCriteria"       factory="Participant"   class="performa.form.ChangeAssessmentCriteriaFP"/>
        <FORM   name="*.saveJob"                        factory="Participant"   class="performa.form.SaveJobFP"/>
        <FORM   name="*.saveRequirementTemplate"        factory="Participant"   class="performa.form.SaveRequirementsTemplateFP"/>
        <FORM   name="*.saveCultureTemplate"            factory="Participant"   class="performa.form.SaveCultureTemplateFP"/>
        <FORM   name="*.loadJobFromTemplate"            factory="Participant"   class="performa.form.LoadJobFromTemplateFP"/>
        <FORM   name="*.loadRequirementsFromTemplate"   factory="Participant"   class="performa.form.LoadRequirementsFromTemplateFP"/>
        <FORM   name="*.loadCultureFromTemplate"        factory="Participant"   class="performa.form.LoadCultureFromTemplateFP"/>
        <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="*.sendCompanyUserInvites"         factory="Participant"   class="performa.form.SendCompanyUserInvitesFP">
            <OwnerAccountCreatedEmailer  factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="OwnerAccountCreatedMail"/>
            <AccountCreatedEmailer  factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="AccountCreatedMail"/>
            <InvitationEmailer      factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="InvitationMail"/>
        </FORM>
        <FORM   name="*.sendUserInvites"    factory="Participant"   class="performa.form.SendUserInvitationFP">
            <InvitationEmailer      factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="InvitationMail"/>
        </FORM>
        <FORM   name="*.saveUserDetails"                factory="Participant"   class="performa.form.SaveUserDetailsFP">
            <AccountVerificationEmailer factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="EmailChangedMail"/>
        </FORM>
        <FORM   name="*.resendVerification"             factory="Participant"   class="performa.form.ResendVerificationFP">
            <AccountVerificationEmailer factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="EmailChangedMail"/>
        </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"/>
        <FORM   name="*.savePayment"                    factory="Participant"   class="performa.form.MakePaymentFP"/>
        <FORM   name="*.managePlans"                    factory="Participant"   class="performa.form.ManagePlansFP"/>
        <FORM   name="*.updateCard"                     factory="Participant"   class="performa.form.UpdateCardFP"/>
    </NODE>
    
    <NODE name="job_assessment_criteria_add_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="signin_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
        <FORM   name="*.login"                  factory="Participant"   class="performa.form.UserLoginFP">
            <NODE name="loginFailureMessage" factory="String" value="Invalid password, please re-check your login details  ... "/>
            <NODE name="onSuccessURL" factory="String" value="../../AdminPortal-Home.htm"/>
            <PARSER name="username" factory="Participant" class="oneit.utils.parsers.StringParser">
                <NODE name="nonExistErrorMessage" factory="String" value="Please enter a value for Email Address"/>
            </PARSER>
            <PARSER name="password" factory="Participant" class="oneit.utils.parsers.StringParser">
                <NODE name="nonExistErrorMessage" factory="String" value="Please enter a value for password"/>
            </PARSER>
        </FORM>
        <FORM   name="*.facebookOAuthLogin"             factory="Participant"   class="oneit.security.oauth.form.FacebookOAuthLoginFP"/>
        <FORM   name="*.googleOAuthLogin"               factory="Participant"   class="oneit.security.oauth.form.GoogleOAuthLoginFP"/>
        <FORM   name="*.linkedinOAuthLogin"             factory="Participant"   class="performa.form.LinkedInOAuthLoginFP"/>
    </NODE>
    
    <NODE name="forgot_password_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
        <FORM   name="*.forgotPassword" factory="Participant"   class="performa.form.ForgotPasswordFP">
                <ResetCodeEmailer   factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="ResetCodeEmail"/>
        </FORM>
    </NODE>
    
    <NODE name="reset_password_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
        <FORM   name="*.resetPassword" factory="Participant"   class="performa.form.ResetPasswordFP"/>
    </NODE>
    
    <NODE name="reset_password_sent_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="sign_up_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
<!--        
        TODO: uncomment when plans and billing screens are available for all users 
        <FORM   name="*.send"  factory="Participant"   class="performa.form.SendVerificationMailFP">
            <AccountVerificationEmailer factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="CompanyAccountVerificationMail"/>
        </FORM>
-->
    </NODE>
    
    <!--TODO: delete when plans and billing screens are available for all users--> 
    <NODE name="sign_up_eap_jsp" factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
        <FORM   name="*.send"  factory="Participant"   class="performa.form.SendVerificationMailFP">
            <AccountVerificationEmailer factory="Participant"   class="oneit.email.ConfigurableArticleTemplateEmailer"  templateShortcut="CompanyAccountVerificationMail"/>
        </FORM>
    </NODE>
    
    <NODE name="responsive_alert_jsp"    factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="verification_sent_jsp"    factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="invite_user_add_jsp"    factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="email_verified_jsp"     factory="Participant">
        <INHERITS factory="Named"   nodename="CoreORMAdminNoPriv"/>
    </NODE>
    
    <NODE name="ORMErrorConfig::ADMIN_PORTAL" factory="Participant" class="oneit.servlets.forms.ErrorReportConfig">
        <format item="field.*.error.pageHeader_performa_errorPrefix">
            <![CDATA[<div class="error-message message-common"><img src="${contextRoot}/images/error-alert.png" class="alert-icon" /><span class="message-txt" style="font-weight: bold">${translateLabel:Errors_Occurred:Errors occurred, please correct them and try again}</span><br/>]]>
        </format>
        <format item="field.*.error.pageHeader_performa_errorText"><![CDATA[<br/><span class="message-txt">?</span>]]></format>
        <format item="field.*.error.pageHeader_performa_errorSuffix"><![CDATA[</div>]]></format>
        <format item="form.*.pageHeader_notifyPrefix"><![CDATA[<div class="success-message message-common"><img src="images/success-alert.png" class="alert-icon" /><span class="message-txt">]]></format>
        <format item="form.*.pageHeader_notifySuffix"><![CDATA[</span></div>]]></format>
    </NODE>
    
    <NODE name="SetupUserHelper" factory="Participant" class="performa.utils.PerformaSetupUserHelper"/>


    <NODE name="DecoratorFilter::ADMIN_PORTAL">
        
        <DECORATOR  factory="Participant"   class="performa.utils.PerformaOAuthCallbackDecorator">
        
            <NODE   name="servicesFactory"  factory="ConfigMgr" system="CONFIG.GLOBAL"  paramname="TransactionServices" />

                <Handler    name="/facebookCallback"    factory="Participant"   class="oneit.security.oauth.utils.FacebookOAuthLoginHandler">
                    <NODE   name="helper"               factory="Named"         nodename="SetupUserHelper"/>
                    <NODE   name="serviceName"          factory="String"        value="FACEBOOK"/>
                </Handler>
                <Handler    name="/googleCallback"      factory="Participant"   class="oneit.security.oauth.utils.GoogleOAuthLoginHandler">
                    <NODE   name="helper"               factory="Named"         nodename="SetupUserHelper"/>
                    <NODE   name="serviceName"          factory="String"        value="GOOGLE"/>
                </Handler>
                <Handler    name="/linkedinCallback"    factory="Participant"   class="performa.form.LinkedInOAuthLoginHandler">
                    <NODE   name="helper"               factory="Named"         nodename="SetupUserHelper"/>
                    <NODE   name="serviceName"          factory="String"        value="LINKEDIN"/>
                </Handler>
       
        </DECORATOR>
    </NODE>
</OBJECTS>
