XSLT2UDDI  目次

Oracle Service RegistryのXSLT2UDDIデモ・セットでは、Oracle Service RegistryのApplication Programming Interface(API)の機能のデモンストレーションを行い、XSLT2UDDI APIを使用してXSLT文書を操作する方法を示します。

このデモ・セットに含まれるデモは次のとおりです。

前提条件および準備手順: コード  目次

Oracle Service Registryがすでにインストールされ、環境変数REGISTRY_HOMEにレジストリのインストール場所が設定されていることを想定しています。

Oracle Service Registryのデモを実行するには、レジストリが実行中である必要があります。

デモを構成する必要があります。構成システムには、グローバルとローカルの2つのレベルがあります。グローバル・レベルで定義されたプロパティは、ローカル・レベルで上書きできます。グローバル・プロパティは、次のファイルにあります。

Windows: %REGISTRY_HOME%¥demos¥env.properties
UNIX: $REGISTRY_HOME/demos/env.properties

Oracle Service Registryのインストール中に設定された値はそのまま使用でき、値の変更はすべてのデモに影響を与えます。単一のデモについて(つまりローカル・レベルで)一部のプロパティの値を再定義する必要がある場合は、env.propertiesを編集してください。このファイルは、ファイルrun.shrun.bat)と同じディレクトリにあります。XSLT2UDDIデモのローカル・レベルのプロパティは、次のファイルからロードされます。

Windows: %REGISTRY_HOME%¥demos¥resources¥xslt¥env.properties
UNIX: $REGISTRY_HOME/demos/resources/xslt/env.properties

表20 デモで使用されるプロパティ

名前デフォルト値説明
uddi.demos.user.john.namedemo_john1人目のユーザーの名前
uddi.demos.user.john.passworddemo_john1人目のユーザーのパスワード
uddi.demos.url.xslt2uddihttp://localhost:8888/registry/uddi/xslt2uddixslt2uddi Webサービス・ポートのURL
uddi.demos.url.securityhttp://localhost:8888/registry/uddi/securityセキュリティWebサービス・ポートのURL

プレゼンテーションおよび機能プレゼンテーション  目次

この項では、すべてのデモで使用されるプログラミング・パターンを、PublishXsltデモを例にして説明します。ソース・コードは次のファイルにあります。

Windows: %REGISTRY_HOME%¥demos¥resources¥xslt¥src¥demo¥uddi¥xslt¥PublishXslt.java
UNIX: $REGISTRY_HOME/demos/resources/xslt/src/demo/uddi/xslt/PublishXslt.java

ヘルパー・メソッドcreatePublishXsltによって、次のようにPublish_xslt構造が作成されます。


public Publish_xslt createPublishXslt(String location, String publishingMethod, String importMethod, String schemaMethod, String authInfo) throws InvalidParameterException {
        System.out.println("location = " + location);

        Publish_xslt publish = new Publish_xslt();
        publish.setLocation(location);
        publish.setPublishingMethod(PublishingMethod.getPublishingMethod(publishingMethod));
        publish.setImportMethod(RefPublishingMethod.getRefPublishingMethod(importMethod));
        publish.setSchemaMethod(RefPublishingMethod.getRefPublishingMethod(schemaMethod));
        publish.setAuthInfo(authInfo);

        return publish;
}
            

publishXsltResourceメソッドによって、次のように公開操作が実行されます。


public XsltMapping publishXsltResource(Publish_xslt publish) throws UDDIException, SOAPException {
        System.out.print("Check structure validity .. ");
        try {
            publish.check();
        } catch (InvalidParameterException e) {
            System.out.println("Failed!");
            throw new UDDIException(e);
        }
        System.out.println("OK");

        Xslt2uddiApi xsltApi = getXslt2UddiStub();
        System.out.print("Publishing in progress ...");
        XsltMapping xsltMapping = xsltApi.publish_xslt(publish);
        System.out.println(" done");
        return xsltMapping;
}
            

デモのビルドと実行  目次

この項では、Oracle Service RegistryのXSLT2UDDIデモ・セットをビルドして実行する方法を示します。引き続きPublishXsltデモを使用します。

  1. デモが適切に構成され、Oracle Service Registryが実行中であることを確認してください。

  2. 次のディレクトリに移動します。

    Windows %REGISTRY_HOME%¥demos¥resources¥xslt
    UNIX $REGISTRY_HOME/demos/resources/xslt

  3. 次のコマンドを使用して、すべてのデモをビルドします。

    Windows: run.bat make
    UNIX: ./run.sh make

    注意注意

    Windowsプラットフォームでデモをコンパイルすると、次のテキストが表示されることがあります。

    A subdirectory or file ..\..\common\.\build\classes already exists.

    これは予想される現象であり、問題を示すものではありません。

  4. 利用可能なすべてのデモのリストを表示するには、次のコマンドを実行します。

    Windows: run.bat help
    UNIX: ./run.sh help

  5. 選択したデモを実行するには、runコマンドのパラメータにデモの名前を指定して実行します。 たとえば、PublishXsltデモを実行するには、次のように起動します。

    Windows: run.bat PublishXslt
    UNIX: ./run.sh PublishXslt

    このデモの出力は次のようになります。

    
    Publishing XSLT with the following parameters:
    Enter XSLT location (URI) [http://localhost:8888/rgistry/uddi/doc/demos/employeesToDepartments.xsl]:
    Enter publishing method (update,create) [update]:
    Enter import publishing method (reuse,create,ignore) [reuse]:
    Enter schema publishing method (reuse,create,ignore) [reuse]:
    
    Using Security at url https://localhost:8443/registry/uddi/security ..
     done
    Logging in .. done
    location = http://localhost:8888/registry/uddi/doc/demos/employeesToDepartments.xsl
    Check structure validity .. OK
    Using XSLT2UDDI at url https://localhost:8443/registry/uddi/xslt2uddi .. done
    Publishing in progress ... done
    
    XSL transformation http://localhost:8888/registry/uddi/doc/demos/employeesToDepartments.xsl
    <xsltMapping xmlns="http://systinet.com/uddi/xslt2uddi/v3/5.5">
      <name xmlns="urn:uddi-org:api_v3">employeesToDepartments.xsl</name>
      <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xslt:employeesToDepartments</tModelKey>
      <location>http://localhost:8888/registry/uddi/doc/demos/employeesToDepartments.xsl</location>
      <contentMapping>
        <inputSchemaList>
          <xmlSchema>
            <namespace>http://systinet.com/uddi/demo/employeeList</namespace>
            <location>http://localhost:8888/registry/uddi/doc/demos/employees.xsd</location>
            <tModelRef>
              <name xmlns="urn:uddi-org:api_v3">employees.xsd</name>
              <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xsd:employees</tModelKey>
            </tModelRef>
          </xmlSchema>
        </inputSchemaList>
        <outputTypeList>
          <outputType>
            <xmlSchema>
              <namespace>http://systinet.com/uddi/demo/companyDepartments</namespace>
              <location>http://localhost:8888/registry/uddi/doc/demos/departments.xsd</location>
              <tModelRef>
                <name xmlns="urn:uddi-org:api_v3">departments.xsd</name>
                <tModelKey xmlns="urn:uddi-org:api_v3">uddi:systinet.com:demo:xsd:departments</tModelKey>
              </tModelRef>
            </xmlSchema>
          </outputType>
        </outputTypeList>
        <outputMethod>xml</outputMethod>
      </contentMapping>
    </xsltMapping>
    Logging out .. done