From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- files/ko/places/accessing_bookmarks/index.html | 81 -------------------------- files/ko/places/index.html | 70 ---------------------- 2 files changed, 151 deletions(-) delete mode 100644 files/ko/places/accessing_bookmarks/index.html delete mode 100644 files/ko/places/index.html (limited to 'files/ko/places') diff --git a/files/ko/places/accessing_bookmarks/index.html b/files/ko/places/accessing_bookmarks/index.html deleted file mode 100644 index 76d52c1ab7..0000000000 --- a/files/ko/places/accessing_bookmarks/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Accessing Bookmarks -slug: Places/Accessing_Bookmarks -tags: - - Firefox 3 - - Places -translation_of: Mozilla/Tech/Places/Manipulating_bookmarks_using_Places ---- -

-

이 문서는 북마크 트리의 일부를 빠르게 구하기를 원하는 사람들을 위한 빠른 시작을 제공합니다. 북마크는 플레이스 질의 시스템을 이용하여 구할 수 있으며, 이는 더 일반적인 정보를 담고 있습니다. 북마크 서비스 API에 대해서는 북마크 서비스를 참고하시기 바랍니다.

-

질의와 옵션 개체 얻기

-

모든 질의는 히스토리 서비스를 통해 실행합니다. 먼저 히스토리 서비스에서 빈 질의와 옵션 개체를 얻어야 합니다.

-
var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"]
-                               .getService(Components.interfaces.nsINavHistoryService);
-var options = historyService.getNewQueryOptions();
-var query = historyService.getNewQuery();
-
-

원하는 폴더 찾기

-

알려진 폴더 ID는 북마크 서비스에서 구할 수 있습니다. /toolkit/components/places/public/nsINavBookmarksService.idl에 정의된 속성은 bookmarksMenuFolder, tagsFolder, unfiledBookmarksFolder, toolbarFolder입니다. 이전 질의에서 폴더 ID를 얻을 수도 있습니다.

-

이 예제는 북마크 도구 막대의 ID를 얻는 것입니다.

-
var bookmarksService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
-                                 .getService(Components.interfaces.nsINavBookmarksService);
-var toolbarFolder = bookmarksService.toolbarFolder;
-
-

placesRoot는 전체 플레이스 계층 구조의 최상위 폴더입니다. 이는 사용자 데이터 뿐만 아니라 관리 데이터를 포함하고 있어서 질의에 사용하는 것은 바람직하지 않습니다.

-

질의와 옵션 개체 채우기

-

전체 북마크 트리를 원하면 그룹화 옵션 GROUP_BY_FOLDER을 사용해야 합니다. 현재, 질의 시스템은 이 플래그가 필요하지 않으며 정확하게 한 폴더의 내용을 요청하면 항상 계층 구조를 반환합니다. 이는 bug 331487입니다. 버그가 수정되면 GROUP_BY_FOLDER이 없는 북마크 질의는 모든 폴더와 서브폴더에서 질의에 부합하는 모든 북마크의 단순 목록을 반환할 것입니다.

-

통상의 북마크 질의에서 여러분은 하나의 최상위 폴더를 갖습니다. 질의 개체에서 이 폴더는 setFolders에 주어집니다.

-
options.setGroupingMode([options.GROUP_BY_FOLDER],1);
-query.setFolders([toolbarFolder], 1);
-
-

질의 실행하기

-

executeQueryexecuteQueries 함수는 질의 결과를 포함한 nsINavHistoryResult 개체를 반환합니다.

-
var result = historyService.executeQuery(query, options);
-
-

결과 얻기

-

(예제와 같이) 키워드나 날짜 범위와 같은 고급 매개 변수가 없이 폴더로 분류된 딱 하나의 폴더를 질의할 때, 결과의 root는 폴더에 해당하는 nsINavHistoryContainerResultNode가 됩니다. 질의가 복잡하거나 GROUP_BY_FOLDER를 사용하지 않았다면 루트는 nsINavHistoryQueryResultNode가 됩니다.

-

결과 콘테이너의 자식을 접근하기 전에 먼저 그것을 열고 나서 자식을 탐색할 수 있습니다. 콘테이너가 열려 있는 동안 북마크 시스템의 공지를 듣고 자신을 최신 상태로 유지하게 됩니다. 작업을 마치면 꼭 콘테이너를 닫아 자원을 해제하십시오. 그렇지 않으면 콘테이너는 계속 알림을 받고 자신을 갱신하여 전체 브라우저를 느리게 합니다.

