1. デバイス検出

デバイス検出サービスのAPIリファレンス

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Sitecoreデバイス検出モジュールは、次のアセンブリで構成されています。

  • Sitecore.CES.DeviceDetectionには、デバイスの検出を可能にし、デバイスのパラメータに関する情報を提供するAPIが含まれています。

  • Sitecore.CES.DeviceDetection.Rulesデバイス検出ルールで使用される条件が含まれています。

これらのアセンブリを使用すると、次のAPIリファレンスを使用して、Sitecoreソリューションをさらにカスタマイズできます。

Sitecore.CES.DeviceDetection (英語)

この名前空間には、メインのデバイス検出APIクラスが含まれています。

Class name

DeviceInformationProviderBase

Description

これは、デバイス情報プロバイダーの抽象基本クラスです。独自のデバイス情報プロバイダーを実装するには、このクラスから派生する必要があります。

Fields

  • DeviceCache

    デバイスのキャッシュ インスタンスに関する情報が含まれます。

Methods

  • DeviceInformation GetDeviceInformation(string userAgent)

    userAgentのキャッシュからデバイス情報を取得します。キャッシュに必要なデバイス情報が含まれていない場合は、DoGetDeviceInformationメソッドを呼び出し、応答をキャッシュに追加します。

  • DeviceInformation DoGetDeviceInformation(string userAgent)

    ユーザー エージェント文字列に基づいてデバイス情報を取得します。

  • string GetExtendedProperty(string userAgent, string propertyName)

    userAgentのキャッシュからデバイスのプロパティを取得します。キャッシュに必要なデバイス プロパティが含まれていない場合は、DoGetExtendedPropertyメソッドを呼び出し、応答をキャッシュに追加します。

  • string DoGetExtendedProperty(string userAgent,string propertyName)

    デバイス データベースからデバイス プロパティを取得します (このプロパティがDeviceInformationクラスの一部でない場合)。

Properties

  • boolIsEnabled

    プロバイダーが有効で使用可能かどうかを判断します。プロバイダーを無効にできる場合 (たとえば、既定のプロバイダーへのサブスクリプションが必要な場合) は、このプロパティをオーバーライドします。

  • boolIsInitialized

    プロバイダーが初期化されているかどうかを判断します。プロバイダーを非同期的に初期化でき、initializeメソッドが初期化プロセスのみを開始する場合は、このプロパティをオーバーライドします。

Class name

DeviceDetectionManager

Description

これは、ユーザーエージェント文字列に基づいてデバイス情報を解決する静的クラスです。

Methods

  • DeviceInformation GetDeviceInformation(string userAgent)

    ユーザー エージェント文字列に基づいてデバイス情報を取得します。

  • string GetExtendedProperty(string userAgent, string propertyName)

    拡張プロパティがDeviceInformationに見つからない場合に、デバイス データベースから拡張プロパティを取得します。

  • boolCheckInitialization(TimeSpan timeout)

    プロバイダーの初期化を試み、プロバイダーが初期化されるか、タイムアウトの期限が切れるまで待機します。このメソッドは、プロバイダが初期化されている場合はtrueを返し、そうでない場合はfalseを返します

  • boolCheckInitialization()

    プロバイダーの初期化を試み、プロバイダーが初期化されるか、既定のタイムアウトが期限切れになるまで待機します。 DeviceDetection.CheckInitializationTimeoutを参照してください。このメソッドは、プロバイダが初期化されるとtrueを返し、それ以外の場合はfalseを返します。

Properties

  • boolIsEnabled

    デバイス検出サービスとプロバイダーが構成で有効になっているかどうかを示します。このプロパティは、有効なライセンスがあり、設定ファイルにDeviceDetectionEnabled = trueがある場合に当てはまります。

  • boolIsReady

    デバイスの検出が有効になっているかどうか、およびプロバイダーが初期化されていることを示す値を取得します。

Class name

