기술자료
DBMS, DB 구축 절차, 빅데이터 기술 칼럼, 사례연구 및 세미나 자료를 소개합니다.
Rational Application Developer와 WebSphere Application Server를 사용하여 연재 기사의 다섯 번째 기사에서는 IBM Rational Application Developer 버전 7.0 이상과 IBM WebSphere Application Server 버전 6.1 이상을 위한 XSD SDO Transform 기능에 대한 업데이트된 정보를 제공합니다. 이 기능은 XML 기반 SOA 애플리케이션의 프리젠테이션 개발 효율성을 높여줍니다. 업데이트된 솔루션 소개 XSD SDO Transform V7 기능 설치 XSD SDO Transform 기능 컨텐츠 샘플 프로젝트 컨텐츠 Create SDO Package 조치를 사용하여 SDO 생성하기 Generate > Java를 사용하여 SDO 생성하기 업데이트된 XMLTransformServiceFactory 업데이트된 XMLTransformService Java 클라이언트로 업데이트 샘플 애플리케이션 실행하기 결론 다운로드 하십시오 필자소개Rational Application Developer와 WebSphere Application Server를 사용하여 XML 기반 SOA를 위한 JSF 개발 시간 단축하기, Part 5::nal Application Devel
XML 기반 SOA를 위한 JSF 개발 시간 단축하기, Part 5::
Rational Application Developer 버전 7.0 업데이트
그림 1. Manage Configuration 명령
그림 2. 기능 설치
참고:-clean 명령행 인수와 함께 Rational Application Developer를 시작하면 기능의 구성 업데이트를 확인할 수 있다.
그림 3. Create SDO Package
그림 4. 가져온 프로젝트 교환
결과적으로 다음과 같은 아티팩트가 생성된다.
그림 6. 생성된 SDO 패키지
그림 7. EAR 프로젝트에 추가된 프레임워크 JAR 파일
그림 8. 업데이트된 J2EE 모듈 종속성
그림 10. SDO Generate 마법사
그림 11. 소스 폴더 선택하기
마법사 작업이 완료되면 SDO Java 패키지가 만들어지고 필수 프레임워크 JARS가 Java 프로젝트의 빌드 및 클래스 경로에 추가된다(그림 12 참조).그림 12. 생성된 패키지
Listing 1. 파일 로드하기
package dw.ibm.etools.xsd.sdo.xmltransformservice;
import java.io.InputStream;
import java.util.Map;
import commonj.sdo.DataGraph;
import commonj.sdo.DataObject;
import dw.ibm.etools.xsd.sdo.xmltransformservice.impl.XMLTransformServiceFactoryImpl;
public abstract class XMLTransformServiceFactory {
/**
* Instance of the factory
*/
static public XMLTransformServiceFactory INSTANCE
= new XMLTransformServiceFactoryImpl();
/**
* @return Returns the xmlFileService to be used for transformation.
*/
public abstract XMLTransformService getXmlFileService() throws Exception;
/**
* @param xmlFileService The xmlFileService to set to be used for transformation.
*/
public abstract void setXmlFileService(XMLTransformService xmlFileService);
/**
* load the XML input stream and return the populated dataobjects
* @param stream the input stream for the XML data
* @return the populated dataobject graph root
*/
public abstract DataObject loadStream(InputStream stream);
/**
* load the XML input stream and return the populated datagraph
* @param stream the input stream for the XML data
* @return the populated dataobject graph root
*/
public abstract DataGraph loadDataGraphStream(InputStream stream);
/**
* load the XML input stream and return the populated dataobjects
* @param String the XML file
* @return the populated dataobject graph root
*/
public abstract DataObject loadFile(String fileName);
/**
* load the XML input stream and return the populated DataGraph
* @param String the XML file
* @return the populated dataobject graph root
*/
public abstract DataGraph loadDataGraphFile(String fileName);
/**
* load the XML data and return the populated dataobjects
* @param String the XML file
* @return the populated dataobject graph root
*/
public abstract DataObject load(String xmlString);
/**
* load the XML data and return the populated DataGraph
* @param String the XML file
* @return the populated dataobject graph root
*/
public abstract DataGraph loadDataGraph(String xmlString);
/**
* Serializes the data object as a file.
* @param DataObject the dataobject to be serialized as the input file
* @param String the output file name
*/
public abstract void saveFile(DataObject dataObject, String fileName);
/**
* Serializes the data object as a file.
* @param DataGraph the DataGraph to be serialized as the input file
* @param String the output file name
*/
public abstract void saveFile(DataGraph dataGraph, String fileName);
/**
* Serializes the data object as a file.
* @param DataObject the dataobject to be serialized as the input file
* @param String the output file name
* @param unSetAllEmptyFeatures unsets all the empty features that are set,
* such that they are not written to the serialized XML
*/
public abstract void saveFile(DataObject dataObject, String fileName
, boolean unSetAllEmptyFeatures);
/**
* Serializes the data object as a string
* @param DataObject the dataobject to be serialized as a string
* @return String the serialized dataobject string
*/
public abstract String convert(DataObject dataObject);
/**
* Serializes the data object as a string
* @param DataGraph the DataGraph to be serialized as a string
* @return String the serialized dataobject string
*/
public abstract String convert(DataGraph dataGraph);
/**
* Unsets all the empty attributes and serializes the data
* object as a string.
* Call this method only when you do not need the empty tags
* for elements or attributes.
* @param DataObject the dataobject to be serialized as a string
* @param unSetAllEmptyFeatures if true, unsets all the empty
* features that are set,
* such that they are not written to the serialized XML
* @return String the serialized dataobject string
*/
public abstract String convert(DataObject dataObject
, boolean unSetAllEmptyFeatures);
/**
* load options for the parser for advanced configuration
* like XMLResource.OPTION_RECORD_UNKNOWN_FEATURE etc.
* @return Map the option map
*/
public abstract Map getOptions();
/**
* Creates a new DataGraph and root DataObject given an XSD uri.
* Returns the root DataObject
* @param targetNamespaceURI is the XSDtarget namespace
* @return DataObject Returns the root DataObject
*/
public abstract DataObject create(String targetNamespaceURI);
/**
* Creates a new DataGraph and root DataObject given an XSD uri.
* Returns the DataGraph
* @param targetNamespaceURI is the XSDtarget namespace
* @return DataGraph Returns the DataGraph
*/
public abstract DataGraph createDataGraph(String targetNamespaceURI);
/**
* load the XML input stream and return the populated dataobjects
* @param String the XML file
* @param the class that is used to get the classloader
* context to load the file
* @return the populated dataobject graph root
*/
public abstract DataObject loadFileUsingClassLoader
(String qualifiedName, Class clazz);
/**
* load the file from explicit path
* @param fileName
* @return
*/
public abstract DataObject loadFileExplicitPath(String fileName);
/**
* Serializes this data object as a string
* @param DataObject the dataobject to be serialized as a string
* @return String the serialized dataobject string
*/
public abstract String convertThis(DataObject dataObject);
}
package dw.ibm.etools.xsd.sdo.xmltransformservice;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import commonj.sdo.DataGraph;
import commonj.sdo.DataObject;
public interface XMLTransformService
{
/**
* Creates a new DataGraph and root DataObject given an XSD uri.
* Returns the root DataObject
* @param targetNamespaceURI is the XSDtarget namespace
* @return DataGraph the new DataGraph
*/
DataObject create(String targetNamespaceURI);
/**
* Creates a new DataGraph given an XSD uri.
* Returns the DataGraph
* @param targetNamespaceURI is the XSDtarget namespace
* @return DataGraph the new DataGraph
*/
DataGraph createDataGraph(String targetNamespaceURI);
/**
* Creates and returns a DataGraph with the data loaded from the input file.
* @param uri input file name
* @return the new root DataObject loaded
*/
DataObject load(String uri) throws IOException;
/**
* Creates and returns a DataGraph with the data loaded from the input file.
* @param uri input file name
* @return the new DataGraph loaded
*/
DataGraph loadDataGraph(String uri) throws IOException;
/**
* Creates and returns a DataGraph with the data read from the input stream.
* @param inputStream specifies the input stream to read from
* @return the new root DataObject loaded
*/
DataObject load(InputStream inputStream) throws IOException;
/**
* Creates and returns a DataGraph with the data read from the input stream.
* @param inputStream specifies the input stream to read from
* @return the new DataGraph loaded
*/
DataGraph loadDataGraph(InputStream inputStream) throws IOException;
/**
* Serializes a DataObject into the specified file
* @param dataObject specifies DataObject to be saved
* @param uri specifies the URI to be used
*/
void save(DataObject dataObject, String uri) throws IOException;
/**
* Serializes a DataGraph into the specified file
* @param DataGraph specifies DataGraph to be saved
* @param uri specifies the URI to be used
*/
void save(DataGraph dataGraph, String uri) throws IOException;
/**
* Serializes a DataObject into the specified stream
* @param dataObject specifies DataObject to be saved
* @param outputStream specifies the output stream to write to
*/
void save(DataObject dataObject, OutputStream outputStream) throws IOException;
/**
* Serializes a DataGraph into the specified stream
* @param DataGraph specifies DataObject to be saved
* @param outputStream specifies the output stream to write to
*/
void save(DataGraph dataGraph, OutputStream outputStream) throws IOException;
/**
* Serializes this DataObject into the specified stream
* @param dataObject specifies DataObject to be saved
* @param outputStream specifies the output stream to write to
*/
void saveThis(DataObject dataObject, OutputStream outputStream)
throws IOException;
/**
* load options for the parser for advanced configuration
* like XMLResource.OPTION_RECORD_UNKNOWN_FEATURE etc.
* @return Map the option map
*/
public abstract Map getOptions();
}
Resource.Factory.Registry.INSTANCE.
getExtensionToFactoryMap().
put("xsd", new XSDResourceFactoryImpl());
XSD SDO transform feature
xsdsdotransform-feature.zip
1.23MB
HTTP
XYZInsurance complete sample
xsd_sdo_soa_xml_sample.zip
7.19MB
HTTP
XYZInsurance tutorial
xsd_sdo_soa_xml_tutorial.zip
962KB
HTTP
Deployable XYZInsuranceEAR.zip
Part5Rev2.zip
20.4MB
HTTP
Deployable XYZInsuranceEAR.zip
XYZInsuranceEAR.zip
7.17MB
HTTP