-
var rootNode = result.root;
-rootNode.containerOpen = true;
-
-// iterate over the immediate children of this folder and dump to console
-for (var i = 0; i < rootNode.childCount; i ++) {
-  var node = rootNode.getChild(i);
-  dump("Child: " + node.title + "\n");
-}
-
-// close a container after using it!
-rootNode.containerOpen = false;
-
-

RESULT_TYPE_FOLDER 형식이나 다른 형식의 노드를 만나면 이 폴더를 열고 계층 구조의 아래로 내려갈 수 있습니다. 여러 가지 결과 형식을 이해하려면 플레이스:질의 시스템의 "결과 이용하기" 섹션을 참고하시기 바랍니다.

-

전체 코드

-
var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"]
-                               .getService(Components.interfaces.nsINavHistoryService);
-var options = historyService.getNewQueryOptions();
-var query = historyService.getNewQuery();
-
-var bookmarksService = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
-                                 .getService(Components.interfaces.nsINavBookmarksService);
-var toolbarFolder = bookmarksService.toolbarFolder;
-
-//comment out the next line for now; the bug hasn't been fixed; final version should include the next line
-options.setGroupingMode([options.GROUP_BY_FOLDER],1);
-query.setFolders([toolbarFolder], 1);
-
-var result = historyService.executeQuery(query, options);
-var rootNode = result.root;
-rootNode.containerOpen = true;
-
-// iterate over the immediate children of this folder and dump to console
-for (var i = 0; i < rootNode.childCount; i ++) {
-  var node = rootNode.getChild(i);
-  dump("Child: " + node.title + "\n");
-}
-
-// close a container after using it!
-rootNode.containerOpen = false;
-
-
-  
-

diff --git a/files/ko/places/index.html b/files/ko/places/index.html deleted file mode 100644 index 99ffcc3778..0000000000 --- a/files/ko/places/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Places -slug: Places -tags: - - Add-ons - - Developing Mozilla - - Extensions - - Places -translation_of: Mozilla/Tech/Places ---- -

- -

플레이스(Places)는 Firefox의 북마크와 히스토리 시스템을 재작성한 것입니다. 이는 상당한 유연성과 복잡한 질의가 가능한 것을 목표로 삼고 있습니다. 파비콘(favicon) 저장소나 임의의 정보로 페이지에 주석을 달 수 있는 것과 같은 새로운 기능도 포함하고 있습니다. 또한, 다양한 새로운 사용자 인터페이스도 포함하고 있는데 본 개발자 문서에서는 이에 대해 다루지 않습니다(플레이스에 대한 모질라 위키 페이지를 참고하십시오).

- -

플레이스는 mozStorage 인터페이스를 이용하여 sqlite 데이터베이스에 데이터를 저장합니다.

- -

주제

- -
-
질의 시스템(Query System)
-
특정 매개 변수로 북마크와 히스토리 시스템을 질의하는 방법.
-
- -
-
북마크 접근하기(Accessing Bookmarks)
-
북마크를 접근하는 방법.
-
- -
-
사용자 정의 콘테이너(Custom Containers)
-
플레이스 뷰에 서드파티 원본의 링크를 표시하기 위하여 사용자 정의 콘테이너를 생성하는 방법.
-
- -
-
뷰(Views)
-
자신의 애플리케이션이나 확장에 플레이스 뷰를 생성하고 구성하는 방법.
-
- -
-
뷰 생성하기(Instantiating Views)
-
자신의 확장이나 애플리케이션에 사용하기 위하여 내장된 플레이스 뷰를 포함한 콘트롤을 생성하는 방법.
-
- -

서비스 API 문서

- -
-
히스토리 서비스(History Service)
-
북마크 서비스(Bookmarks Service)
-
주석 서비스(Annotation Service)
-
라이브마크 서비스(Livemark Service)
-
파비콘 서비스(Favicon Service)
-
태깅 서비스(Tagging Service)
-
- -

설계 문서

- -
-
플레이스 데이터베이스 디자인(Places Database Design)
-
플레이스 데이터베이스 설계에 대한 고수준 개요.
-
히스토리 서비스 설계(History Service Design)
-
히스토리 서비스 설계.
-
북마크 서비스 설계(Bookmark Service Design)
-
북마크 서비스 설계.
-
주석 서비스 설계(Annotation Service Design)
-
주석 서비스 설계.
-
위치 막대 설계(Location Bar Design)
-
멋진 막대(awesomebar)라는 별명을 가진 플레이스 구동 위치 막대(Places-driven Location Bar)의 설계 및 알고리즘.
-
- -

-- cgit v1.2.3-54-g00ecf