DeviceInformation

Description

このクラスには、デバイスに関する基本情報が含まれています。

Properties

  • Browser

    ブラウザの名前とバージョンが含まれます。

  • BrowserCanJavaScript

    ブラウザがJavaScriptをサポートするかどうかを指定します。

  • BrowserHtml5AudioCanAudio

    ブラウザーがHTML5オーディオをサポートするかどうかを指定します。

  • BrowserHtml5VideoCanVideo

    ブラウザがHTML5ビデオをサポートするかどうかを指定します。

  • CanTouchScreen

    ブラウザーとデバイスでタッチ スクリーンが有効になっているかどうかを指定します。

  • DeviceIsSmartphone

    デバイスがスマートフォンかどうかを指定します。

  • DeviceModelName

    デバイスのモデル名を指定します。

  • DeviceOperatingSystemModel

    デバイスのオペレーティング システムのモデルを指定します。

  • DeviceOperatingSystemVendor

    デバイスのオペレーティング システムのベンダーを指定します。

  • DeviceType

    デバイスのタイプを指定します。

  • DeviceVendor

    デバイスのベンダーを指定します。

  • HardwareDisplayHeight

    デバイスのディスプレイの高さを指定します。

  • HardwareDisplayWidth

    デバイスの表示幅を指定します。

Enumeration name

DeviceType

Description

この列挙体は、デバイスの種類を表します。

Members

  • Other

  • MobilePhone

  • MobileConsole

  • EReader

  • Tablet

  • MediaPlayer

  • SettopBox

  • Camera

  • Bot

  • WearableComputer

  • Computer

Sitecore.CES.DeviceDetection.Cache

この名前空間にはthe Device Detectionキャッシュ・クラスが含まれています。

メモ

キャッシュ名は DeviceDetection

Class name

DeviceDetectionCache

Description

このクラスは、デバイス情報と拡張プロパティのキャッシュを実装します。

Methods

  • DeviceInformationGetDeviceInformation(string userAgent)

    キャッシュからデバイス情報を取得する

  • string GetExtendedProperty(string userAgent, string propertyName)

    キャッシュから拡張プロパティを取得します

  • AddDeviceInformation(string userAgent and DeviceInformation deviceInfo)

    キャッシュにデバイス情報を追加します

  • AddExtendedProperty(string userAgentand string propertyNameand string value)

    拡張プロパティをキャッシュに追加します

Sitecore.CES.DeviceDetection.Configuration (英語)

この名前空間には、デバイス検出モジュールの設定へのアクセスを提供するクラスが含まれています。

Class name

DeviceDetectionSettings

Description

このクラスは、デバイス検出モジュールの設定へのアクセスを提供します。

Properties

  • Enabled

    デバイス検出モジュールを有効にするかどうかを指定します。

  • DatabaseUpdateCheckInterval

    データベース更新チェックを実行する頻度を指定します。

  • FailDatabaseCheckInterval

    初期化が失敗した場合にデータベースが再初期化を試行する頻度を指定します。

  • DeviceDetectionCacheSize

    デバイス検出のキャッシュ・サイズを指定します。

  • DeviceDetectionServiceName

    デバイス検出サービスの名前を指定します。

  • DatabasePath

    デバイス・データベースが保管されるパスを指定します。

Sitecore.CES.DeviceDetection.Data (英語)

この名前空間には、Sitecoreクラウド サービスと通信するためのクラスが含まれています。

Class name

KeyInfo

Description

このクラスは、デバイス検出データベースの復号化キーに関する情報を指定します。

Properties

  • Key

    復号化キーを指定します。

  • RecommendedCacheTimeSpan

    将来のキャッシュ期間に関する推奨事項を作成します。

Class name

UpdateInfo

Description

このクラスには、データベースの更新に関する情報が含まれています。

Properties

  • DatabaseLink

    暗号化されたデータベース・ファイルのリンクを指定します。

  • DatabaseVersion

    データベースのバージョンを指定します

