On 07/05/2013 14:04, Nik wrote:
Hi Fabio,
One further question I would like to ask wrt to this subject is.
How can I execute a db export from a CLI?
I have tried the following using syncope-standalone-1.1.1:
[nik@anvil apache-tomcat-7.0.39]$ curl -u admin:password -H
"Content-Type: application/json" -X GET
http://10.0.0.123:9080/syncope/cxf/configurations/dbDump
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
<key>dbDump</key>
</configuration>
[nik@anvil apache-tomcat-7.0.39]$
without seeing any db xml output equivalent to the console export in a
content.xml.
Take a look at [2] for how to deal with internal storage import / export
and [3] for how to export via CLI.
I have also fixed [4] for CXF export; in your case:
curl -u admin:password -H "Content-Type: application/json" -X GET
http://10.0.0.123:9080/syncope/cxf/configurations/stream
Regards.
Hi German, please find my answers in-line.
Il 06/05/2013 12:01, German Parente ha scritto:
Hi all,
my managers want me to implement the scenario I will describe. I
will need some help to know how to address it.
I have an application which basically consists in a REST web
service. I have been asked to implement rbac feature to users
connecting to the web service. The application is running in a
virtual machine that is delivered to each customer asking for the
product.
Precise questions:
1) I will have to deploy syncope in the virtual machine for each
customer using the product. Customer is not supposed to use the
console but an application must do the full initialization:
- cleaning default stuff (users/roles, etc).
You can avoid this step working onto the file
core/src/main/resources/content.xml.
This file specifies the content that have to be loaded at first db
initialization.
At startup time, Apache Syncope checks for syncope db tables: if no
content is found the content.xml file will be used to create the
default content.
You can create your own content.xml file by configuring and exporting
your default content via console:
1. deploy syncope (or start in embedded mode)
2. make your configuration via console
3. export the configuration via console (main tab Configuration)
- creating resource and connectors
- configure them
- add users in the IDM from backend by reconciliation or
synchronization.
All initializing steps must be done by an application.
Is there any example of how to do this ? A full configuration done
from scratch where I could see how to achieve this ?
As far as I remember it shouldn't exist any example of how to do this.
You can take a look at integration tests [1]: looking into these
pieces of code you should be able to create your own configuration
application.
Would it be better to use java api or rest interface ?
REST API.
2) I have to address from my application the RBAC module getting
user roles from syncope.
Again, what would be the best approach ? Use java api or bare rest
request calls ?
REST calls are the right way to do this.
Thanks a lot in advance,
German
[1]
http://svn.apache.org/viewvc/syncope/tags/syncope-1.1.1/core/src/test/java/org/apache/syncope/core/rest/
[2]
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=31819687
[3]
https://cwiki.apache.org/confluence/display/SYNCOPE/Calling+RESTful+services+from+CLI#CallingRESTfulservicesfromCLI-Exportdatabasecontent
[4]
https://cwiki.apache.org/confluence/display/SYNCOPE/REST+API+upgrade#RESTAPIupgrade-ConfigurationService
--
Francesco Chicchiriccò
ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/