[midPoint] Importing Users With Their Organization From CSV File.

Ivan Noris ivan.noris at evolveum.com
Tue Feb 10 13:34:05 CET 2015


Hi Anand,

just declare q prefix as follows:

         xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"

I recommend to put it to your root element (e.g. <objectTemplate>) so
that you can refer to it everywhere.

Regards,
Ivan

On 02/10/2015 01:31 PM, Anand Kothekar wrote:
> Hi, 
>
> I was trying to import users from csv file to midpoint.
>
> user is getting added successfully. I also tried assigning End User
> Role to all users through Object Template. 
>
>   <mapping>
>         <name>basic role</name>
>         <expression>
>             <assignmentTargetSearch>
>                 <targetType>c:RoleType</targetType>
>                 <oid>00000000-0000-0000-0000-000000000008</oid>
>             </assignmentTargetSearch>           
>         </expression>
>         <target>
>                 <path>assignment</path>
>         </target>
>     </mapping>
>
> Now the scenario is that I want to get User's Organization from CSV
> file for that I referred  " object-template-org.xml ".
>
> *_so I added following code in Object template_*
>
> <mapping>
>     <name>Org-org mapping</name>
>     <authoritative>true</authoritative>
>     <source>
>     <path>extension/ext:orgpath</path>
>     </source>
>     <source>
>     <path>orgType</path>
>     </source>
>     <expression>
>             <assignmentTargetSearch>
>             <targetType>c:OrgType</targetType>
>         <filter>
> <q:equal>
> <q:path>c:name</q:path>
> <expression>
> <script>
> <code>
> parent = orgpath.tokenize('/')[1]
> if (!parent) {
> return "TOP";
> } else {
> return parent;
> }
> </code>
> </script>
> </expression>
> </q:equal>
> </filter>
> <createOnDemand>true</createOnDemand>
> <populateObject>
> <populateItem>
> <expression>
> <script>
> <code>
> orgpath.tokenize('/')[1]
> </code>
> </script>
> </expression>
> <target>
> <path>name</path>
> </target>
> </populateItem>
> <populateItem>
> <expression>
> <value>replicated</value>
> </expression>
> <target>
> <path>orgType</path>
> </target>
> </populateItem>
> <populateItem>
> <expression>
> <script>
> <code>
> orgpath.tokenize('/')[1..-1].join('/')
> </code>
> </script>
> </expression>
> <target>
> <path>extension/ext:orgpath</path>
> </target>
> </populateItem>
> </populateObject>
>             </assignmentTargetSearch>    
>     </expression>
>     <target>
>     <path>assignment</path>
>     </target>
>     <condition>
>     <script>
>     <code>orgType == 'replicated'</code>
>     </script>
>     </condition>
>     </mapping>  
>
> but one error is occurs when I try to save Object Template " Error
> parsing XML document The prefix "q" for element "q:equal" is not bound. "
>
>
> Can you please point out where I am doing mistake or I need to follow
> some another approach.
>
>
> Thanks,
> Anand Kothekar

-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer
  evolveum.com     evolveum.com/blog/
  _____________________________________________
  "Semper Id(e)M Vix."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20150210/c9455b21/attachment.htm>


More information about the midPoint mailing list