Sitecore.CES.DeviceDetection.Diagnostics.PerformanceCounters (英語)

この名前空間には、Device Detectionパフォーマンス カウンター クラスが含まれています。

Class name

DeviceDetectionCount

Description

これは、デバイス検出パフォーマンス カウンターへのアクセスを提供する静的クラスです。

Properties

  • RequestsTotal

    デバイス情報に対する要求の総数をカウントします

  • CacheHits

    キャッシュ・ヒットの数をカウントします

  • CacheMisses

    キャッシュミスの数をカウントします

  • AverageResolveTime

    データベースへの要求の解決に要する平均時間をカウントします。

Sitecore.CES.DeviceDetection.Diagnostics.Exceptions (英語)

この名前空間には、Device Detection例外クラスが含まれています。

Class name

DeviceDetectionException

Description

このクラスは、デバイス検出の例外を表します。APIは、デバイス検出サービスのサブスクリプションがない場合、またはプロバイダーが初期化されていないか無効になっている場合に、この例外をスローします。

Sitecore.CES.DeviceDetection.Providers.FiftyOneDegrees (英語)

この名前空間は、既定のプロバイダーを実装します。

Class name

DeviceInformationProvider51Degrees

Description

このクラスはDeviceInformationProviderBaseを実装し、データベースが更新されるようにします。

