[midPoint] Question, How to properly reload a CSV resource

Ivan Noris ivan.noris at evolveum.com
Tue Mar 10 16:52:15 CET 2015


Hi Jason,

On 03/10/2015 04:09 PM, Jason Everling wrote:
> I have been doing this quite often (testing and since I can basically
> put any data/attribute into midPoint I keep finding new things to add)
> but in an ugly way. If I were to add new attributes or in CSV terms
> "columns" to my CSV file and edit the resource then the task errors
> out. It takes a little bit of doing but eventually I get it going again.
>
> Is there a way or steps I should take when doing this that would go as
> smoothly as possible?
>
> JASON

I was trying to find a better way, but so far only this has come out:

1. if the resource is used for LiveSync, stop the task after all changes
are processed
 - this means you will not be able to sync from that resource now
2. modify the .csv file (add new columns) header
3. modify the .csv file (add new columns) content - add empty values
 - empty values to avoid running reconciliation or import from resource;
instead of empty values you may want to add the real values and use
import from resource or reconciliation to avoid step 10
4. remove old files used for synchronization (filename.csv.*)
 - the old diff files have different number of columns
5. edit task in midPoint - Repository objects - Task and remove
"<extension> .. </extension>" containing the last token (file timestamp)
used for sync
 - this means the sync will start right after starting the LiveSync task
and when first change is detected
6. update resource - schema handling (if necessary)
 - otherwise you cannot use any of the new attributes from the resource
to fill any midPoint attributes
7a. edit the resource in midPoint and delete <schema> .. </schema>
contents OR
7b. reimport the resource definition if there is no schema defined in
resource on disk
8. test connection for the CSV resource. It will create
<schema>..</schema> in resource
9. resume LiveSync task
 - LiveSync will start now - as no previous diff file exists, it will
create one and start to poll for changes
10. modify the .csv file - add real values for new columns
 - this will cause LiveSync to actually process the new values. To avoid
this, in step 3 you can use import from file/reconciliation instead of
the LiveSync and only after that start the LiveSync task

It's ... well, ugly. But CSV connector has its limitations.

For target resource, all you need to do is to alter the schema handling
in the resource, drop the <schema>..</schema>, edit the .csv columns and
add at least empty values for all lines to correspond with the header.

Regards,
Ivan

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




More information about the midPoint mailing list