資料專案

存放區會使用與下列範例類似的資料樹狀結構:

{
   "latitude":"37.331375",
   "longitude":"-121.893992"
}
NOTE
Chrome 50.x匯入的安全性原則要求所有與地理位置相關的呼叫都必須透過安全連線進行。 因此,如果AEM也透過https執行,AEM會強制使用https進行地理位置API呼叫。 否則,會使用http來遵守相同來源的原則。
如需Chrome變更的詳細資訊,請參閱此Google部落格

contexthub.surferinfo範例存放區候選專案

儲存有關目前使用者端環境的資訊,例如裝置、視窗、瀏覽器、日期和時間。

Source位置

/libs/settings/cloudsettings/legacy/contexthub/surferinfo

基礎實作

contexthub.surferinfo存放區候選專案延伸ContextHub.Store.PersistedStore

設定

預設設定繼承自ContextHub.Store.PersistedStore

資料專案

使用此候選存放區的存放區具有類似於以下範例的資料樹狀結構:

{
   "display":{
      "resolution":{
         "width":1440,
         "height":900
      },
      "devicePixelRatio":1,
      "colorDepth":24,
      "nrOfColors":16777216,
      "pixelsPerInch":96,
      "orientation":{
         "mode":"landscape",
         "direction":"normal"
      }
   },
   "window":{
      "dimension":{
         "width":1395,
         "height":652
      },
      "percentageUsage":0.7
   },
   "browser":{
      "version":"39.0",
      "family":"Firefox",
      "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:39.0) Gecko/20100101 Firefox/39.0"
   },
   "device":{
      "category":"Desktop",
      "type":"Desktop",
      "model":"PC",
      "version":""
   },
   "isMobile":true,
   "os":{
      "name":"Mac OS X",
      "version":"10"
   },
   "year":2015,
   "month":7,
   "day":22,
   "hour":14,
   "minutes":1
}

granite.emulators範例存放區候選專案

granite.emulators範例存放區候選專案儲存有關使用者端裝置的資訊。

Source位置

/libs/settings/cloudsettings/legacy/contexthub/emulators

基礎實作

granite.emulators存放區候選專案延伸ContextHub.Store.PersistedStore

設定

預設組態包含名為defaultEmulators的陣列,其中包含不同裝置的相關資訊。 建立存放區時,請視需要在「詳細資料組態」屬性中提供不同的裝置設定檔,格式如下例所示:

{
   "defaultEmulators":[
        {
            "id": "iphone-6",
            "title": "iPhone 6",
            "type": "mobile",
            "platform": "iOS",
            "platformVersion": "8.1.3",
            "width": 750,
            "height": 1334,
            "canRotate": true,
            "orientation": "Portrait",
            "device-pixel-ratio": 2
        },
        {
            "id": "iphone-6-plus",
            "title": "iPhone 6 Plus",
            "type": "mobile",
            "platform": "iOS",
            "platformVersion": "8.1.3",
            "width": 1080,
            "height": 1920,
            "canRotate": true,
            "orientation": "Portrait",
            "device-pixel-ratio": 3
        },
        {
            "id": "galaxy-s4",
            "title": "Samsung Galaxy S4",
            "type": "mobile",
            "platform": "Android",
            "platformVersion": "4.4.2 KitKat",
            "width": 1080,
            "height": 1920,
            "canRotate": true,
            "orientation": "Portrait",
            "device-pixel-ratio": 3
        }
    ]
}

資料專案

存放區資料樹狀結構類似於以下範例:

{
   "devices":[
      {"id":"native",
      "title":"Native",
      "type":"screen",
      "width":1395,
      "height":374,
      "orientation":"Landscape",
      "platform":"Mac OS X",
      "platformVersion":"10",
      "canRotate":false
      },
      {"id":"ipad-3",
      "title":"iPad 3 / 4 / Air",
      "type":"tablet",
      "platform":"iOS",
      "platformVersion":"8.1.3",
      "width":1536,
      "height":2048,
      "canRotate":true,
      "orientation":"Portrait",
      "device-pixel-ratio":2
      },
      {"id":"iphone-6",
      "title":"iPhone 6",
      "type":"mobile",
      "platform":"iOS",
      "platformVersion":"8.1.3",
      "width":750,
      "height":1334,
      "canRotate":true,
      "orientation":"Portrait",
      "device-pixel-ratio":2
      },
      {"id":"galaxy-s4",
      "title":"Samsung Galaxy S4",
      "type":"mobile",
      "platform":"Android",
      "platformVersion":"4.4.2 KitKat",
      "width":1080,
      "height":1920,
      "canRotate":true,
      "orientation":"Portrait",
      "device-pixel-ratio":3
      }
   ],
   "currentDeviceId":"native",
   "orientations":[
      {"id":"landscape",
      "title":"Landscape"
      },
      {"id":"portrait",
       "title":"Portrait"
      }
   ],
   "currentDevice":{
      "id":"native",
      "title":"Native",
      "type":"screen",
      "width":1395,
      "height":374,
      "orientation":"Landscape",
      "platform":"Mac OS X",
      "platformVersion":"10",
      "canRotate":false
   }
}