File:  [mozdev] / contentgetter / www / Overview.htm
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Mon Dec 8 19:26:08 2003 UTC (15 years, 2 months ago) by boro
Branches: MAIN
CVS tags: HEAD
Overview

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./Overview_files/filelist.xml">
<title>ContentGetter Implementation</title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Justin Borodinsky</o:Author>
  <o:LastAuthor>Justin Borodinsky</o:LastAuthor>
  <o:Revision>4</o:Revision>
  <o:TotalTime>18</o:TotalTime>
  <o:Created>2003-12-07T23:26:00Z</o:Created>
  <o:LastSaved>2003-12-08T19:19:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>378</o:Words>
  <o:Characters>2159</o:Characters>
  <o:Company> </o:Company>
  <o:Lines>17</o:Lines>
  <o:Paragraphs>4</o:Paragraphs>
  <o:CharactersWithSpaces>2651</o:CharactersWithSpaces>
  <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
  <w:UseMarginsForDrawingGridOrigin/>
  <w:Compatibility>
   <w:FootnoteLayoutLikeWW8/>
   <w:ShapeLayoutLikeWW8/>
   <w:AlignTablesRowByRow/>
   <w:ForgetLastTabAlignment/>
   <w:LayoutRawTableWidth/>
   <w:LayoutTableRowsApart/>
  </w:Compatibility>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
p.MsoTitle, li.MsoTitle, div.MsoTitle
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	font-size:14.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	font-weight:bold;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:14.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:1266691153;
	mso-list-type:hybrid;
	mso-list-template-ids:-1488683864 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	margin-left:1.0in;
	text-indent:-.25in;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
</head>

<body lang=EN-US style='tab-interval:.5in'>

<div class=Section1>

<p class=MsoTitle>ContentGetter Implementation</p>

<p class=MsoNormal align=center style='text-align:center'><b><span
style='font-size:14.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>

<p class=MsoNormal><b><span style='font-size:14.0pt;mso-bidi-font-size:10.0pt'><span
style='mso-tab-count:1'>          </span></span></b><span style='font-size:
12.0pt;mso-bidi-font-size:10.0pt'>The ContentGetter UI consists of the
preferences options and the run option.<span style="mso-spacerun: yes"> 
</span>The preferences option is overlayed onto the preferences page, and the
run option is overlayed onto the tools menu.<span style="mso-spacerun: yes"> 
</span><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoNormal><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>ContentGetter
Preferences Overlay (PrefsOverlay.xul):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
preferences overlay consists of a XUL tree.<span style="mso-spacerun: yes"> 
</span>The tree has a single tree cell which links to the preferences page.<o:p></o:p></span></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoBodyText><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
Preferences Page (pref-getter0.xul):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
preferences page is a XUL page element containing the various checkboxes and
textboxes you see when setting the contentgetter preferences.<span
style="mso-spacerun: yes">  </span>In this file are also the functions to get
and set the preferences.<span style="mso-spacerun: yes">  </span>The get
function instantiates the contentgetter preferences component using
XPConnect.<span style="mso-spacerun: yes">  </span>The methods of this object
are then called using the data from the checkboxes and the directory
textbox.<span style="mso-spacerun: yes">  </span>The same design is used for
setting the preferences.<span style="mso-spacerun: yes">  </span><o:p></o:p></span></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoBodyText><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
Overlay on the Tools menu (contentGetterOverlay.xul):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>ContentGetter
is run by selecting tools-&gt;contentgetter-&gt;run contentgetter.<span
style="mso-spacerun: yes">  </span>This option is added using a XUL
overlay.<span style="mso-spacerun: yes">  </span>This overlay calls a function
in the same file which instantiates both the preferences component, and the
contentgetter component.<span style="mso-spacerun: yes">  </span>The
preferences component is used to determine if the preferences are already set,
if they are not (if false is returned from getDirectory) then the user is told
to set the preferences first.<span style="mso-spacerun: yes">  </span>If the
preferences are set the method on the contentgetter component is called which
saves the content.<o:p></o:p></span></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoBodyText><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
Preferences Component (contentgetterprefs.js):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
preferences component is used to get and set the contentgetter
preferences.<span style="mso-spacerun: yes">  </span>This component uses an
implementation of nsIPrefService to do this.<span style="mso-spacerun: yes"> 
</span>Four functions are defined:<o:p></o:p></span></p>

<p class=MsoBodyText style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo2;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>getDirectory: </span></u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>This function will return the value (as an out parameter) of the
directory value from Mozilla’s preferences.<span style="mso-spacerun: yes"> 
</span>If there is no directory set then false is returned.<span
style="mso-spacerun: yes">  </span><o:p></o:p></span></p>

<p class=MsoBodyText style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo2;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>setDirectory:<span style="mso-spacerun: yes">  </span></span></u><span
style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>This function will set the
directory using the value from the preferences page text box.<o:p></o:p></span></p>

<p class=MsoBodyText style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo2;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>setPrefs:<span style="mso-spacerun: yes">  </span></span></u><span
style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>This function will set the
remaining preferences.<o:p></o:p></span></p>

<p class=MsoBodyText style='margin-left:1.0in;text-indent:-.25in;mso-list:l0 level1 lfo2;
tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>GetPrefs: </span></u><span style='font-size:12.0pt;mso-bidi-font-size:
10.0pt'>This function will get the remaining preferences.<o:p></o:p></span></p>

<p class=MsoBodyText style='text-indent:.5in'><span style='font-size:12.0pt;
mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoBodyText><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
ContentGetter Component (contentgetter.js):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>This
component executes the functionality of contentgetter.<span
style="mso-spacerun: yes">  </span>It uses the preferences set by the user and
saves the content of the current page into the directory selected.<o:p></o:p></span></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoBodyText><u><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>Manifest
(/content/contents.rdf):<o:p></o:p></span></u></p>

<p class=MsoBodyText><span style='font-size:12.0pt;mso-bidi-font-size:10.0pt'>The
manifest created using the Resource Description Framework syntax informs
Mozilla where to overlay the preferences tree, and the menu item. <span
style="mso-spacerun: yes"> </span>This connects the XUL UI to the Mozilla
browser.<o:p></o:p></span></p>

</div>

</body>

</html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>