-
1. Re: More information (examples?) on federation?
rhauch Jun 18, 2013 10:03 AM (in response to friso_caci)1 of 1 people found this helpfulWe don't really have good examples of federation. You mentioned the blog category; have you read our documentation about federation? That page describes the concepts important to federation, and has some very simple configuration examples for each of the connectors we provide out of the box. Really, the only part of federation that you will see is the configuration.
You might also be able to look at some of the configuration files we use in our test cases:
- https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/test/resources/config/repo-config-filesystem-federation.json
- https://github.com/ModeShape/modeshape/blob/master/connectors/modeshape-connector-git/src/test/resources/config/repo-config-git-federation.json
- https://github.com/ModeShape/modeshape/blob/master/connectors/modeshape-connector-cmis/src/test/resources/config/repository-1.json
There are other test configurations (including several that are purposefully invalid, as noted in the file name), but those three show most of the features.
And remember that client applications don't really see any difference between "external" (federated) nodes and regular "internal" nodes, so really there is nothing to change in your applications. Of course, client applications could infer that a node is external based upon the primary type, mixin type, or properties - but that inference my not actually be correct since an application could create internal nodes with those same characteristics.
Finally, you can also write your own connectors: simply extend "org.modeshape.jcr.federation.spi.Connector" (or "org.modeshape.jcr.federation.spi.ReadOnlyConnector"), add fields for any connector-specific configuration properties, and implement the required methods. The FileSystemConnector is probably the most straightforward, but the GitConnector is the most interesting since it maps a Git repository's non-hierarchical structure of tags, branches, commits, etc. into a hierarchical node structure that is much more conducive for access via ModeShape. We just added in 3.3.0 the ability for a connector to generate events in response to externally-initiated activities. Our built-in connectors don't yet make use of that functionality.
-
2. Re: More information (examples?) on federation?
friso_caci Jun 21, 2013 6:51 AM (in response to rhauch)OK, Thanks for that. Just to see if I really get it: if my federated resources are in a relational database it's up to me to write the connectors myself?
Another (related) question: I've got my repositories configured in my standalone.xml (a la https://docs.jboss.org/author/display/MODE/Configuring+ModeShape+in+AS7#ConfiguringModeShapeinAS7-Step4c%3AAddtherepository) should I write your JSON examples in the standalone.xml or can (should, must) I provide a separate config file? If so, how do I link that config file to my modeshape instance configuration?
Groeten,
Friso
-
3. Re: More information (examples?) on federation?
rhauch Jun 21, 2013 9:14 AM (in response to friso_caci)OK, Thanks for that. Just to see if I really get it: if my federated resources are in a relational database it's up to me to write the connectors myself?
Yes, if you have existing database (with their own schemas) and want ModeShape to access their data, you will need to write a connector to do so. We do have a feature request on our roadmap for a generic connector (see MODE-282), but nobody is working on it at the moment as it is non-trivial. It'd be far easier for you to write a connector to a specific schema.
Another (related) question: I've got my repositories configured in my standalone.xml (a la https://docs.jboss.org/author/display/MODE/Configuring+ModeShape+in+AS7#ConfiguringModeShapeinAS7-Step4c%3AAddtherepository) should I write your JSON examples in the standalone.xml or can (should, must) I provide a separate config file? If so, how do I link that config file to my modeshape instance configuration?
ModeShape's subsystem for AS7/EAP is configured entirely through the "standalone.xml" (or whatever) XML file and/or CLI mechanism. Thus, there is no JSON involved. Unfortunately, we don't have a lot of AS7/EAP configuration examples, but you can use at the XSD for ModeShape's subsystem (which is also installed into the "docs" directory of your server when you install the subsystem) or look at some of our test configurations.
-
4. Re: More information (examples?) on federation?
friso_caci Jun 21, 2013 10:14 AM (in response to rhauch)sorry to have to bother you again, but I really am getting there (though slowly maybe). What would be the command for adding external-sources to the configuration xml via the jboss-cli ? I usually try to get the command from the cli-gui, but that seems little help in this instance I'm afraid.
-
5. Re: More information (examples?) on federation?
rhauch Jun 21, 2013 10:17 AM (in response to friso_caci)Did these sample commands help? https://docs.jboss.org/author/display/MODE/Configuring+ModeShape+in+AS7#ConfiguringModeShapeinAS7-Addandremoveexternalsources
-
6. Re: More information (examples?) on federation?
hchiorean Jun 21, 2013 10:23 AM (in response to rhauch)Or, if you don't really fancy CLI/want to test something quickly, you can also modify the XML configuration by hand: https://github.com/ModeShape/modeshape/blob/master/integration/modeshape-jbossas-integration-tests/src/main/resources/kit/jboss-eap61/standalone/configuration/standalone-modeshape.xml#L572
-
7. Re: More information (examples?) on federation?
friso_caci Jun 21, 2013 10:31 AM (in response to rhauch)Yes they did! Thanks a bunch. (and sorry for not reading the manual properly)
-
8. Re: More information (examples?) on federation?
friso_caci Jun 24, 2013 3:39 AM (in response to hchiorean)Thing is, I actually like using the CLI better than manipulating the XML. In my mind it's a more robust (easier scriptable) solution that I can give my collegues once I've done the work. In my mind the CLI is less sensitive to different environments and/or alternative configurations.