MDM 5.5 SP05 JAVA API
Heii All,
As per If we use Java API from MDM 5.5 SP04. We will not be able to find any classes that will retrieve image and pdf data. The old API was able to do this, In API of SP05 version we can make it, but does SP04 version have any classes that will retrieve this data?
Please help me out.
Thanks
-KT
Heii,
As per my knowledge The SP 05 version of MDM Java API has a RetrieveBlobCommand command. As per I know this command was only added in SP 05 and does not exist in SP04.
This will help you.Please Reward Full if you find it useful.
Rgds
Deepak
Similar Messages
-
How to create a taxonomy using MDM 5.5 SP05 JAVA API?
Hi ALL,
I have a requirement in which i have to create a taxonomy using MDM 5.5 SP05 JAVA API.
Can anyone tell me how that functionality can be achieved?
Thanks in Advance.
Rajat.HI, Rajat.
For exposing hierarchy in WD view you need to use node with recursive children in the context and Tree/TreeNodeType UI elements in view layout.
For load hierarchy records you have to use RetrieveLimitedHierTreeCommand. You can load whole hierarchy (as I know, SP05 API have a bug - only first 1000 record can be loaded) or load hierarchy nodes on demand (using OnLoadChildren action of TreeNodeType element).
Refer to this example of loading child records:
// Context structure:
// Tree (model node, model class built from com.sap.mdm.data.Record interface)
// |-- Children (recursive child node repeating Tree node)
// |-- DisplayValue (string value attribute, TreeNodeType's text property bound here)
// |-- HasChildren (boolean value attribute, TreeNodeType's hasChildren property bound here)
// parentElem is element of node Tree or Children for which we must load child records, null for first level of hierarchy
private void fillNodeWithChildren(IPrivateHierarchySelectView.ITreeElement parentElem) {
// Determining RecordId of parent record and context node to which child records belong
RecordId parentRecordId = null;
if (parentElem != null) parentRecordId = parentElem.modelObject().getId();
IPrivateHierarchySelectView.ITreeNode parentNode =
parentElem == null
? wdContext.nodeTree()
: parentElem.nodeChildren();
// Loading children with RetrieveLimitedHierTreeCommand
try {
RetrieveLimitedHierTreeCommand retTreeCmd = new RetrieveLimitedHierTreeCommand(...); // use suitable constructor
if (parentRecordId != null) retTreeCmd.setRootNode(parentRecordId);
retTreeCmd.setResultDefinition(...); // don't forget set ResultDefinition
retTreeCmd.execute();
HierNode subRoot = retTreeCmd.getTree()
parentNode.invalidate();
// Processing loaded child records - add elements into parentNode
if (subRoot == null) return;
IPrivateHierarchySelectView.ITreeElement childElem;
HierNode childRecord;
HierNode[] children = subRoot.getChildren();
int count = children == null ? 0 : children.length;
for (int i = 0; i < count; i++) {
childRecord = children<i>;
childElem = parentNode.createTreeElement(childRecord);
childElem.setDisplayValue(childRecord.getDisplayValue());
childElem.setHasChildren(!childRecord.isLeaf());
parentNode.addElement(childElem);
if (parentElem != null) parentElem.setHasChildren(count > 0);
} catch (/* Some MDM Exceptions */) {}
Don't forget call fillNodeWithChildren(null) in wdDoInit for load first level of hierarchy. -
How to use SessionManager (MDM 5.5 SP06 JAVA API 2) with TrustedConnection
Hello MDM 5.5 SP06 JAVA API Experts,
Is it possible to Use the SessionManager in conjunction with TrustedConnections ? The trusted connection is setup properly (adding the client IP to the allow.ip file on MDM-Server).
I tried a lot but I didn't succeed with the new JAVA API 2 SessionManager functionality.
I'm initializing a UserSessionContext object and set the field for trusted connections to true.
Later I request an instance of SessionManager and call the createSession() method.
Although I've set the trustedConnection (=true) field of UserSessionContext, I get an exception, if the password is not set correctly. Due to my understanding, the password should be ignored if the UserSessionContext --> trustedConnection field is set to true. Is this a bug or am I missing any important step ?
I have also used several constructors of UserSessionContext but no chance.
Could anyone use the SessionManager with trusted Connections ?
Any help would be greatly appriciated.
Best regards.
public static void main(String[] args)
Settings settings = new Settings();
RepositoryIdentifier repId = new RepositoryIdentifier(settings.repository,
settings.dbServer,
settings.dbmsType);
//Create a UserSessionContext
//UserSessionContext sessionContext = new UserSessionContext("<servername>", "<repositoryName>", "<userName>");
UserSessionContext sessionContext = new UserSessionContext( "<servername>", repId, "English [US]", "<userName>");
sessionContext.setConnectionType(ConnectionTypes.LOCAL_POOL_CONNECTION);
sessionContext.setRegionLocale(Locale.US);
sessionContext.setTrustedConnection(true);
//Get an instance of SessionManager
SessionManager sessionManager = SessionManager.getInstance();
//Create user session
String userSession =
sessionManager.createSession(sessionContext, SessionTypes.USER_SESSION_TYPE, "<any pwd !!!>");
System.out.println("Created user SessionID: " + userSession);Hello Jitesh Talreja,
thanks for your reply and hint. The trusted connection configuration on MDM server is already setup correctly.
My concrete problem is to establish a trusted connection using the SessionManager.
If I use the TrustedUserSessionCommand, everything works.
CreateUserSessionCommand createUserSessionCommand = new CreateUserSessionCommand(connection);
createUserSessionCommand.setRepositoryIdentifier(repId);
createUserSessionCommand.setDataRegion(dataRegion);
createUserSessionCommand.execute();
session = createUserSessionCommand.getUserSession();
state = STATE_SESSION_ESTABLISHED;
try
TrustedUserSessionCommand tuscTrustedUser = new TrustedUserSessionCommand(connection);
tuscTrustedUser.setUserName(userName);
tuscTrustedUser.setSession(createUserSessionCommand.getUserSession());
tuscTrustedUser.execute();
session = tuscTrustedUser.getSession();
catch (com.sap.mdm.commands.CommandException e)
/* In Case the Connection is not Trusted */
System.out.println("Could not established trusted connection!!!");
e.printStackTrace();
But I want to make use of the SessionManager advantages see [MDM Java API Guide|http://help.sap.com/saphelp_mdm550/helpdata/en/47/9f23e5cf9e3c5ce10000000a421937/frameset.htm] -> API Structure and Basic Concepts -
MDM 5.5 SP04 Java API and Web Service Documentation
Is there documentation available that reflects the SP04 changes to the Java API, and the web services that are now available?
As of this morning, service marketplace contained spotty SP04 docs.
Thanks in advance,
MikeMike,
A cookbook would be wonderful (I think our developers would throw a party)!
An updated object model (as a preface to the user guide) for the legacy API (MDM4J.jar) AND the new "rebranded" API (mdm-*.jar) would also work.
I've been reduced to comparing the SP3 & SP4 javadocs
One fun approach that appears to be working for us, is to model each process using the DataManager, and try to duplicate that exactly via the corresponding API objects (e.g. the simple Connect-Find Table-Search Table-View Result Set-View Record-CheckOut/Upsert/Validate/CheckIn dance). New features in the DataManager reveal themselves a little more readily
Good luck,
...Dee -
MDM 7.1 SP03 Java API - setRetrieveResultCounts & taxonomy aliases = error
We just upgraded our test MDM system to 7.1 SP03 so we could use the new methods in the Java API to get result counts. However, we've run into a problem with the result counts when taxonomy aliases are being used.
The following code works when there are no taxonomy aliases defined in our MDM system, but as soon as we add any aliases, it fails:
RetrieveLimitedRecordsCompoundCommand command = new RetrieveLimitedRecordsCompoundCommand(sessionContext);
command.setPageIndex(pageIndex);
command.setPageSize(pageSize);
ResultDefinition resultDefinition = new ResultDefinition(PRODUCTS_TABLE);
resultDefinition.addSelectField(CATALOG_NUMBER_FIELD);
resultDefinition.addSelectField(LIST_PRICE);
resultDefinition.addSelectField(PRODUCT_CATEGORY);
resultDefinition.addSelectField(PRIMARY_IMAGE);
command.setResultDefinitions(new ResultDefinition[] { resultDefinition });
command.setRetrieveResultCounts(true);
RecordId category = new RecordId(categoryId);
// Set category search constraint
if (categoryId > 0) {
search.addSearchItem(new FieldSearchDimension(PRODUCT_CATEGORY),
new PickListSearchConstraint(new MdmValue[] { new LookupValue(category) }));
command.setSearch(search);
command.execute();
Here is there error we get:
com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Win32 structured exception occurred
at com.sap.mdm.data.commands.RetrieveLimitedRecordsCompoundCommand.execute(RetrieveLimitedRecordsCompoundCommand.java:187)
at com.baldor.mdm.Mdm.SearchProducts(Mdm.java:276)
at com.baldor.beans.ProductSearch.search(ProductSearch.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:112)
at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2327)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:1993)
at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:1941)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:285)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:243)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:114)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sap.mdm.internal.protocol.manual.ServerException: Win32 structured exception occurred
at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:126)
at com.sap.mdm.data.commands.RetrieveLimitedRecordsCompoundCommand.execute(RetrieveLimitedRecordsCompoundCommand.java:183)
... 32 more
Exception in thread "com.sap.mdm.internal.net.ConnectionPoolBase" java.lang.NullPointerException
at com.sap.mdm.internal.net.ConnectionPoolBase.reserveConnection(ConnectionPoolBase.java:150)
at com.sap.mdm.internal.net.ConnectionPoolBase.reserveConnection(ConnectionPoolBase.java:130)
at com.sap.mdm.internal.net.ConnectionPoolBase.checkAndDiscardConnections(ConnectionPoolBase.java:494)
at com.sap.mdm.internal.net.ConnectionPoolBase.run(ConnectionPoolBase.java:556)
at java.lang.Thread.run(Unknown Source)
Also, if I monitor the MDM system I can see the memory usage goes up more than 200MB and the CPU is pegged for 5-10 seconds before getting the error on the client.
Is there something we can do to fix this?
Thanks,
JonathanSorry about the formatting of the above message - for some reason the forum pulled out all the line breaks and ignored the tags...
-
MDM catalog standard webdypro - java API
Hallo,
I am using MDM catalog integration to SAP ECC 6.0.
I call the MDM catalog using the standard webdypro in ME51n.
Can the MDM catalog standard web dynpro be modified using MDM java API? and how?
Thank you in advance for your answers,
marco
Edited by: Marco Covino on Jul 7, 2008 11:36 AMSorry about the formatting of the above message - for some reason the forum pulled out all the line breaks and ignored the tags...
-
Need help in getting MDM relationship details using Java Apis
Hi,
Is it possible to search records which are in relationship using Java Apis? Suppose Record A is Parent record and Record B,C,D ... are child records.
I have to search all the records which are in relationship with record A.
Can any one send code snippet on this.
Regards,
NirajHi Niraj,
You can use RetrieveRelationshipsCommand api to get the relationship child of the Anchor Record.
RetrieveRelationshipsCommand command = new RetrieveRelationshipsCommand(connectionAccesor);
command.setSession(session);
command.setAnchorRecord(anchorRecord); / command.setAnchorRecordId(anchorRecordId); (use any of the two statements)
command.setRelationship(relationshipId); //For child int type is 10, and for Parent_child int type is 5
command.setMemberResultDefinition(resultDefinition);
command.execute();
//Get Member Records' resuld definition
ResuldDefinition rd = command.getMemberResultDefinition();
Hope this helps you. -
Data retrieval from MDM 5.5 using Java API
Hi,
Does anyone have a sample Java code snippet that can be called via XI to retrieve data from a repository in MDM 5.5 ?
Cheers
Colin.Colin,
What exactly do you want to do?
If you want to retrieve data from MDM, you need to have Java application call the API's provided.
Where is XI coming into picture?
Other way of doing it is to develop a web service and call that via XI and send the data.
Here is quick snippet to get some data.
Sample code for FreeForm search:
SearchParameters sparam = search.GetParameters ();
FreeFormTableParameter fftParam =
sparam.NewFreeFormTableParameter(ProductsTable);
FreeFormParameterField ffParamField =
fftParam.GetFields().New(PartNumberField);
ffParamField.GetValues().NewString(
partNoValue,FreeFormParameter.PrefixSearchType);
search.Add(fftParam);
Regards,
Ravi
Note : Please reward the posts that help you. -
Do any other guides about MDM Java API exist (except MDM_API_Tutorial and MDM 5.5 SP05 - Java API Migration Guide.pdf) ?
Especially MDM Search Java API interesting.Heii ,
For this please follow these links
http://help.sap.com/saphelp_mdm550/helpdata/en/45/0068570b0c0487e10000000a155369/frameset.htm
http://help.sap.com/saphelp_mdm550/helpdata/en/45/efdc5bb7b404a9e10000000a114a6b/frameset.htm
http://help.sap.com/saphelp_mdm550/helpdata/en/45/50b345af8e3be6e10000000a1553f7/frameset.htm
you may find this useful.
Please reward
Rgds
Deepak -
Req. Sample code for the Updation of Master record in MDM using Java API..
Hi All,
Can anyone provide me the same code for Updation of master record in MDM using Java API ??Hi SakthiNarayananD,
You can additionally go through the following links to work with MDM and Java API:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49 (Java API)
http://help.sap.com/javadocs/MDM/SP05/(Java api programs)
https://help.sap.com/javadocs/MDM/current/index.html (java api codes)
http://help.sap.com/javadocs/MDM/SP06P2/index.html (Java Docs for SP06)
Reg: Using JAVA API - Search
Re: Retrieving Drop Down List Value using JAVA API - Lookup values
How to retreive records from Lookuptable of type flat - Lookup Values
Reg: MDM with webdynpro - READ,INSERT,MODIFY
Hope It Helped
Thanks & Regards
Simona Pinto -
How to upload Image to MDM 5.5 SP3 using Java APIs
Hi,
I am trying to upload Image to Images table in MDM 5.5 using JAVA API for MDM. But. I'm not able to find particular field in Images table where I need to set the Blob object ( Image data ).
I'm not aware of the method to set the Blob, there is one for getting the Image data.
I have gone through I am not able to add images into Catalog thru java API forums posts and tried the code. But with no luck....
I think this code is for some other MDM version as the fields mentioned are not present in the Images table e.g. DataObject - this field is used in the above posts to set the Blob data but this field does not exist in Images table in MDM 5.5
Can anyone suggest the solution?
Thanks and Regards,
MausamHi Mausam,
Please try the following:
// adding to a image table
// get the bytes for the image
byte[] imageBuf = readFile("C:\pic.bmp");
// setup A2iFields
fields = new A2iFields();
fields.Add(new A2iField("DataObject", new
Value(imageBuf))); // the image binary (required)
fields.Add(new A2iField("Name", new Value("pic.bmp")));
// a name for the image
fields.Add(new A2iField("OrigName", new
Value("pic.bmp"))); // the original image file name
(required)
fields.Add(new A2iField("DataGroupId", new Value(888)));
// the data group to add to (required)
fields.Add(new A2iField("OrigLocationId", new
Value(999))); // the data location of the image
(required)
fields.Add(new A2iField("Description", new Value("a
short description"))); // a short description here
// add the image
String imageTable = "Images";
catalog.AddRecord(imageTable, fields, -1, -1);
It's taken out of the API guide for SP3 (the example for method AddRecord.
Best regards,
Amit -
Use MDM java Api for saving an image to mdm image table
Hi experts
I want to save an image from web dynpro java to MDM image table using java Api's
Can anyone provide a code snippet .
I am using MDM 7.1 sp6.
Thanks and regards
SureshHello Suresh
Unfortunatly, this is no possible, i mean, to load images to mdm repository through JAVA API.
Sure you can do it directly to database ( but for that you need to do saome investigation)
Here you can found JAVA API classes for MDM:
http://help.sap.com/javadocs/MDM71/
Next two classes are working with BLOBs (pdf, images, video, etc.) in MDM repository:
com.sap.mdm.blobs
com.sap.mdm.blobs.commands
Regards
Kanstantsin chernichenka
Edited by: kanstantsin_ch on Sep 8, 2011 2:36 PM -
Search for a Multilingual value in MDM using JAVA API
Good day,
Could you kindly assist.
I am trying to search for a field in MDM, from Portal using JAVA API. I do retrieve the value in English, but the problem is when I am trying to retrieve it in other languages. Please see sample code:
private Search getSearch(MDMConnection mdmconnection,String value, TableId tableid){
Search search =null;
FieldSearchDimension fielddimension=null;
TextSearchConstraint textcontrain=null;
RepositorySchema reposchema =mdmconnection.reposchema;
if(value!=null)
search= new Search(tableid);
fielddimension=new FieldSearchDimension(reposchema.getFieldId("ATTR_VAL_ABBR","TEXT_VALUE"));
textcontrain=new TextSearchConstraint(value,TextSearchConstraint.EQUALS);
search.addSearchItem(fielddimension,textcontrain);
search.setComparisonOperator(Search.AND_OPERATOR);
return search;
Thank you in advance.
Regards,
SimniHi ,
Mdm- Multilingual value in MDM using JAVA API:
you can check the first point as its reagrdign youisue related pdf and soloutions for your question.
1. http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
2. http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e8aedc-cdfe-2c10-6d90-bea2994455c5?QuickLink=index&overridelayout=true
Hope this information helps you in solving the issue!!
Thanks&Regards
AswinChandraGirmaji -
Boolean Search Constraint in new Java API doesn't work for value of false
I'm developing an application that interfaces with MDM via the new Java API. We're on MDM version 5.5 SP 4 and have the latest patches installed. I can do searches fine on the repository, but have run into one problem with the Boolean Search Constraint. I have a set of records in the main table that have several boolean fields. I've discovered that when searching these records using a Boolean Search Constraint on any of the fields, I'm always receiving records that match the boolean value of true. This is even when I specify the Boolean Search Constraint value as false. Is anybody else seeing this problem?
It's a bug in MDM 5.5 SP04. The fix is in MDM 5.5 SP05.
-
Hi all,
I am implementing webdynpro with MDM. To start with it i need to include jar files only or anything else is needed.
Regards,
Jyothi
Edited by: jyothi beera on Feb 12, 2009 11:58 AMHi jyothi ,
To work with Webdynpro java and MDM system you will need to MDM java api files .
These MDM Java Apis contain all the functions and methods to work with the Master data in MDM.through your webdynpro screens.
You will need to MDM Jar files to be deployed on your Web application server and NWDS to work with them.
All you need to so is make sure that you are deploying the correct jar files matching with your mdm server version else you might face errors laters.
Uptill the SP05 version of MDM the apis were available as MDM4J.jar files but from the MDM SP06 version onwards they are the MDM JAVAP API.jar file.This file contains all the jars needed to work with MDM.
To know the compatible java apis to work with kindly follow the belwo link:
http://help.sap.com/javadocs/MDM/SP05/(Java api programs)
https://help.sap.com/javadocs/MDM/current/index.html (java api codes)
http://help.sap.com/javadocs/MDM/SP06P2/index.html (Java Docs for SP06)
You can also refer the belwo link on MDM integration using Java api:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02f4f88-7bbb-2a10-67ad-d435b9f0c643
Hope It Helped
Thanks & Regards
Simona Pinto
Maybe you are looking for
-
After Upgrade from NW04 to NW04s we just changed the profile. Now it is not possible to call a URL, example: http://howev26.hoval.com:50000/irj/portal/ or http://howev26.hoval.com:50000/ Bevor the profile was changed, we could call these URLs. It was
-
Can't connect to internet, Motorola cable modem seems to freeze
I have had this problem more and more fequently the past three or four weeks: I'm connected to the internet by ethernet through a motorola cable modem (SB5101). As long as the PC activity light on the modem is rapidly flashing amber things are fine.
-
I wonder if CTC program can run on WinXP? When I use web browser to login Cisco ONS15454, it always rise a warning that: C:\WINNT\system32\command.com C:\WINNT\system32\autoexec.nt. The system file is not suitable for running MS-DOS and Microsoft Win
-
Many to Many Relationship using junction table..
Hello im testing a many to many relation ship on j2ee and found this issue. Creating a relation ship table until now without succes to update the relationship table: code fragment as is: On application flow my session bean call the following method a
-
What can i do ??