Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Data type issue with JNDI CP

Raj,

Yes, this is an another area where we need mapping code.  As you've discovered, the current attribute value data type mapping for Java.lang.String (the data type of most values returned from JNDI) is to the XML type, xsd:String.  We need to promote standard schemas that we can then lay down as templates against any Higgins CP to cause it produce that standard schema and the IdAS application can be CP agnostic as it should be.  While making the JNDI CP check for any kind "TimeStamp" attribute value (there's also "modifyTime") and converting it to a dateTime might be convenient for your application, it would do nothing for agnostics.

So, I guess I'm looking for some IdAS guiding principles from Jim.  What's a good general strategy for CP implementors here?

Tom

>>> Rajalakshmi S Iyer <iyer_rajalakshmi@xxxxxxxxxx> 10/01/08 11:37 AM >>> 
Hi,

I have written the following sample IdAS code to get the OWL data type for
a generalizedTime type attribute 'createTimeStamp' and ran it against the
JNDI CP.

java.util.List attrList = new java.util.ArrayList();
attrList.add(new java.net.URI(
"http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_createTimeStamp";
));

IEntity person = context.getEntity("uid=riyer,o=Higgins",
attrList.iterator());
IAttribute property = (IAttribute)person.getAttribute(new java.net.URI(
"http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_createTimeStamp";
));
Iterator valItr = property.getValues();
while ( valItr.hasNext() ) {
      IAttributeValue propVal = (IAttributeValue)valItr.next();
      if (propVal.isSimple()) {
            ISimpleAttrValue simpleAttrValue = (ISimpleAttrValue) propVal;
            java.net.URI valType = simpleAttrValue.getValueType();
            System.out.println(valType.toString());
      }
}

The output data type for the 'createTimeStamp' attribute is
http://www.w3.org/2001/XMLSchema#string. Should it not be the XML dateTime
data type?

Further investigation showed that the getAttribute(URI consumerAttrName) in
JNDIEntity,java has code like -

Object jndiValue = jndiAttrValEnum.next();
if (jndiValue instanceof String) {
      attr.addSimpleValue(ISimpleAttrValue.STRING_TYPE_URI, (String)
jndiValue);
}

Shouldn't the check here be for the data type of the LDAP attribute instead
of the type of value?

Thanks,
Best regards,
Rajalakshmi Iyer




_______________________________________________
higgins- dev mailing list
higgins- dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins- dev



Back to the top