<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFCOMPONENT</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFCOMPONENT</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
コンポーネントオブジェクトを作成および定義します。また、CFML で構築し、cffunction タグ内に囲んだ機能を囲みます。このタグ内には、メソッドを定義している複数の cffunction タグを指定できます。このタグの本文内に指定された cffunction タグ以外のコードは、コンポーネントのインスタンスを作成するときに実行されます。
</p>

<p>
コンポーネントファイルには CFC という拡張子が付けられ、アプリケーションの任意のディレクトリに保管されます。
</p>

<p>
コンポーネントメソッドは、次の方法で呼び出されます。
</p>
<ul>

<li>ColdFusion ページの cfinvoke タグ内で</li>

<li>CFC ファイルを呼び出す URL 内でメソッド名を URL パラメータとして渡す</li>

<li>cfscript タグ内で</li>

<li>Web サービスとして</li>

<li>Flash コードから</li>
</ul>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">カテゴリ</span>
<p>
拡張タグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfcomponent
   extends =&quot;anotherComponent&quot;
   output = &quot;yes&quot;、&quot;no&quot;
   style = &quot;rpc&quot;、&quot;document&quot;
   namespace = &quot;default service namespace&quot;
   serviceportname = &quot;port element name&quot;
   porttypename = &quot;porttype element name&quot;
   bindingname = &quot;binding element name&quot;
   wsdlfile = &quot;path to hard-coded wsdl file&quot;
   displayname = &quot;text string&quot;&gt;
   hint = &quot;text string&quot;&gt;
   variable declarations
   &lt;cffunction ...&gt;
      ...
   &lt;/cffunction&gt; 

   &lt;cffunction ...&gt;
      ...
   &lt;/cffunction&gt; 
&lt;/cfcomponent&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfargument、cffunction、cfinvoke、cfinvokeargument、cfobject、cfproperty、cfreturn、『ColdFusion MX 開発ガイド』の第10章の「ColdFusion コンポーネントの作成と使用」 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">ヒストリ</span>
<p>
ColdFusion&#160;MX&#160;7:
</p>
<ul>

<li>ドキュメントリテラルスタイルの Web サービスを発行できるようになりました。</li>

<li>style、namespace、serviceportname、porttypename、wsdlfile、および bindingname の各属性が追加されました。</li>

<li>ドキュメントリテラルスタイルの Web サービス発行時の hint 属性と displayname 属性の機能が拡張されました。</li>
</ul>

<p>
ColdFusion&#160;MX: このタグが追加されました。
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
extends 属性を指定した場合は、親コンポーネントのデータとメソッドを、現在のコンポーネントの一部であるかのように CFC メソッドに使用できます。たとえば managerCFC コンポーネントが employeeCFC コンポーネントを拡張していて、employeeCFC コンポーネントが getEmployeeName メソッドを備えている場合は、次のようにして managerCFC からこのメソッドを呼び出すことができます。
</p>
<pre>&lt;cfinvoke component=&quot;managerCFC&quot; method=&quot;getEmployeeName&quot; returnVariable=&quot;managerName&quot; 
EmployeeID=#EmpID#&gt;
</pre>
<p>
このタグには終了タグが必要です。
</p>

<p>
style=&quot;document&quot; を指定した場合、ColdFusion&#160;MX は CFC をドキュメントリテラルスタイルの Web サービスとして発行します。詳細については、『ColdFusion MX 開発ガイド』の第36章の「Web サービスの使用」 の「ドキュメント-リテラルスタイルの Web サービスの公開」を参照してください。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span><pre>&lt;cfcomponent&gt;
   &lt;cffunction name=&quot;getEmp&quot;&gt;
       &lt;cfquery name=&quot;empQuery&quot; datasource=&quot;cfdocexamples&quot; &gt;
          SELECT FIRSTNAME, LASTNAME, EMAIL
          FROM tblEmployees
       &lt;/cfquery&gt;
       &lt;cfreturn empQuery&gt;
   &lt;/cffunction&gt;

   &lt;cffunction name=&quot;getDept&quot;&gt;
      &lt;cfquery name=&quot;deptQuery&quot; datasource=&quot;cfdocexamples&quot; &gt;
          SELECT *
          FROM tblDepartments
       &lt;/cfquery&gt;
       &lt;cfreturn deptQuery&gt;
   &lt;/cffunction&gt;
