<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Anand,<br>
<br>
just declare q prefix as follows:<br>
<br>
xmlns:q=<a class="moz-txt-link-rfc2396E" href="http://prism.evolveum.com/xml/ns/public/query-3">"http://prism.evolveum.com/xml/ns/public/query-3"</a><br>
<br>
I recommend to put it to your root element (e.g.
<objectTemplate>) so that you can refer to it everywhere.<br>
<br>
Regards,<br>
Ivan<br>
<br>
<div class="moz-cite-prefix">On 02/10/2015 01:31 PM, Anand Kothekar
wrote:<br>
</div>
<blockquote
cite="mid:CAHUT-CRc9ycmz2je4QiUYF1LwSj=U8cHttOC37TBWA2=Uy70ug@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I was trying to import users from csv file to midpoint.</div>
<div><br>
</div>
<div>user is getting added successfully. I also tried assigning
End User Role to all users through Object Template. </div>
<div><br>
</div>
<div><span style="font-size:12.8000001907349px">
<mapping></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<name>basic role</name></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<expression></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<assignmentTargetSearch></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<targetType>c:RoleType</</span><span
style="font-size:12.8000001907349px">targetType></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<oid>00000000-0000-0000-0000-000000000008</oid></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
</assignmentTargetSearch> </span><span
style="font-size:12.8000001907349px"> </span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
</expression></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<target></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
<path>assignment</path></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
</target></span><br
style="font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">
</mapping></span><br>
</div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px">Now the scenario
is that I want to get User's Organization from CSV file </span><span
style="font-size:12.8000001907349px">for that I referred " </span><span
style="color:rgb(51,51,51);font-family:monospace;font-size:14px;line-height:11.4285717010498px">object-template-org.xml
".</span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px"><b><u>so I added
following code in Object template</u></b></span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px"><mapping></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><name>Org-org
mapping</name></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><authoritative>true</authoritative></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><source></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><path>extension/ext:orgpath</path></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></source></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><source></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><path>orgType</path></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></source></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><expression></span></div>
<div><span style="font-size:12.8000001907349px">
<assignmentTargetSearch></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><targetType>c:OrgType</targetType></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><filter></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><q:equal></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><q:path>c:name</q:path></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>parent =
orgpath.tokenize('/')[1]</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>if (!parent) {</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>return "TOP";</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>} else {</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>return parent;</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>}</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></q:equal></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></filter></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><createOnDemand>true</createOnDemand></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><populateObject></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>orgpath.tokenize('/')[1]</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><path>name</path></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><value>replicated</value></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><path>orgType</path></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span>orgpath.tokenize('/')[1..-1].join('/')</span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></code></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></script></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></expression></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span><path>extension/ext:orgpath</path></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></target></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></populateItem></span></div>
<div><span style="font-size:12.8000001907349px"><span class=""
style="white-space:pre"> </span></populateObject></span></div>
<div><span style="font-size:12.8000001907349px">
</assignmentTargetSearch> <span class=""
style="white-space:pre"> </span></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></expression></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><target></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><path>assignment</path></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></target></span></div>
<div><span style="font-size:12.8000001907349px"> </span><span
class=""
style="font-size:12.8000001907349px;white-space:pre"> </span><span
style="font-size:12.8000001907349px"><condition></span><br>
</div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><script></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span><code>orgType
== 'replicated'</code></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></script></span></div>
<div><span style="font-size:12.8000001907349px"> <span
class="" style="white-space:pre"> </span></condition></span></div>
<div><span style="font-size:12.8000001907349px">
</mapping> </span></div>
<div><span style="font-size:12.8000001907349px"><br>
</span></div>
<div><span style="font-size:12.8000001907349px">but one error
is occurs when I try to save Object Template " </span><span
style="color:rgb(185,74,72);font-family:'Helvetica
Neue',Helvetica,Arial,sans-serif;font-size:12px;line-height:15.5844163894653px;background-color:rgb(238,211,215)">Error
parsing XML document The prefix "q" for element "q:equal" is
not bound. "</span></div>
<div><span style="color:rgb(185,74,72);font-family:'Helvetica
Neue',Helvetica,Arial,sans-serif;font-size:12px;line-height:15.5844163894653px;background-color:rgb(238,211,215)"><br>
</span></div>
<div><br>
</div>
<div>Can you please point out where I am doing mistake or I need
to follow some another approach.</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Anand Kothekar</div>
<img moz-do-not-send="true" class="mailtrack-img"
src="https://mailtrack.io/trace/mail/2ac2002cf452bfe1b939447099f6c32404e8a3b3.png"
height="0" width="0"></div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer
evolveum.com evolveum.com/blog/
_____________________________________________
"Semper Id(e)M Vix."
</pre>
</body>
</html>