On 22/04/19 09:35, Adam Levine wrote:
This question again :)

  I think I gave too much information and confused my question:

 I want to create XML Spring beans, and use those to make [Domain]Content.xml

<bean id="domain" class="org.apache.....Domain">
   <property name="jdbcConnection" ref="jdbcBean"/>
   <property name="realms" .....
   <property name="types"
   <property name="realms"
   <property name="policies"
    ......
</bean>

Can this be done?  I can't find a Domain object graph.
 If this can be done, which classes should I look at to load and export?

Thank you again. I hope this time I don't confuse anyone.

So, you want to create a Java class, to be used as Spring bean as above, which will take care to generate [Master]Content.xml?

If so, I would suggest to take a look at

https://github.com/apache/syncope/blob/2_1_X/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentExporter.java

Start from the export() method and follow the calls.

FYI, that class is the one behind the "export configuration" feature accessible via REST under GET /configurations/stream or from Admin Console.

Regards.

On Mon, Apr 8, 2019 at 2:57 AM Francesco Chicchiriccò <[email protected] <mailto:[email protected]>> wrote:

    On 08/04/19 09:51, Adam Levine wrote:
    Francesco, thank you for your reply.

    I will look at that link and see what more it can tell  me. 
     But, I think maybe my question is misunderstood.

    I'd like to create the content of the Content.xml by hand, which
    yes, is then fed into an initial deployment.

    Ok, I see.

    I would suggest anyway to not start from scratch, but at least
    from an existing

    core/src/main/resources/domains/MasterContent.xml

    in order to avoid missing important stuff.

    I find creating structure for a system in text to be manageable. 
    Using only the GUI to configure everything is a slower process,
    and it's not as easy to proof that all my content is there.   
    This will be like writing LDIF text files, and then sending that
    into LDAP to create your hierarchies.

    One of my concerns in creating the content by hand is not knowing
    how to handle items that have IDs or use IDs to show their
    parent.  It looks like those numbers are generated by the GUI,
    which would make editing the  file by hand more difficult.

    The UUID values are generated by the Core code, during the
    database insertion process; we chose the UUID format because it is
    portable across deployments and avoids conflicts.

    If you are looking for a simple way to generated correct UUID
    values, just visit

    https://www.uuidgenerator.net/

    (version 4)

    HTH
    Regards.

    On Mon, Apr 8, 2019, 2:33 AM Francesco Chicchiriccò
    <[email protected] <mailto:[email protected]>> wrote:

        Hi,
        feeding Syncope's internal storage with initial content is
        exactly the purpose of *Content.xml - MasterContent.xml for
        the Master domain - you might be interested in [1].

        The export feature (you can access either via REST under GET
        /configurations/stream or from Admin Console after clicking
        on the top-right triple gear icon) takes element precedence
        into account - so, any Realm is exported before any
        LogicActions referring to it, for example.

        You are naturally free to add / change / remove any element
        from the exported MasterContent.xml before attempting to
        start Syncope with it - as always, watch the log files for
        any error.

        Regards.

        [1]
        
http://syncope.apache.org/docs/2.1/reference-guide.html#deal-with-internal-storage-export-import

        On 07/04/19 20:53, Adam Levine wrote:
        I had a thought that I could wire up beans using Spring
        IOC.  From there I could instantiate and export as XML. 
        However, I'm digging through, trying to find my parent level
        class, and  not having much luck.  And even if/when I do,
        there's the question of having GUIDs on entries: are they
        required for initial import?  If they're all contained
        within a singular domain content file, do they know their
        proper parent association when relevant?


        Beyond being repeatable configuration, this would allow for
        iterative and better consistency in naming and linking, and
        avoiding my often scenario of "oops, forgot to create this
        piece first".

        Is what I'm wanting to do feasible, or is the web console
        the only way to build out content?

        thank you for your guidance!


        On Fri, Apr 5, 2019, 12:46 PM Adam Levine
        <[email protected] <mailto:[email protected]>>
        wrote:

            I like to keep initial structuring in a repeatable form.
            For instance, I have LDIFs I import to build out my
            custom schema, and then the LDAP hierarchy itself, and
            then seed with base content.  Recreating this by hand is
            not something anyone wants to do.
            With that, is there a way to build out content to feed
            MasterContent.xml, other than wiring everything in the
            GUI and exporting?  I could edit the XML by hand, but
            that, too, looks fragile if it's dependent upon correct
            GUID cross-references.

            Thank you !

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to