|  |  |
|
가젯 구성요소
가젯 XML 파일은 세 개의 섹션으로 구성된다. 그 중 두 개는 이미 앞서 소개한 ModulePrefs와 Content다. 하나 더 짧게 소개하자면 UserPrefs 섹션이 있다.
ModulePrefs
여러분의 이름, 웹 사이트, 사는 곳과 같은 정보들을 가젯에 넣고 싶다면 ModulePrefs 섹션을 사용하면 된다(Listing 6).
Listing 6. ModulePrefs
<Module>
<ModulePrefs title="Gadget title here"
title_url="http://technical.tutorials.googlepages.com"
author="John Muchow"
description="This gadget is useful for ..."
author_location="Minnesota"/>
<UserPref name="theName" display_name="Name" required="true"
default_value="Your name here"/>
<UserPref name="theSign" display_name="Astrological Sign"/>
<Content type="html">
<![CDATA[
Content goes here...
]]>
</Content>
</Module>
|
Content
위에서 Content를 언급할 때 별다른 설명을 거의 하지 않았다. Listing 6에 보이듯이 이 섹션은 콘텐츠 유형(html, html-inline, url)을 지정한 다음 적당한 콘텐츠를 채워 넣는 곳이다. html과 html-inline은 콘텐츠가 가젯 XML 파일 안에 들어있고 url의 경우 가젯 로직을 포함하고 있는 파일을 참조한다.
UserPrefs
UserPrefs 섹션은 가젯을 사용자의 취향대로 커스터마이즈하는데 사용한다. 예를 들어, 그들의 시간대, 언어, 색상과 같은 선택 사항들이 있다. Listing 6에서 몇 가지 예를 살펴볼 수 있다.
다음 절에서 UserPrefs에 대해 좀 더 자세히 살펴보겠다.
|  |
|