cancel
Showing results for 
Search instead for 
Did you mean: 

Export Repository Schema automatically using Java or COM API

Former Member
0 Kudos

Hello.

I guess you all know the "Export Repository Schema" function in the MDM Console with which it is possible to get the Schema file in two small steps.

My question now is, can I use this one functionality in a program using either Java oder COM API? The program itself should connect to the MDM and read out the schema of a repository.

Up to now I am that far, that I use the Java API to connect to the repository and I also know that there is "GetRepositorySchemaCommand" method in the API (or other related methods). At first I thought, that this would get me the needed XML file within a few LOC. I do not even know there is something comparable within the COM API.

Yet all methods I found return not what I really want. I want to have that XML file of the Console's "Export Repository Schema" function, not more, not less.

It is sure possible that I can create that XML file using the result of the "GetRepositorySchemaCommand" function, but if there is another way, I would prefer that one.

At the moment I am searching at the table level for a short way to get something like, which would be a bit more complicated than I want, but also acceptable:

<Table type="MainTable" code="Products" description="" keyMapping="No" primaryDisplay="Name" displayFields="Name; MDMID" uniqueFields="">

But the only thing I found (using Debug mode of Eclipse) was that there are a lot ArrayLists, HashMaps in the objects I created.

Or do I really have to built up the whole XML file from base up?

I hope you can give me some input.

Best regards

Dominik Trui

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Dominik Trui

My question now is, can I use this one functionality in a program using either Java oder COM API? The program itself should connect to the MDM and read out the schema of a repository.

As of i knw the MDM Console allows you to export and import the schema of an MDM repository which can be useful in a variety of circumstances for ex:

Schema migration

Migrate a repository structure from one repository to another without changing data in the exported or imported repositories.

Backup/restore

Backup a repository structure without backing up the data of the repository, and then restore the repository structure without changing any data.

Automation

Provide an automated mechanism for migrating schema changes from development, to test, and from test to deployment versions of the same repository.

However, you could find detailed info about this on this URL

[http://help.sap.com/saphelp_mdm550/helpdata/en/6a/4e08b685654800b631b3464ce3c649/content.htm]

Best Rgds,

Krutarth

Former Member
0 Kudos

Hello Krutarth,

thanks for your answer.

-


Automation

Provide an automated mechanism for migrating schema changes from development, to test, and from test to deployment versions of the same repository.

-


Maybe this could really work for me, yet I don't know how. How do you set up this Automation in the Console? Is it in the Admin, where I found "XML Schemas"? If this is the only thing regarding XML Schemas I don't think that this will help me with my problem. (I know it is a very specific problem though).

Instead of going into the Console and exporting the Schema manually, I want to use my selfwritten program that allows me to connect to a server and a repository and then export the schema migration file without opening the Console. In this program I already made it possible to select the server and repository of your choice. Now I need to export the Schema from this repository, not spending much time in the implementation. (Right at the moment I concentrate more on the rest of the ToDo's of my program then the part with connecting to the MDM, which is only a small part of the whole program).

I had hopes that there is a possibility to do this with just a view lines of code, but I guess I have to set up the XML-file by my own, going through all tables and fields of the repository.

If anyone has a suggestion how that could be done faster then that, I would be glad to hear about it.

Best regards

Dominik Trui

Former Member
0 Kudos

Just for completeness:

In the meantime I have done the schema export "manually" by building it up with the Java API. I just took the tables and the attributes I needed, but did not the whole schema export.

Answers (0)