Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Object Explorer URL 생성

앱이나 외부 시스템에서 Object Explorer의 특정 객체 유형, 저장한 탐색 또는 필터가 적용된 검색으로 연결할 수 있습니다. 개별 Object View의 URL과 Object Explorer 탐색 URL은 서로 다른 경로를 사용합니다.

키워드만 검색

공백과 특수 문자가 있는 검색어는 URL 구성 요소로 인코딩합니다.

const encodedText = encodeURIComponent("hello world");

다음 경로에 인코딩한 값을 넣습니다. BASEURL은 Foundry의 기본 URL입니다.

<BASEURL>/hubble/external/keyword/v0/<MY_ENCODED_TEXT>

객체 유형과 저장한 자료 열기

객체 유형을 바로 탐색하려면 objectTypeId를 지정합니다. 다음 aircraft는 예시 유형 ID입니다.

/workspace/hubble/exploration?objectTypeId=aircraft

기본 Explore 대신 표 형태의 Results로 열려면 perspectiveId=results를 추가합니다.

/workspace/hubble/exploration?objectTypeId=aircraft&perspectiveId=results

저장한 탐색 또는 객체 집합은 saved 경로로 엽니다. 다른 Foundry 앱에서 만든 객체 집합은 external/objectSet 경로를 사용합니다. 아래 RID는 예시이며 실제 리소스의 RID로 바꿉니다.

/workspace/hubble/exploration/saved/ri.object-set.main.versioned-object-set.4b117663-06d7-4bd1-a2be-8e1ba20998cb
/workspace/hubble/external/objectSet/v0/ri.object-set.main.object-set.f6916120-5b52-4312-8be4-9f5764983907

이 링크도 perspectiveId=results로 결과 표를 지정할 수 있습니다. 쿼리 매개변수가 없으면 ?, 이미 있으면 &로 이어 붙입니다.

복합 필터 구조

필터 JSON에는 전체 키워드, 대상 객체 유형과 개별 속성 또는 링크 필터가 들어갑니다. 다음은 가상의 google-reviews 유형에서 설명, 평점, 작성일과 링크 존재 여부를 지정한 형태 예시입니다.

{
  "keyword": "",
  "objectTypes": ["google-reviews"],
  "filters": [
    {
      "type": "propertyFilter",
      "objectType": "google-reviews",
      "propertyType": "Description",
      "value": {"type": "textFilter", "text": "hello"}
    },
    {
      "type": "propertyFilter",
      "objectType": "google-reviews",
      "propertyType": "rating",
      "value": {"type": "valuesFilter", "values": ["3", "4"]}
    },
    {
      "type": "propertyFilter",
      "objectType": "google-reviews",
      "propertyType": "creation-date",
      "value": {
        "type": "dateRangeFilter",
        "dateRangeFilter": {"start": "2000-01-10", "end": "2000-01-11"}
      }
    },
    {
      "type": "linkFilter",
      "objectType": "google-reviews",
      "linkType": "restaurant-to-review",
      "value": {"type": "presenceFilter", "matchType": "MUST_HAVE"}
    }
  ]
}

실제 필터 형식은 속성의 기본 위젯과 현재 Object Explorer가 생성하는 구조에 맞아야 합니다. 위 형태를 고정 계약으로 복사하지 말고 사용할 화면에서 같은 조건을 만든 뒤 JSON을 얻습니다. 값 선택에는 valuesFilter, 텍스트 입력에는 textFilter 같은 유형을 사용합니다.

추가 필터 유형에는 다음 필드가 있습니다. 각 범위 필드는 선택 항목입니다.

유형필드
numberRangeFilter숫자 min, max
relativeDateFilter숫자 sinceDaysAgo, untilDaysAgo
timestampRangeFilter숫자 startMillis, endMillis
relativeTimestampFilter숫자 sinceMillisAgo, untilMillisAgo

속성 필터는 여러 개 둘 수 있지만 링크 필터는 하나만 지원합니다.

화면에서 필터 JSON 가져오기

  1. Object Explorer에서 실제로 사용할 필터를 예시 값으로 구성합니다.
  2. 결과 개수처럼 Object Explorer가 제공하는 요소를 오른쪽 클릭하여 검사한 뒤 Chrome 개발자 콘솔을 엽니다. 콘솔만 별도로 여는 대신 Object Explorer 요소를 검사해야 합니다.
  3. 콘솔에서 다음 명령으로 현재 검색 JSON을 얻습니다.
const filters = await hubble_get_current_search();

필요한 값만 치환한 뒤 JSON 문자열을 URL 인코딩합니다. 반환값이 이미 JSON 문자열이면 그대로 사용하고, 객체이면 먼저 JSON.stringify로 직렬화합니다. 객체를 encodeURIComponent에 바로 전달하면 JSON이 아니라 일반 문자열 변환을 적용합니다.

const filterJson = typeof filters === "string" ? filters : JSON.stringify(filters);
const encodedFilters = encodeURIComponent(filterJson);
const searchUrl = `${location.origin}/hubble/external/search/v2/${encodedFilters}`;

이 코드는 현재 검색에서 URL 문자열을 만듭니다. 객체 유형과 속성 ID, 링크 방향과 필터 조건은 생성한 JSON을 기준으로 유지합니다.