on 10-21-2005 2:46 PM
Hello,
I would like to Extract image from the Catalog via JAVA API, Can anybody help on that? I also tried to extract the Features field form the Catalog but results in the error "Features field not found" Any ideas what could have wrong?
Many thanks,
Dharmi
Hi Dharmi,
To get features:
A2iIntArray textBlockIDs = rs.GetLookupIDAt(i,"Features field name");
String txtBlockVal[] = null;
if (textBlockIDs !=null){
int txtBlocksLength = textBlockIDs.GetSize();
int txtBlockIds [] = new int[txtBlocksLength];
txtBlockVal = new String[txtBlocksLength];
if (textBlockIDs != null) {
for (int t = 0; t < txtBlocksLength; t++){
int textBlockID = textBlockIDs.GetAt(t);
txtBlockIds[t] = textBlockID;
txtBlockVal[t] = catalogdataobject.GetTextBlock("Text Blocks", textBlockID);
}
}
}
For Image:
You need to use CatalogCache class GetImagePath method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Subbu,
Thank you for your code, it solved my problem. I am now going to try to get the image, I would like to get back if I have problems.
Best regards,
Dharmi
p.s. Sorry, I cannot some how allot points, I would check every hour to see if I could give points cos I dont see any options to allot the same next to anybody's reply.
Message was edited by: Dharmi Tanna
Hello Subbu,
When I try to use the CatalogCache.Init I get the following error:
Error:The method Init(String, int, String, String, String, String) in the type CatalogCache is not applicable for the arguments (String, int, String, String, String, int)
Which is quite strange cos the JAVA API reference guide also has the last parameter has int and not string.
Can you please help?
Regards,
Dharmi
Hi Dharmi,
According to javadoc for the latest version(SP2 Patch1), the last parameter is a string.
java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.lang.String path,
java.lang.String regionTag
where...
host - the server name or IP address.
port - the catalog port number.
user - the catalog user name.
password - the catalog user password.
path - the directory path where the blobs will be cached.
regionTag - the region to use for a catalog
Hope this helps,
Richard
Hello,
Can anybody tell me where i can find the latest JAVAAPI reference guide? I found the one for MDM 5.5 SP 1 but that also refers to the last parameter of the CatalogCache.Init as int and not string.
I looked up in service.sap.com/instguides -> SAP Netweaver -> Release 4 -> Installation and there only following 3 files are there for MDM 5.5 SP2
MDM 5.5 SP02 - Configuration Guide SAP MDM
MDM 5.5 SP02 - Installation Guide SAP MDM
MDM 5.5 SP02 ERP-MDM Field Mapping and Check Tables
Regards,
Dharmi
Message was edited by: Dharmi Tanna
Message was edited by: Dharmi Tanna
Hi Dharmi,
The javadoc that i'm referring is included in the MDM Java API installation. Since you have the code (MDM4J.jar) you should also have this. Regardless, you can download it from http://service.sap.com/swdc -> Download -> Support Packages and Patches -> Entry by Application Group -> SAP NetWeaver -> SAP MDM -> SAP MDM 5.5 -> MDM Java API 5.5.
Try "English [US]" for the region tag.
Hope this helps,
Richard
Hello Richard,
Sorry for the delayed reply. I was unable to find the Reference guide at the location specified by you.
Thank you for finding the name of the images table for me. I am now able to extract the image from MDM; but was wondering how to get the exactnames of the image any ideas on that???
Regards,
Dharmi
Hi Dharmi,
I wasn't referring to the reference guide, i was referring to the javadoc(html based api documentation). The Reference Guide for SP02 isn't available yet.
For the image issue, the CatalogData.GetImageInfo() methods return an ImageInfo class which contains methods to get all kinds of information about the image, including the name.
Hope this helps,
Richard
Hi Dharmi,
Can you give me the following info so that i can determine what the problem is? Thanks!!
Does your catalog have a table that contains a field called Features?
What classes and methods did you use to search the Features field?
Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Richard,
The catalog that I am using is the Demo_Inquera - I believe that it is the default catalog of MDM having the products catalog.
The following code was used to extract the data of the Features field:
A2iValueArray ftures= rs.GetValueAt(i, "Features").GetValueArray();
for(int j=0;j<ftures.GetCount();j++){
System.out.println("Features["j"] : "+
cd.GetTextInfo("Text
Blocks",ftures.GetValueAt(j).GetIntValue()).GetString());
}
Regards,
Dharmi
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
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.