<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Gustav,</p>
<p>That is very compact and elegant solution. Unfortunately when I tried to implement that by adding first parameter overrideAdministrativeStatus to userExtension.xsd file I ran into the schema extension error:</p>
<p><br>
</p>
<p>2017-01-16 11:09:06,737 [] [localhost-startStop-1] ERROR (com.evolveum.midpoint.prism.schema.SchemaHandler): Error occured during schema parsing: [Error] on line 120 at file:///home/mpdev/SystemId, null undefined simple or complex type 'c:ActivationStatusType'<br>
2017-01-16 11:09:06,738 [] [localhost-startStop-1] WARN (org.springframework.web.context.support.XmlWebApplicationContext): Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'repositoryFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.evolveum.midpoint.prism.PrismContext com.evolveum.midpoint.init.RepositoryFactory.prismContext;
 nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prismContext' defined in class path resource [ctx-configuration.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
 Failed to instantiate [com.evolveum.midpoint.prism.PrismContext]: Factory method 'createInitializedPrismContext' threw exception; nested exception is com.evolveum.midpoint.util.exception.SchemaException: XML error during XSD schema parsing: undefined simple
 or complex type 'c:ActivationStatusType'(embedded exception null) in file /home/mpdev/midpoint-data/schema/userExtension.xsd<br>
2017-01-16 11:09:06,760 [] [localhost-startStop-1] ERROR (org.springframework.web.context.ContextLoader): Context initialization failed<br>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private
 com.evolveum.midpoint.prism.PrismContext com.evolveum.midpoint.init.RepositoryFactory.prismContext; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prismContext' defined in class path resource [ctx-configuration.xml]:
 Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.evolveum.midpoint.prism.PrismContext]: Factory method 'createInitializedPrismContext' threw exception; nested
 exception is com.evolveum.midpoint.util.exception.SchemaException: XML error during XSD schema parsing: undefined simple or complex type 'c:ActivationStatusType'(embedded exception null) in file /home/mpdev/midpoint-data/schema/userExtension.xsd<br>
<br>
</p>
<p>I think the parameter type="c:ActivationStatusType" is causing this error. I tried to change it to type="xsd:ActivationStatusType" but this did not help either. Do you have any ideas how to fix that?</p>
<p><br>
</p>
<p>Best regards,</p>
<p>Aivo<br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>Saatja:</b> midPoint <midpoint-bounces@lists.evolveum.com> nimelPálos Gustáv <gustav.palos@evolveum.com><br>
<b>Saadetud:</b> 16. jaanuar 2017 9:41<br>
<b>Adressaat:</b> midPoint General Discussion<br>
<b>Teema:</b> Re: [midPoint] User activation by HR data with manual override possibility</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi Aivo,
<div><br>
</div>
<div>I created in one project extension/<wbr>overrideAdministrativeStatus user schema extension and when it is enabled or disabled, I use this value over object template user, elsewhere keep as is from activation/<wbr>administrativeStatus.</div>
<div><br>
</div>
<div>
<div>            <xsd:element name="<wbr>overrideAdministrativeStatus" type="c:ActivationStatusType" minOccurs="0"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:indexed>true</a:indexed></div>
<div>                        <a:displayName>Override Administrative status</a:displayName></div>
<div>                        <a:displayOrder>900</a:<wbr>displayOrder></div>
<div>                    </xsd:appinfo></div>
<div>                    <xsd:documentation></div>
<div>                        If this is filled, override administrative status from HR calculated from status.</div>
<div>                        If you use this, please write to description a reason, why you do this (for example: She works on maternity leave). </div>
<div>                    </xsd:documentation></div>
<div>                </xsd:annotation></div>
<div>            </xsd:element></div>
</div>
<div><br>
</div>
<div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><mapping></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><name>Override administrative status if needed</name></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><strength>strong</strength></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><source></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><path>$user/activation/<wbr>administrativeStatus</path></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></source></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><source></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><path>$user/extension/<wbr>overrideAdministrativeStatus</<wbr>path></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></source></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><expression></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><script></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><code></div>
<div>                <span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap">
</span>if (overrideAdministrativeStatus!<wbr>=null) {</div>
<div>                <span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap">
</span>return overrideAdministrativeStatus;</div>
<div>                <span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap">
</span>}</div>
<div>                    return administrativeStatus;</div>
<div>                </code></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></script></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></expression></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><target> <!-- need both administrativeStatus & effectiveStatus also --></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><path>$user/activation/<wbr>administrativeStatus</path></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></target></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><condition></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><script></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><language><a href="http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>expression/language#Groovy</a></<wbr>language></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span><code><wbr>overrideAdministrativeStatus !=null</code></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></script></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></condition></div>
<div><span class="gmail-m_-4825903369038130340gmail-Apple-tab-span" style="white-space:pre-wrap"></span></mapping></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Gustav</div>
<div><br>
</div>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail-h5">2017-01-16 8:32 GMT+01:00 Aivo Kuhlberg <span dir="ltr"><<a href="mailto:aivo.kuhlberg@rmit.ee" target="_blank">aivo.kuhlberg@rmit.ee</a>></span>:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div class="gmail-h5">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:calibri,arial,helvetica,sans-serif">
<p>Hi,<br>
</p>
<p>I want to implement midPoint user activation mechanism based on HR resource user account field value with manual GUI override possibility. When the HR resource field "status" has value "WRS" (work relationship stopped) then the midPoint user should be disabled,
 otherwise user should be enabled. However, I need also possibility to manually override current midPoint user activation value.<br>
I tried implemented inbound activation for HR resource (like <a href="https://github.com/Evolveum/midpoint/blob/master/samples/demo/hr.xml" target="_blank">
https://github.com/Evolveum/mi<wbr>dpoint/blob/master/samples/dem<wbr>o/hr.xml</a>) and it works - When I set HR user status to value "WRS" then midPoint user's administrative status is changed to state Disabled. I can also manually enable disabled user if
 needed in administration GUI. But the problem here is that both HR resource and admin gui have the same access to user's administrativeStatus value - I can change the user status in GUI but whenever the HR user data is changed then it changes also administrativeStatus
 back to value depanding on status field. Any ideas, how should I implement disabling/enabling of user based on HR data with manual user activation override possibility?<br>
Thanks,<br>
Aivo Kuhlberg<br>
</p>
<br>
<hr>
<font size="2" color="Gray" face="Arial">Käesolev e-kiri vőib sisaldada asutusesiseseks kasutamiseks tunnistatud teavet.<br>
This e-mail may contain information which is classified for official use.</font> </div>
<br>
</div>
</div>
______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mail<wbr>man/listinfo/midpoint</a><br>
<br>
</blockquote>
</div>
<span class="gmail-HOEnZb"><font color="#888888"><br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail-m_-4825903369038130340gmail_signature">s pozdravom
<div><br>
</div>
<div>Gustáv Pálos</div>
</div>
</font></span></div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>Gustáv Pálos</div>
<div>Identity Engineer</div>
<a href="http://evolveum.com/" rel="noreferrer" target="_blank" style="color:rgb(17,85,204); font-size:12.8px">evolveum.com</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="2">Käesolev e-kiri vőib sisaldada asutusesiseseks kasutamiseks tunnistatud teavet.<br>
This e-mail may contain information which is classified for official use.</font>
</body>
</html>