on 03-27-2012 9:29 AM
Hi developers
I have to create an object of TableSchema to do a ReverseLookup. I have to do something like that.
RepositorySchema repositorySchema; // This is an interface
TableSchema ts = _repositorySchema.getTableSchema(repositorySchema.getTable("main_table").getId());
ReverseLookupId[] rls = ts.getReverseLookups();
Can anyone provide me an example of code to instance a RepositorySchema or Tableschema?
Thanks in advance!
P.S. I'm using MDM 7.1 Java API
Hi Xavier,
you can get instance of repository schema with usage of MetadataManager or directly with MDM command. For using MetadataManager you need a UserSessionContext, for the command only a ConnectionAccessor
MetadataManager:
RepositorySchema schema = MetadataManager.getInstance().getRepositorySchema(userSessionContext);
Command is: GetRepositorySchemaCommand
Greetz
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexander,
I tried the same that you are telling me, but when I try to get the instance of userSessionContext the API throws an exception telling me that i have to assign a password for these user.
You can check the different types of Class constructors at "http://help.sap.com/javadocs/MDM71/com/sap/mdm/session/UserSessionContext.html"
Alternative,
I've seen this (http://help.sap.com/javadocs/MDM71/com/sap/mdm/extension/session/ConnectionManagerEx.html😞
NonNetWeaverMdmDestinationProperties destination =
new NonNetWeaverMdmDestinationProperties(serverName, repositoryName, repositoryUser);
// Connect to MDS
UserSessionContext sessionCtx = ConnectionManagerEx.connectWithUserSession(
destination, repositoryPassword, applicationName, regionName,
null, unicodeNormType, useBlobCache, null);
... but Im not sure if this will work. I can't test it now.
Have you created the session first?
UserSessionContext usc = new UserSessionContext(server, repository, userId);
//optional settings
usc.setApplicationId("MDM_Business_Logic");
usc.setConnectionType(ConnectionTypes.LOCAL_SIMPLE_CONNECTION);
usc.setTrustedConnection(true); (if necessary)
SessionManager.getInstance().createSession(userSessionContext, SessionTypes.USER_SESSION_TYPE, "yourPassword");
Greetz
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.