on 08-29-2005 10:12 AM
I have a requirement where i need to extract values corresponding to a attribute using java api.Iam able to retrieve attributes using catalogData.GetAttributes("Categories") method.How to extract values for the attributes?
Thanks in advance
suresh
Hi Suresh,
What do you mean by "extract values corresponding to an attribute"?
There are 3 types of attributes:
Feature - text values;
Characteristic - numeric values;
Coupled - coupled numeric values.
Examples of these are:
Feature: Colour (red, green, blue)
Characteristic: Length (1 mm, 2.5 mm, ...etc)
Coupled: Boiling Temperature( 100 deg celcius @ 0 m)
ONLY Feature Attributes have a predefined set of values to choose from.
Here is some code which displays all the feature attributes and their available feature values:
try
{
AttributeInfoArray attributeInfos = catalogData.GetAttributes("Product Categories");
for(int i = 0; i < attributeInfos.GetSize(); i++)
{
AttributeInfo attributeInfo = attributeInfos.GetAttributeInfoAt(i);
if(CMDBTypes.IsFeature(attributeInfo.GetType()))
{
System.out.println(attributeInfo.GetName());
FeatureDomain featureDomain = attributeInfo.GetFeatures();
for(int fdIdx = 0; fdIdx < featureDomain.GetSize(); fdIdx++)
{
FeatureValue featureValue = featureDomain.GetFeatureValueAt(fdIdx);
System.out.println(" " + featureValue.GetValue());
}
System.out.println("***************************************************");
}
}
}
catch (StringException e)
{
e.printStackTrace();
}
Regards,
Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.