[gme-users] getAttribute in Java

hernandf at cis.uab.edu hernandf at cis.uab.edu
Wed May 5 12:59:19 CDT 2004


thanks,
Francisco

Original Message:
-----------------
From: Gyorgy Balogh bogyom at isis.vanderbilt.edu
Date: Wed, 5 May 2004 09:12:41 -0500
To: gme-users at list.isis.vanderbilt.edu
Subject: RE: [gme-users] getAttribute in Java


This was a bug. I have attached the fixed gme.jar
Thanks
Gyorgy

-----Original Message-----
From: hernandf at cis.uab.edu [mailto:hernandf at cis.uab.edu] 
Sent: Tuesday, May 04, 2004 10:11 PM
To: gme-users
Subject: [gme-users] getAttribute in Java

I was trying to access attributes from an atom using the Java interface,
but the function getAttribute kept returning false. The code that i used
is

JBuilderAtom gmeCredential = (JBuilderAtom)e.nextElement();
String[] temp = {""};
Vector t = gmeCredential.getStrAttributeNames();
if(gmeCredential.getAttribute((String)t.elementAt(1),temp))
	JOptionPane.showMessageDialog(null,"success",
		    	 	      Support.APPLICATION,
				      JOptionPane.INFORMATION_MESSAGE);
else
	JOptionPane.showMessageDialog(null,"failure",
		  	  	      Support.APPLICATION,
				      JOptionPane.INFORMATION_MESSAGE);

i hard coded the name of the attribute, but to avoid mispellings i
used a name returned from getStrAttributeNames. That function correctly
returned three attributes, but whenever i tried to get their values the
else part of the previous code was always executed.

When i traced the function calls, it returned the error: MemberNotFound 
(0x8002003), but that shouldn't happen since i'm using the same names
of the attributes that are stored in the atoms. I tried to use the Mga
versions but i kept getting the same error.

The values are there, but it seems that there's a problem for accessing
them
by name, for example this following code retrieves the values:

try{
	String attribute =
gmeCredential.getIAtom().getAttributes().getItem(0).getStringValue();
	JOptionPane.showMessageDialog(null,attribute,
				      Support.APPLICATION,
			  	      JOptionPane.INFORMATION_MESSAGE);
} catch (Exception err){
	Support.reportError(err);
}

am i doing something wrong?

Francisco

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


_______________________________________________
gme-users mailing list
gme-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




More information about the gme-users mailing list