&lt;/cfcomponent&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="EXTENDS">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">EXTENDS</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>メソッドとプロパティを継承する親コンポーネントの名前です。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="OUTPUT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">OUTPUT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "コンポーネント本体の表示可能テキストを標準 CFML として処理します。"


<p>コンポーネント内のコンストラクタコードが HTML 出力を生成できるかどうかを指定します。そのコンポーネント内にある cffunction タグ本文の中の出力には影響しません。</p><ul>

<li>yes: コンストラクタコードは cfoutput タグ内にある場合と同様に処理されます。シャープ記号 (#) で囲まれた変数名は、自動的に実際の値に置き換えられます。</li>

<li>no: コンストラクタコードは cfsilent タグ内にある場合と同様に処理されます。</li>

<li>この属性を指定しない場合、コンストラクタコードは標準 CFML として処理されます。すべての変数は cfoutput タグ内に置く必要があります。</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="STYLE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">STYLE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "rpc"


<p>Web サービスに使われる CFC で RPC エンコードスタイルまたはドキュメントリテラルスタイルを使用するかどうかを指定します。</p><ul>

<li>rpc: RPC エンコードスタイルを使用します。</li>

<li>document: ドキュメントリテラルスタイルを使用します。</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="NAMESPACE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">NAMESPACE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "classname"


<p>CFC をドキュメントリテラルスタイルの Web サービスとして使用するときに WSDL で使われるネーム空間を指定します。この属性を指定しない場合、ColdFusion&#160;MX はこの値を CFC クラス名から取得します。</p>
<p>&#160;</p>
<p>この属性は、style=&quot;document&quot; の場合にのみ適用されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="SERVICEPORTNAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">SERVICEPORTNAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>WSDL の port 要素の name 属性を指定します。この属性を指定しない場合、ColdFusion&#160;MX はこの値を CFC クラス名から取得します。</p>
<p>&#160;</p>
<p>この属性は、style=&quot;document&quot; の場合にのみ適用されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PORTTYPENAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PORTTYPENAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>WSDL の porttype 要素の name 属性を指定します。この属性を指定しない場合、ColdFusion&#160;MX はこの値を CFC クラス名から取得します。</p>
<p>&#160;</p>
<p>この属性は、style=&quot;document&quot; の場合にのみ適用されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="BINDINGNAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">BINDINGNAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>WSDL の port 要素の binding 属性を指定します。この属性を指定しない場合、ColdFusion&#160;MX はこの値を CFC クラス名から取得します。</p>
<p>&#160;</p>
<p>この属性は、style=&quot;document&quot; の場合にのみ適用されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="WSDLFILE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">WSDLFILE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ColdFusion&#160;MX で生成された WSDL の代わりに使用する、正しい形式の WSDL です。</p>
<p>&#160;</p>
<p>この属性は、style=&quot;document&quot; の場合にのみ適用されます。</p>

  </td>
  </tr>
  </table>
</div>
<div id="DISPLAYNAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DISPLAYNAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>イントロスペクションを使用して CFC についての情報を示すときに表示される文字列です。この情報は、コンポーネント名に続けて見出しの上に表示されます。</p>
<p>&#160;</p>
<p>style 属性をドキュメントに対して設定した場合、ColdFusion&#160;MX は WSDL の service 要素の name 属性として、displayname 属性を使用します。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="HINT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">HINT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>イントロスペクションを使用して CFC についての情報を示すときに表示されるテキストです。hint 属性の値は、コンポーネント名の見出しの下に表示されます。この属性は、パラメータの目的を説明するのに役立ちます。</p>
<p>&#160;</p>
<p>style 属性をドキュメントに対して設定した場合、ColdFusion&#160;MX は WSDL の documentation 要素のコンテンツとして hint 属性を使用します。</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
