BOTypeMetadata

Questa interfaccia fornisce la possibilità di effettuare un'annotazione blob conforme al modello BOTypeMetadata e la trasforma in una serie di SDO (service data object) (ed esegue la trasformazione prenotata).

Scopo

Le annotazioni possono essere lette al runtime utilizzando la serie di API specifici dell'implementazione SDO. Tuttavia, il problema con tali API è che restituiscono un blob. Pertanto, business object framework fornisce BOTypeMetadata per leggere il blob, convalidarlo e trasformarlo in una struttura utilizzabile di oggetto dati.

Esempio

L'esempio di seguito riportato illustra il modo in cui utilizzare l'interfaccia BOTypeMetadata.

BOFactory factoryService = (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOTypeMetadata typeMetadataService = (BOTypeMetadata) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOTypeMetadata");

DataObject product =
    factoryService.create("http://www.scm.com/ProductTypes",
                          "Product");

// Utilizzare EMF per ottenere il blob dell'annotazione, quindi utilizzare il sevizio BOTypeMetadata
// per convertirlo in un oggetto dati.
String productIDPropertyInfoString = (String) ((EObject)product).
		eClass().getEStructuralFeature("iD").
		getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0").
		getDetails().get("appinfo");
DataObject productIDPropertyInfo = 
		typeMetadataService.transformAnnotationToDataObject
		(productIDPropertyInfoString);

// Leggere ed aggiornare l'annotazione.
// ...

// Utilizzare il servizio BOTypeMetadata per trasformare il grafico dell'oggetto dati di nuovo in
// una stringa, quindi utilizzare EMF per impostare la stringa nello schema XML.
String productIDPropertyInfoString2 =
		typeMetadataService.transformDataObjectToAnnotation
		(productIDPropertyInfo);
((EObject)product).eClass().getEStructuralFeature("iD").
		getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0").
		getDetails().put("appinfo",productIDPropertyInfoString2);
Riferimenti correlati
BOChangeSummary
BOCopy
BODataObject
BOEquality
BOEventSummary
BOFactory
BOType
BOXMLDocument
BOXMLSerializer
Informazioni correlate
API BOTypeMetadata interfaccia

Terms of use |

Last updated: Thu Apr 06 14:28:02 2006

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)