Methods

  • DeviceInformation GetDeviceInformation(string userAgent)

    ライセンスを確認し、基本クラスからGetDeviceInformationメソッドを呼び出します

  • DeviceInformation DoGetDeviceInformation(string userAgent)

    データベースからのユーザー エージェント文字列に基づいて、デバイスの情報を取得します。

  • string GetExtendedProperty(string userAgent, string propertyName)

    ライセンスを確認し、基本クラスからGetExtendedPropertyメソッドを呼び出します

  • string DoGetExtendedProperty(string userAgent, string propertyName)

    デバイス データベースからデバイス プロパティを取得します (デバイス プロパティが DeviceInformation

  • Initialize(string name, NameValueCollection config)

    プロバイダーを初期化し、更新監視を開始します

Sitecore.CES.DeviceDetection.Rules (英語)

この名前空間には、条件クラスのヘルパー インターフェイスが含まれています。

Class name

IRuleDeviceInformationManager

Description

このインターフェイスは、ルールのデバイス情報を取得するために使用されます。

Methods

  • DeviceInformation GetDeviceInformation(RuleContext ruleContext)

    コンテキストからデバイス情報を取得します。

  • string GetExtendedProperty( RuleContext ruleContext, string propertyName)

    コンテキストから拡張プロパティを取得します。

Sitecore.CES.DeviceDetection.Rules.Conditions (英語)

この名前空間には、条件クラスが含まれています。

Class name

DeviceBoolConditionBase

Description

これは、ブール条件を使用してルールを作成するための抽象クラスです。

Methods

  • boolExecute(T ruleContext)

    RuleDeviceInformationManagerからデバイスに関する情報を取得し、GetDevicePropertyメソッドを呼び出します

  • boolGetDeviceProperty(DeviceInformation deviceInformation)

    デバイスのブール型プロパティを取得します

Class name

DeviceBrowserCanJavaScriptCondition

Description

このクラスは、ブラウザがJavaScriptを実行できるかどうかをチェックするルールを実装します。

Method

  • boolGetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からBrowserCanJavaScriptプロパティを返します。

Class name

DeviceBrowserCondition

Description

このクラスは、ブラウザの名前とバージョンが条件を満たすかどうかを指定するルールを実装します。

Method

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からBrowserプロパティを返します。

Class name

DeviceBrowserHtml5AudioCanAudioCondition

Description

このクラスは、ブラウザがHTML5オーディオを再生できるかどうかを定義するルールを実装します。

Method

  • boolGetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からBrowserHtml5AudioCanAudioプロパティを返します。

Class name

DeviceBrowserHtml5VideoCanVideoCondition

Description

このクラスは、ブラウザがHTML5ビデオを再生できるかどうかを定義するルールを実装します。

Method

  • boolGetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からBrowserHtml5VideoCanVideoプロパティを返します。

Class name

DeviceCanTouchScreenCondition

Description

このクラスは、デバイスとブラウザがタッチスクリーンをサポートするかどうかを定義するルールを実装します。

Method

  • boolGetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からCanTouchScreenプロパティを返します。

Class name

DeviceModelNameCondition

Description

このクラスは、ブラウザのモデル名が条件を満たすかどうかを定義するルールを実装します。

Method

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からDeviceModelNameプロパティを返します。

Class name

DeviceHardwareDisplayHeightCondition

Description

このクラスは、デバイスの高さが条件を満たすかどうかを定義するルールを実装します。

Method

  • int GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からHardwareDisplayHeightプロパティを返します。

Class name

DeviceHardwareDisplayWidthCondition

Description

このクラスは、デバイスの幅が条件を満たすかどうかを定義するルールを実装します。

Method

  • int GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からHardwareDisplayWidthプロパティを返します。

Class name

DeviceIntegerConditionBase

Description

これは、整数条件を持つルールを作成するための抽象クラスです。

Method

  • boolExecute(T ruleContext)

    RuleDeviceInformationManagerからデバイスに関する情報を取得し、GetDevicePropertyメソッドを呼び出します。

  • int GetDeviceProperty(DeviceInformation deviceInformation)

    デバイスのIntegerプロパティを取得します。

Class name

DeviceOperatingSystemModelCondition

Description

このクラスは、デバイスのオペレーティング システム モデルが条件を満たすかどうかを定義するルールを実装します。

Method

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からDeviceModelNameプロパティを返します。

Class name

DeviceOperatingSystemVendorCondition

Description

このクラスは、オペレーティングシステムのベンダーが条件を満たすかどうかを定義するルールを実装します。

Method

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    デバイス情報 からDeviceOperatingSystemVendorプロパティを返します。

Class name

DevicePropertyCondition

Description

このクラスは、拡張プロパティが条件を満たすかどうかを定義するルールを実装します。

Method

  • boolExecute(T ruleContext)

    RuleDeviceInformationManagerから拡張プロパティを取得し、それを条件の値と比較します。

Properties

  • Value

    条件の値

  • PropertyName

    拡張プロパティの名前。

Class name

DeviceStringConditionBase

Description

これは、String条件を使用してルールを作成するために使用する抽象クラスです。

Method

  • boolExecute(T ruleContext)

    RuleDeviceInformationManagerからデバイス情報を取得し、GetDevicePropertyメソッドを呼び出します。

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    デバイスの文字列プロパティを取得します。

Properties

  • Value

    条件の値。

Class name

DeviceTypeCondition

Description

このクラスは、デバイスの種類が条件を満たしているかどうかを確認するルールを実装します。

Method

  • boolExecute(T ruleContext)

    RuleDeviceInformationManagerからデバイスに関する情報を取得し、それを条件値と比較します。

Properties

  • Value

    条件の値。

Class name

DeviceVendorCondition

Description

このクラスは、デバイス ベンダーが条件を満たしているかどうかを定義するルールを実装します。

Method

  • string GetDeviceProperty(DeviceInformation deviceInformation)

    DeviceVendorプロパティをDevice Information

Class name

DeviceTypeIds

Description

このクラスには、デバイスの種類に対応する項目IDが含まれています。

Constants

  • MobilePhone

  • FeaturePhone

  • Smartphone

  • MobileConsole

  • EReader

  • Tablet

  • MediaPlayer

  • SettopBox

  • Camera

  • Bot

  • WearableComputer

  • Computer

  • Other

この記事を改善するための提案がある場合は、 お知らせください!