version 1.1.2.4, 2009/09/29 08:29:32
|
version 1.1.2.6, 2009/10/14 10:12:39
|
|
|
| |
if (kbType == CIMTYPE_REFERENCE) | if (kbType == CIMTYPE_REFERENCE) |
{ | { |
/* |
SCMOInstance * ref = kbValue->extRefPtr; |
TODO: NEED RESOLvE the value down to a SCMO.... |
appendValueReferenceElement(out, *ref, true); |
CIMObjectPath ref = keyBindings[i].getValue(); |
|
appendValueReferenceElement(out, ref, true); |
|
*/ |
|
} | } |
else | else |
{ | { |
|
|
} | } |
| |
// Append Properties: | // Append Properties: |
for (Uint32 i=0,k=scmoInstance.inst.hdr->numberProperties;i<k;i++) |
for (Uint32 i=0,k=scmoInstance.getPropertyCount();i<k;i++) |
{ | { |
if (scmoInstance.inst.hdr->flags.isFiltered && | if (scmoInstance.inst.hdr->flags.isFiltered && |
!scmoInstance._isPropertyInFilter(i)) | !scmoInstance._isPropertyInFilter(i)) |
|
|
} | } |
else if (propertyType == CIMTYPE_REFERENCE) | else if (propertyType == CIMTYPE_REFERENCE) |
{ | { |
/* TODO: Implement writing Reference |
out << STRLIT("<PROPERTY.REFERENCE NAME=\""); |
out << STRLIT("<PROPERTY.REFERENCE" |
out.append( |
" NAME=\"") << rep->getName() << STRLIT("\" "); |
&(clsbase[propertyDef->name.start]), |
|
propertyDef->name.length-1); |
|
out << STRLIT("\" "); |
| |
if (!rep->getReferenceClassName().isNull()) |
if (0 != propertyDef->refClassName.start) |
{ | { |
out << STRLIT(" REFERENCECLASS=\"") |
out << STRLIT(" REFERENCECLASS=\""); |
<< rep->getReferenceClassName(); |
out.append( |
|
&(clsbase[propertyDef->refClassName.start]), |
|
propertyDef->refClassName.length-1); |
out.append('"'); | out.append('"'); |
} | } |
| |
if (!rep->getClassOrigin().isNull()) |
if (scmoInstance.inst.hdr->flags.includeClassOrigin) |
|
{ |
|
if (propertyDef->originClassName.start != 0) |
{ | { |
out << STRLIT(" CLASSORIGIN=\"") << rep->getClassOrigin(); |
out << STRLIT(" CLASSORIGIN=\""); |
|
out.append( |
|
&(clsbase[propertyDef->originClassName.start]), |
|
propertyDef->originClassName.length-1); |
out.append('"'); | out.append('"'); |
} | } |
|
} |
if (rep->getPropagated()) |
if (propertyDef->flags.propagated) |
{ | { |
out << STRLIT(" PROPAGATED=\"true\""); | out << STRLIT(" PROPAGATED=\"true\""); |
} | } |
|
|
out << STRLIT(">\n"); | out << STRLIT(">\n"); |
|
// Append Instance Qualifiers: |
for (Uint32 i = 0, n = rep->getQualifierCount(); i < n; i++) |
if (scmoInstance.inst.hdr->flags.includeQualifiers) |
XmlWriter::appendQualifierElement(out, rep->getQualifier(i)); |
{ |
|
SCMBQualifier * theArray= |
XmlWriter::appendValueElement(out, rep->getValue()); |
(SCMBQualifier*) |
|
&(clsbase[propertyDef->qualifierArray.start]); |
|
// need to iterate |
|
for (Uint32 i=0, n=propertyDef->numberOfQualifiers;i<n;i++) |
|
{ |
|
SCMOXmlWriter::appendQualifierElement( |
|
out, |
|
theArray[i], |
|
clsbase); |
|
} |
|
} |
|
SCMOXmlWriter::appendValueElement(out,*propertyValue,propertyValueBase); |
out << STRLIT("</PROPERTY.REFERENCE>\n"); | out << STRLIT("</PROPERTY.REFERENCE>\n"); |
*/ |
|
} | } |
else | else |
{ | { |
|
|
} | } |
else if (value.valueType == CIMTYPE_REFERENCE) | else if (value.valueType == CIMTYPE_REFERENCE) |
{ | { |
/* TODO: Implement writing an object path as value |
SCMOInstance * ref = value.value.extRefPtr; |
// Has to be separate because it uses VALUE.REFERENCE tag |
appendValueReferenceElement(out, *ref, true); |
CIMObjectPath v; |
|
value.get(v); |
|
_xmlWritter_appendValue(out, v); |
|
*/ |
|
} | } |
else | else |
{ | { |
|
|
} | } |
} | } |
| |
|
//------------------------------------------------------------------------------ |
|
// |
|
// appendValueReferenceElement() |
|
// |
|
// <!ELEMENT VALUE.REFERENCE |
|
// (CLASSPATH|LOCALCLASSPATH|CLASSNAME|INSTANCEPATH|LOCALINSTANCEPATH| |
|
// INSTANCENAME)> |
|
// |
|
//------------------------------------------------------------------------------ |
|
void SCMOXmlWriter::appendValueReferenceElement( |
|
Buffer& out, |
|
const SCMOInstance& ref, |
|
Boolean putValueWrapper) |
|
{ |
|
if (putValueWrapper) |
|
{ |
|
out << STRLIT("<VALUE.REFERENCE>\n"); |
|
} |
|
|
|
// See if it is a class or instance reference (instance references have |
|
// key-bindings; class references do not). |
|
|
|
// differentiate between instance and class using the SCMO flag |
|
if (ref.inst.hdr->flags.isClassOnly) |
|
{ |
|
// class |
|
if (0 != ref.inst.hdr->hostName.start) |
|
{ |
|
appendClassPathElement(out, ref); |
|
} |
|
else if (0 != ref.inst.hdr->instNameSpace.start) |
|
{ |
|
appendLocalClassPathElement(out, ref); |
|
} |
|
else |
|
{ |
|
Uint64 classNameLength=0; |
|
const char* className = ref.getClassName_l(classNameLength); |
|
appendClassNameElement(out, className, classNameLength-1); |
|
} |
|
} |
|
else |
|
{ |
|
// instance |
|
if (0 != ref.inst.hdr->hostName.start) |
|
{ |
|
appendInstancePathElement(out, ref); |
|
} |
|
else if (0 != ref.inst.hdr->instNameSpace.start) |
|
{ |
|
appendLocalInstancePathElement(out, ref); |
|
} |
|
else |
|
{ |
|
appendInstanceNameElement(out, ref); |
|
} |
|
} |
|
if (putValueWrapper) |
|
{ |
|
out << STRLIT("</VALUE.REFERENCE>\n"); |
|
} |
|
} |
|
|
|
// appendLocalInstancePathElement() |
|
// <!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)> |
|
void SCMOXmlWriter::appendLocalInstancePathElement( |
|
Buffer& out, |
|
const SCMOInstance& instancePath) |
|
{ |
|
out << STRLIT("<LOCALINSTANCEPATH>\n"); |
|
Uint64 nsLength=0; |
|
const char* ns=instancePath.getNameSpace_l(nsLength); |
|
appendLocalNameSpacePathElement(out, ns, nsLength-1); |
|
appendInstanceNameElement(out, instancePath); |
|
out << STRLIT("</LOCALINSTANCEPATH>\n"); |
|
} |
|
|
|
// appendInstancePathElement() |
|
// <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)> |
|
void SCMOXmlWriter::appendInstancePathElement( |
|
Buffer& out, |
|
const SCMOInstance& instancePath) |
|
{ |
|
out << STRLIT("<INSTANCEPATH>\n"); |
|
|
|
Uint64 hostnameLength=0; |
|
const char* hostname=instancePath.getHostName_l(hostnameLength); |
|
Uint64 nsLength=0; |
|
const char* ns=instancePath.getNameSpace_l(nsLength); |
|
appendNameSpacePathElement(out,hostname,hostnameLength-1,ns,nsLength-1); |
|
|
|
appendInstanceNameElement(out, instancePath); |
|
out << STRLIT("</INSTANCEPATH>\n"); |
|
} |
|
|
|
// appendLocalClassPathElement() |
|
// <!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)> |
|
void SCMOXmlWriter::appendLocalClassPathElement( |
|
Buffer& out, |
|
const SCMOInstance& classPath) |
|
{ |
|
out << STRLIT("<LOCALCLASSPATH>\n"); |
|
Uint64 hostnameLength=0; |
|
const char* hostname=classPath.getHostName_l(hostnameLength); |
|
Uint64 nsLength=0; |
|
const char* ns=classPath.getNameSpace_l(nsLength); |
|
|
|
appendNameSpacePathElement(out,hostname,hostnameLength-1,ns,nsLength-1); |
|
|
|
Uint64 classNameLength=0; |
|
const char* className = classPath.getClassName_l(classNameLength); |
|
appendClassNameElement(out, className, classNameLength-1); |
|
out << STRLIT("</LOCALCLASSPATH>\n"); |
|
} |
|
|
|
// appendClassPathElement() |
|
// <!ELEMENT CLASSPATH (NAMESPACEPATH,CLASSNAME)> |
|
void SCMOXmlWriter::appendClassPathElement( |
|
Buffer& out, |
|
const SCMOInstance& classPath) |
|
{ |
|
out << STRLIT("<CLASSPATH>\n"); |
|
|
|
Uint64 hostnameLength=0; |
|
const char* hostname=classPath.getHostName_l(hostnameLength); |
|
Uint64 nsLength=0; |
|
const char* ns=classPath.getNameSpace_l(nsLength); |
|
|
|
appendNameSpacePathElement(out,hostname,hostnameLength,ns,nsLength); |
|
|
|
Uint64 classNameLength=0; |
|
const char* className = classPath.getClassName_l(classNameLength); |
|
|
|
appendClassNameElement(out, className, classNameLength-1); |
|
out << STRLIT("</CLASSPATH>\n"); |
|
} |
|
|
void SCMOXmlWriter::appendSCMBUnion( | void SCMOXmlWriter::appendSCMBUnion( |
Buffer& out, | Buffer& out, |
const SCMBUnion & u, | const SCMBUnion & u, |