Add config option to show HostBrowser link in search result

- ConfigPortal: added checkbox Host Browser
- yacy.init: added search.result.show.hostbrowser as default = on (true)
- fix HostBrowser: broken link to protected WebStructurePicture for public user
pull/1/head
reger 12 years ago
parent 07861cae45
commit e9e0d63897

File diff suppressed because it is too large Load Diff

@ -1,227 +1,228 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<!-- This page is only XHTML 1.0 Transitional and not Strict because iframes are in use -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaCy '#[clientname]#': Integration of a Search Portal</title>
#%env/templates/metas.template%#
</head>
<body id="ConfigSkins">
#%env/templates/header.template%#
#%env/templates/submenuSearchConfiguration.template%#
<h2>Integration of a Search Portal</h2>
<p>
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.
The search page may be customized. You can change the 'corporate identity'-images, the greeting line
and a link to a home page that is reached when the 'corporate identity'-images are clicked.
To change also colours and styles use the <a href="ConfigAppearance_p.html">Appearance Servlet</a> for different skins and languages.
</p>
<form action="ConfigPortal.html" method="post" enctype="multipart/form-data" id="ConfigPortal" accept-charset="UTF-8">
<fieldset>
<dl>
<dt>Greeting Line</dt>
<dd><input type="text" name="promoteSearchPageGreeting" id="promoteSearchPageGreeting" value="#[promoteSearchPageGreeting]#" size="60" /></dd>
<dt>URL of Home Page</dt>
<dd><input type="text" name="promoteSearchPageGreeting.homepage" value="#[promoteSearchPageGreeting.homepage]#" size="60" /></dd>
<dt>URL of a Small Corporate Image</dt>
<dd><input type="text" name="promoteSearchPageGreeting.smallImage" value="#[promoteSearchPageGreeting.smallImage]#" size="60" /></dd>
<dt>URL of a Large Corporate Image</dt>
<dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd>
<dt>Enable Search for Everyone?</dt>
<dd>
<input type="radio" name="publicSearchpage" value="true" #(publicSearchpage)#::checked="checked"#(/publicSearchpage)# />Search is available for everyone&nbsp;
<input type="radio" name="publicSearchpage" value="false" #(publicSearchpage)#checked="checked"::#(/publicSearchpage)# />Only the administator is allowed to search
</dd>
<dt>Show Navigation Bar on Search Page?</dt>
<dd>
<input type="radio" name="publicTopmenu" value="true" #(publicTopmenu)#::checked="checked"#(/publicTopmenu)# />Show Navigation Top-Menu&nbsp;
<input type="radio" name="publicTopmenu" value="false" #(publicTopmenu)#checked="checked"::#(/publicTopmenu)# />no link to YaCy Menu (admin must navigate to /Status.html manually)
</dd>
<dt>Show Advanced Search Options on Search Page?</dt>
<dd>
<input type="radio" name="search.options" value="true" #(search.options)#::checked="checked"#(/search.options)# />Show Advanced Search Options on index.html&nbsp;
<input type="radio" name="search.options" value="false" #(search.options)#checked="checked"::#(/search.options)# />do not show Advanced Search
</dd>
<dt>Show Media Search Options</dt>
<dd>
<input type="checkbox" name="search.text" value="true" #(search.text)#::checked="checked"#(/search.text)# />Text&nbsp;
<input type="checkbox" name="search.image" value="true" #(search.image)#::checked="checked"#(/search.image)# />Images&nbsp;
<input type="checkbox" name="search.audio" value="true" #(search.audio)#::checked="checked"#(/search.audio)# />Audio&nbsp;
<input type="checkbox" name="search.video" value="true" #(search.video)#::checked="checked"#(/search.video)# />Video&nbsp;
<input type="checkbox" name="search.app" value="true" #(search.app)#::checked="checked"#(/search.app)# />Applications
</dd>
<dt>Show additional interaction features in footer</dt>
<dd>
<input type="checkbox" name="interaction.userlogon" value="true" #(interaction.userlogon)#::checked="checked"#(/interaction.userlogon)# />User-Logon&nbsp;
</dd>
<dt>Snippet Fetch Strategy &amp; Link Verification</dt>
<dd>
<img src="env/grafics/idea.png" width="32" height="32" alt="idea" align="center"/>Speed up search results with this option! (use CACHEONLY or FALSE to switch off verification)<br/>
<input type="radio" name="search.verify" value="nocache" #(search.verify.nocache)#::checked="checked"#(/search.verify.nocache)# onclick="document.getElementById('search_verify_delete').disabled=false;document.getElementById('search_verify_delete').checked=true;"/>NOCACHE: no use of web cache, load all snippets online<br/>
<input type="radio" name="search.verify" value="iffresh" #(search.verify.iffresh)#::checked="checked"#(/search.verify.iffresh)# onclick="document.getElementById('search_verify_delete').disabled=false;document.getElementById('search_verify_delete').checked=true;"/>IFFRESH: use the cache if the cache exists and is fresh otherwise load online<br/>
<input type="radio" name="search.verify" value="ifexist" #(search.verify.ifexist)#::checked="checked"#(/search.verify.ifexist)# />IFEXIST: use the cache if the cache exist or load online<br/>
<input type="checkbox" name="search.verify.delete" id="search_verify_delete" value="true" #(search.verify.delete)#::checked="checked"#(/search.verify.delete)# />If verification fails, delete index reference<br/><br/>
<input type="radio" name="search.verify" value="cacheonly" #(search.verify.cacheonly)#::checked="checked"#(/search.verify.cacheonly)# onclick="document.getElementById('search_verify_delete').disabled=true;document.getElementById('search_verify_delete').checked=false;"/>CACHEONLY: never go online, use all content from cache. If no cache entry exist, consider content nevertheless as available and show result without snippet<br/>
<input type="radio" name="search.verify" value="false" #(search.verify.false)#::checked="checked"#(/search.verify.false)# onclick="document.getElementById('search_verify_delete').disabled=true;document.getElementById('search_verify_delete').checked=false;"/>FALSE: no link verification and not snippet generation: all search results are valid without verification
</dd>
<dt>Show Information Links for each Search Result Entry</dt>
<dd>
<input type="checkbox" name="search.result.show.date" value="true" #(search.result.show.date)#::checked="checked"#(/search.result.show.date)# />Date&nbsp;
<input type="checkbox" name="search.result.show.size" value="true" #(search.result.show.size)#::checked="checked"#(/search.result.show.size)# />Size&nbsp;
<input type="checkbox" name="search.result.show.metadata" value="true" #(search.result.show.metadata)#::checked="checked"#(/search.result.show.metadata)# />Metadata&nbsp;
<input type="checkbox" name="search.result.show.parser" value="true" #(search.result.show.parser)#::checked="checked"#(/search.result.show.parser)# />Parser&nbsp;
<input type="checkbox" name="search.result.show.pictures" value="true" #(search.result.show.pictures)#::checked="checked"#(/search.result.show.pictures)# />Pictures&nbsp;
<input type="checkbox" name="search.result.show.cache" value="true" #(search.result.show.cache)#::checked="checked"#(/search.result.show.cache)# />Cache
<input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked"#(/search.result.show.proxy)# />Augmented Browsing
<input type="checkbox" name="search.result.show.tags" value="true" #(search.result.show.tags)#::checked="checked"#(/search.result.show.tags)# />Tags
</dd>
<dt>Show Navigation on Side-Bar</dt>
<dd>
<input type="checkbox" name="search.navigation.hosts" value="true" #(search.navigation.hosts)#::checked="checked"#(/search.navigation.hosts)# />Host Navigation&nbsp;
<input type="checkbox" name="search.navigation.authors" value="true" #(search.navigation.authors)#::checked="checked"#(/search.navigation.authors)# />Author Navigation&nbsp;
<input type="checkbox" name="search.navigation.namespace" value="true" #(search.navigation.namespace)#::checked="checked"#(/search.navigation.namespace)# />Wiki Name-Space Navigation&nbsp;
<input type="checkbox" name="search.navigation.topics" value="true" #(search.navigation.topics)#::checked="checked"#(/search.navigation.topics)# />Topics (Tag-Cloud) Navigation&nbsp;
</dd>
<dt>Default Pop-Up Page</dt>
<dd>
<input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp;
<input type="radio" name="popup" value="front" #(popupFront)#::checked="checked"#(/popupFront)# />Search Front Page&nbsp;
<input type="radio" name="popup" value="search" #(popupSearch)#::checked="checked"#(/popupSearch)# />Search Page (small header)&nbsp;
<input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page&nbsp;
</dd>
<dt>Default maximum number of results per page</dt>
<dd><input type="text" name="maximumRecords" value="#[maximumRecords]#" size="3" /></dd>
<dt>Default index.html Page (by forwarder)</dt>
<dd><input type="text" name="indexForward" value="#[indexForward]#" size="60" /></dd>
<dt>Target for Click on Search Results</dt>
<dd>
<select name="target">
<option value="_blank" #(target_selected_blank)#::selected="selected"#(/target_selected_blank)#>"_blank" (new window)</option>
<option value="_self" #(target_selected_self)#::selected="selected"#(/target_selected_self)#>"_self" (same window)</option>
<option value="_parent" #(target_selected_parent)#::selected="selected"#(/target_selected_parent)#>"_parent" (the parent frame of a frameset)</option>
<option value="_top" #(target_selected_top)#::selected="selected"#(/target_selected_top)#>"_top" (top of all frames)</option>
<option value="searchresult" #(target_selected_searchresult)#::selected="selected"#(/target_selected_searchresult)#>"searchresult" (a default custom page name for search results)</option>
</select>
</dd>
<dt>Special Target as Exception for an URL-Pattern</dt>
<dd>
<select name="target_special">
<option value="_blank" #(target_selected_special_blank)#::selected="selected"#(/target_selected_special_blank)#>"_blank" (new window)</option>
<option value="_self" #(target_selected_special_self)#::selected="selected"#(/target_selected_special_self)#>"_self" (same window)</option>
<option value="_parent" #(target_selected_special_parent)#::selected="selected"#(/target_selected_special_parent)#>"_parent" (the parent frame of a frameset)</option>
<option value="_top" #(target_selected_special_top)#::selected="selected"#(/target_selected_special_top)#>"_top" (top of all frames)</option>
<option value="searchresult" #(target_selected_special_searchresult)#::selected="selected"#(/target_selected_special_searchresult)#>"searchresult" (a default custom page name for search results)</option>
</select>
&nbsp;Pattern:<input type="text" name="target_special_pattern" value="#[target_special_pattern]#" size="30" />
</dd>
<dt>Exclude Hosts</dt>
<dd>List of hosts that shall be excluded from search results by default but can be included using the site:&lt;host&gt; operator:<br/>
<input type="text" name="search.excludehosts" value="#[search.excludehosts]#" size="60" /><br/>
#[search.excludehosth]#
</dd>
<dt>'About' Column<br/>(shown in a column alongside<br/>with the search result page)</dt>
<dd><input type="text" name="about.headline" value="#[about.headline]#" size="60" />(Headline)</br>
<textarea name="about.body" cols="60" rows="8">#[about.body]#</textarea>(Content)
</dd>
<dt>&nbsp;</dt>
<dd>
<input type="submit" name="searchpage_set" value="Change Search Page" class="submitready"/>&nbsp;&nbsp;
<input type="submit" name="searchpage_default" value="Set to Default Values" class="submitready"/>
<p>You have to <a href="ConfigAccounts_p.html">set a remote user/password</a> to change this options.</p>
</dd>
</dl>
</fieldset>
</form>
<h3>
The search page can be integrated in your own web pages with an iframe. Simply use the following code:
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target&quot;
src=&quot;http://#[myaddress]#/index.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;410&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target"
src="http://#[myaddress]#/index.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="410"
frameborder="0"
scrolling="auto"
id="target">
</iframe>
<h3>
For a search page with a small header, use this code:
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target2&quot;
src=&quot;http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target2&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target2"
src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="180"
frameborder="0"
scrolling="auto"
id="target2"
onfocus="removeFocus(this);">
</iframe>
<h3>
A third option is the interactive search. Use this code:
</h3>
<fieldset><pre>
&lt;iframe name="target3"
src=&quot;http://#[myaddress]#/yacyinteractive.html?display=2&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target3&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target3"
src="http://#[myaddress]#/yacyinteractive.html?display=2&amp;focus=0"
width="100%"
height="180"
frameborder="0"
scrolling="auto"
id="target3"
onfocus="removeFocus(this);">
</iframe>
#%env/templates/footer.template%#
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<!-- This page is only XHTML 1.0 Transitional and not Strict because iframes are in use -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaCy '#[clientname]#': Integration of a Search Portal</title>
#%env/templates/metas.template%#
</head>
<body id="ConfigSkins">
#%env/templates/header.template%#
#%env/templates/submenuSearchConfiguration.template%#
<h2>Integration of a Search Portal</h2>
<p>
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.
The search page may be customized. You can change the 'corporate identity'-images, the greeting line
and a link to a home page that is reached when the 'corporate identity'-images are clicked.
To change also colours and styles use the <a href="ConfigAppearance_p.html">Appearance Servlet</a> for different skins and languages.
</p>
<form action="ConfigPortal.html" method="post" enctype="multipart/form-data" id="ConfigPortal" accept-charset="UTF-8">
<fieldset>
<dl>
<dt>Greeting Line</dt>
<dd><input type="text" name="promoteSearchPageGreeting" id="promoteSearchPageGreeting" value="#[promoteSearchPageGreeting]#" size="60" /></dd>
<dt>URL of Home Page</dt>
<dd><input type="text" name="promoteSearchPageGreeting.homepage" value="#[promoteSearchPageGreeting.homepage]#" size="60" /></dd>
<dt>URL of a Small Corporate Image</dt>
<dd><input type="text" name="promoteSearchPageGreeting.smallImage" value="#[promoteSearchPageGreeting.smallImage]#" size="60" /></dd>
<dt>URL of a Large Corporate Image</dt>
<dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd>
<dt>Enable Search for Everyone?</dt>
<dd>
<input type="radio" name="publicSearchpage" value="true" #(publicSearchpage)#::checked="checked"#(/publicSearchpage)# />Search is available for everyone&nbsp;
<input type="radio" name="publicSearchpage" value="false" #(publicSearchpage)#checked="checked"::#(/publicSearchpage)# />Only the administator is allowed to search
</dd>
<dt>Show Navigation Bar on Search Page?</dt>
<dd>
<input type="radio" name="publicTopmenu" value="true" #(publicTopmenu)#::checked="checked"#(/publicTopmenu)# />Show Navigation Top-Menu&nbsp;
<input type="radio" name="publicTopmenu" value="false" #(publicTopmenu)#checked="checked"::#(/publicTopmenu)# />no link to YaCy Menu (admin must navigate to /Status.html manually)
</dd>
<dt>Show Advanced Search Options on Search Page?</dt>
<dd>
<input type="radio" name="search.options" value="true" #(search.options)#::checked="checked"#(/search.options)# />Show Advanced Search Options on index.html&nbsp;
<input type="radio" name="search.options" value="false" #(search.options)#checked="checked"::#(/search.options)# />do not show Advanced Search
</dd>
<dt>Show Media Search Options</dt>
<dd>
<input type="checkbox" name="search.text" value="true" #(search.text)#::checked="checked"#(/search.text)# />Text&nbsp;
<input type="checkbox" name="search.image" value="true" #(search.image)#::checked="checked"#(/search.image)# />Images&nbsp;
<input type="checkbox" name="search.audio" value="true" #(search.audio)#::checked="checked"#(/search.audio)# />Audio&nbsp;
<input type="checkbox" name="search.video" value="true" #(search.video)#::checked="checked"#(/search.video)# />Video&nbsp;
<input type="checkbox" name="search.app" value="true" #(search.app)#::checked="checked"#(/search.app)# />Applications
</dd>
<dt>Show additional interaction features in footer</dt>
<dd>
<input type="checkbox" name="interaction.userlogon" value="true" #(interaction.userlogon)#::checked="checked"#(/interaction.userlogon)# />User-Logon&nbsp;
</dd>
<dt>Snippet Fetch Strategy &amp; Link Verification</dt>
<dd>
<img src="env/grafics/idea.png" width="32" height="32" alt="idea" align="center"/>Speed up search results with this option! (use CACHEONLY or FALSE to switch off verification)<br/>
<input type="radio" name="search.verify" value="nocache" #(search.verify.nocache)#::checked="checked"#(/search.verify.nocache)# onclick="document.getElementById('search_verify_delete').disabled=false;document.getElementById('search_verify_delete').checked=true;"/>NOCACHE: no use of web cache, load all snippets online<br/>
<input type="radio" name="search.verify" value="iffresh" #(search.verify.iffresh)#::checked="checked"#(/search.verify.iffresh)# onclick="document.getElementById('search_verify_delete').disabled=false;document.getElementById('search_verify_delete').checked=true;"/>IFFRESH: use the cache if the cache exists and is fresh otherwise load online<br/>
<input type="radio" name="search.verify" value="ifexist" #(search.verify.ifexist)#::checked="checked"#(/search.verify.ifexist)# />IFEXIST: use the cache if the cache exist or load online<br/>
<input type="checkbox" name="search.verify.delete" id="search_verify_delete" value="true" #(search.verify.delete)#::checked="checked"#(/search.verify.delete)# />If verification fails, delete index reference<br/><br/>
<input type="radio" name="search.verify" value="cacheonly" #(search.verify.cacheonly)#::checked="checked"#(/search.verify.cacheonly)# onclick="document.getElementById('search_verify_delete').disabled=true;document.getElementById('search_verify_delete').checked=false;"/>CACHEONLY: never go online, use all content from cache. If no cache entry exist, consider content nevertheless as available and show result without snippet<br/>
<input type="radio" name="search.verify" value="false" #(search.verify.false)#::checked="checked"#(/search.verify.false)# onclick="document.getElementById('search_verify_delete').disabled=true;document.getElementById('search_verify_delete').checked=false;"/>FALSE: no link verification and not snippet generation: all search results are valid without verification
</dd>
<dt>Show Information Links for each Search Result Entry</dt>
<dd>
<input type="checkbox" name="search.result.show.date" value="true" #(search.result.show.date)#::checked="checked"#(/search.result.show.date)# />Date&nbsp;
<input type="checkbox" name="search.result.show.size" value="true" #(search.result.show.size)#::checked="checked"#(/search.result.show.size)# />Size&nbsp;
<input type="checkbox" name="search.result.show.metadata" value="true" #(search.result.show.metadata)#::checked="checked"#(/search.result.show.metadata)# />Metadata&nbsp;
<input type="checkbox" name="search.result.show.parser" value="true" #(search.result.show.parser)#::checked="checked"#(/search.result.show.parser)# />Parser&nbsp;
<input type="checkbox" name="search.result.show.pictures" value="true" #(search.result.show.pictures)#::checked="checked"#(/search.result.show.pictures)# />Pictures&nbsp;
<input type="checkbox" name="search.result.show.cache" value="true" #(search.result.show.cache)#::checked="checked"#(/search.result.show.cache)# />Cache
<input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked"#(/search.result.show.proxy)# />Augmented Browsing
<input type="checkbox" name="search.result.show.hostbrowser" value="true" #(search.result.show.hostbrowser)#::checked="checked"#(/search.result.show.hostbrowser)# />Host Browser&nbsp;
<input type="checkbox" name="search.result.show.tags" value="true" #(search.result.show.tags)#::checked="checked"#(/search.result.show.tags)# />Tags
</dd>
<dt>Show Navigation on Side-Bar</dt>
<dd>
<input type="checkbox" name="search.navigation.hosts" value="true" #(search.navigation.hosts)#::checked="checked"#(/search.navigation.hosts)# />Host Navigation&nbsp;
<input type="checkbox" name="search.navigation.authors" value="true" #(search.navigation.authors)#::checked="checked"#(/search.navigation.authors)# />Author Navigation&nbsp;
<input type="checkbox" name="search.navigation.namespace" value="true" #(search.navigation.namespace)#::checked="checked"#(/search.navigation.namespace)# />Wiki Name-Space Navigation&nbsp;
<input type="checkbox" name="search.navigation.topics" value="true" #(search.navigation.topics)#::checked="checked"#(/search.navigation.topics)# />Topics (Tag-Cloud) Navigation&nbsp;
</dd>
<dt>Default Pop-Up Page</dt>
<dd>
<input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp;
<input type="radio" name="popup" value="front" #(popupFront)#::checked="checked"#(/popupFront)# />Search Front Page&nbsp;
<input type="radio" name="popup" value="search" #(popupSearch)#::checked="checked"#(/popupSearch)# />Search Page (small header)&nbsp;
<input type="radio" name="popup" value="interactive" #(popupInteractive)#::checked="checked"#(/popupInteractive)# />Interactive Search Page&nbsp;
</dd>
<dt>Default maximum number of results per page</dt>
<dd><input type="text" name="maximumRecords" value="#[maximumRecords]#" size="3" /></dd>
<dt>Default index.html Page (by forwarder)</dt>
<dd><input type="text" name="indexForward" value="#[indexForward]#" size="60" /></dd>
<dt>Target for Click on Search Results</dt>
<dd>
<select name="target">
<option value="_blank" #(target_selected_blank)#::selected="selected"#(/target_selected_blank)#>"_blank" (new window)</option>
<option value="_self" #(target_selected_self)#::selected="selected"#(/target_selected_self)#>"_self" (same window)</option>
<option value="_parent" #(target_selected_parent)#::selected="selected"#(/target_selected_parent)#>"_parent" (the parent frame of a frameset)</option>
<option value="_top" #(target_selected_top)#::selected="selected"#(/target_selected_top)#>"_top" (top of all frames)</option>
<option value="searchresult" #(target_selected_searchresult)#::selected="selected"#(/target_selected_searchresult)#>"searchresult" (a default custom page name for search results)</option>
</select>
</dd>
<dt>Special Target as Exception for an URL-Pattern</dt>
<dd>
<select name="target_special">
<option value="_blank" #(target_selected_special_blank)#::selected="selected"#(/target_selected_special_blank)#>"_blank" (new window)</option>
<option value="_self" #(target_selected_special_self)#::selected="selected"#(/target_selected_special_self)#>"_self" (same window)</option>
<option value="_parent" #(target_selected_special_parent)#::selected="selected"#(/target_selected_special_parent)#>"_parent" (the parent frame of a frameset)</option>
<option value="_top" #(target_selected_special_top)#::selected="selected"#(/target_selected_special_top)#>"_top" (top of all frames)</option>
<option value="searchresult" #(target_selected_special_searchresult)#::selected="selected"#(/target_selected_special_searchresult)#>"searchresult" (a default custom page name for search results)</option>
</select>
&nbsp;Pattern:<input type="text" name="target_special_pattern" value="#[target_special_pattern]#" size="30" />
</dd>
<dt>Exclude Hosts</dt>
<dd>List of hosts that shall be excluded from search results by default but can be included using the site:&lt;host&gt; operator:<br/>
<input type="text" name="search.excludehosts" value="#[search.excludehosts]#" size="60" /><br/>
#[search.excludehosth]#
</dd>
<dt>'About' Column<br/>(shown in a column alongside<br/>with the search result page)</dt>
<dd><input type="text" name="about.headline" value="#[about.headline]#" size="60" />(Headline)</br>
<textarea name="about.body" cols="60" rows="8">#[about.body]#</textarea>(Content)
</dd>
<dt>&nbsp;</dt>
<dd>
<input type="submit" name="searchpage_set" value="Change Search Page" class="submitready"/>&nbsp;&nbsp;
<input type="submit" name="searchpage_default" value="Set to Default Values" class="submitready"/>
<p>You have to <a href="ConfigAccounts_p.html">set a remote user/password</a> to change this options.</p>
</dd>
</dl>
</fieldset>
</form>
<h3>
The search page can be integrated in your own web pages with an iframe. Simply use the following code:
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target&quot;
src=&quot;http://#[myaddress]#/index.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;410&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target"
src="http://#[myaddress]#/index.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="410"
frameborder="0"
scrolling="auto"
id="target">
</iframe>
<h3>
For a search page with a small header, use this code:
</h3>
<fieldset><pre>
&lt;iframe name=&quot;target2&quot;
src=&quot;http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target2&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target2"
src="http://#[myaddress]#/yacysearch.html?display=2&amp;resource=local&amp;focus=0"
width="100%"
height="180"
frameborder="0"
scrolling="auto"
id="target2"
onfocus="removeFocus(this);">
</iframe>
<h3>
A third option is the interactive search. Use this code:
</h3>
<fieldset><pre>
&lt;iframe name="target3"
src=&quot;http://#[myaddress]#/yacyinteractive.html?display=2&quot;
width=&quot;100%&quot;
height=&quot;180&quot;
frameborder=&quot;0&quot;
scrolling=&quot;auto&quot;
id=&quot;target3&quot;&gt;
&lt;/iframe&gt;
</pre></fieldset>
This would look like:
<iframe name="target3"
src="http://#[myaddress]#/yacyinteractive.html?display=2&amp;focus=0"
width="100%"
height="180"
frameborder="0"
scrolling="auto"
id="target3"
onfocus="removeFocus(this);">
</iframe>
#%env/templates/footer.template%#
</body>
</html>

@ -1,241 +1,244 @@
// ConfigPortal.java
// -----------------------
// part of YaCy
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://yacy.net
// Frankfurt, Germany, 4.7.2008
//
//$LastChangedDate$
//$LastChangedRevision$
//$LastChangedBy$
//
// LICENSE
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.http.HTTPDFileHandler;
public class ConfigPortal {
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
if (post != null) {
// AUTHENTICATE
if (!sb.verifyAuthentication(header)) {
// force log-in
prop.authenticationRequired();
return prop;
}
if (post.containsKey("popup")) {
final String popup = post.get("popup", "status");
if ("front".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html");
} else if ("search".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html");
} else if ("interactive".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html");
} else {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
}
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"));
HTTPDFileHandler.initDefaultPath();
}
if (post.containsKey("searchpage_set")) {
final String newGreeting = post.get(SwitchboardConstants.GREETING, "");
// store this call as api call
sb.tables.recordAPICall(post, "ConfigPortal.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting);
sb.setConfig(SwitchboardConstants.GREETING, newGreeting);
sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, post.get(SwitchboardConstants.GREETING_HOMEPAGE, ""));
sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, post.get(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));
sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, post.get("target", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, post.get("target_special", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, post.get("target_special_pattern", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10));
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));
HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, "");
sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu"));
sb.setConfig("publicSearchpage", !post.containsKey("publicSearchpage") || post.getBoolean("publicSearchpage"));
sb.setConfig("search.options", post.getBoolean("search.options"));
sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon"));
sb.setConfig("search.text", post.getBoolean("search.text"));
sb.setConfig("search.image", post.getBoolean("search.image"));
sb.setConfig("search.audio", post.getBoolean("search.audio"));
sb.setConfig("search.video", post.getBoolean("search.video"));
sb.setConfig("search.app", post.getBoolean("search.app"));
sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date"));
sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size"));
sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata"));
sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser"));
sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures"));
sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache"));
sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy"));
sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete"));
sb.setConfig("about.headline", post.get("about.headline", ""));
sb.setConfig("about.body", post.get("about.body", ""));
String excludehosts = post.get("search.excludehosts", "");
sb.setConfig("search.excludehosts", excludehosts);
sb.setConfig("search.excludehosth", DigestURI.hosthashes(excludehosts));
// construct navigation String
String nav = "";
if (post.getBoolean("search.navigation.hosts")) nav += "hosts,";
if (post.getBoolean("search.navigation.authors")) nav += "authors,";
if (post.getBoolean("search.navigation.namespace")) nav += "namespace,";
if (post.getBoolean("search.navigation.topics")) nav += "topics,";
if (nav.endsWith(",")) nav = nav.substring(0, nav.length() - 1); sb.setConfig("search.navigation", nav);
}
if (post.containsKey("searchpage_default")) {
sb.setConfig(SwitchboardConstants.GREETING, "P2P Web Search");
sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, "http://yacy.net");
sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");
sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, "");
HTTPDFileHandler.indexForward = "";
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self");
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self");
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "");
sb.setConfig("publicTopmenu", true);
sb.setConfig("publicSearchpage", true);
sb.setConfig("search.navigation", "hosts,authors,namespace,topics");
sb.setConfig("search.options", true);
sb.setConfig("interaction.userlogon.enabled", false);
sb.setConfig("search.text", true);
sb.setConfig("search.image", true);
sb.setConfig("search.audio", false);
sb.setConfig("search.video", false);
sb.setConfig("search.app", false);
sb.setConfig("search.result.show.date", true);
sb.setConfig("search.result.show.size", false);
sb.setConfig("search.result.show.metadata", false);
sb.setConfig("search.result.show.parser", false);
sb.setConfig("search.result.show.pictures", false);
sb.setConfig("search.result.show.cache", true);
sb.setConfig("search.result.show.proxy", false);
sb.setConfig("search.result.show.tags", false);
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh");
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");
sb.setConfig("about.headline", "");
sb.setConfig("about.body", "");
sb.setConfig("search.excludehosts", "");
sb.setConfig("search.excludehosth", "");
}
}
prop.putHTML(SwitchboardConstants.GREETING, sb.getConfig(SwitchboardConstants.GREETING, ""));
prop.putHTML(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));
prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, ""));
prop.put("publicTopmenu", sb.getConfigBool("publicTopmenu", false) ? 1 : 0);
prop.put("publicSearchpage", sb.getConfigBool("publicSearchpage", false) ? 1 : 0);
prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0);
prop.put("interaction.userlogon", sb.getConfigBool("interaction.userlogon.enabled", false) ? 1 : 0);
prop.put("search.text", sb.getConfigBool("search.text", false) ? 1 : 0);
prop.put("search.image", sb.getConfigBool("search.image", false) ? 1 : 0);
prop.put("search.audio", sb.getConfigBool("search.audio", false) ? 1 : 0);
prop.put("search.video", sb.getConfigBool("search.video", false) ? 1 : 0);
prop.put("search.app", sb.getConfigBool("search.app", false) ? 1 : 0);
prop.put("search.result.show.date", sb.getConfigBool("search.result.show.date", false) ? 1 : 0);
prop.put("search.result.show.size", sb.getConfigBool("search.result.show.size", false) ? 1 : 0);
prop.put("search.result.show.metadata", sb.getConfigBool("search.result.show.metadata", false) ? 1 : 0);
prop.put("search.result.show.parser", sb.getConfigBool("search.result.show.parser", false) ? 1 : 0);
prop.put("search.result.show.pictures", sb.getConfigBool("search.result.show.pictures", false) ? 1 : 0);
prop.put("search.result.show.cache", sb.getConfigBool("search.result.show.cache", false) ? 1 : 0);
prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);
prop.put("search.result.show.tags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0);
prop.put("search.navigation.authors", sb.getConfig("search.navigation", "").indexOf("authors",0) >= 0 ? 1 : 0);
prop.put("search.navigation.namespace", sb.getConfig("search.navigation", "").indexOf("namespace",0) >= 0 ? 1 : 0);
prop.put("search.navigation.topics", sb.getConfig("search.navigation", "").indexOf("topics",0) >= 0 ? 1 : 0);
prop.put("search.verify.nocache", sb.getConfig("search.verify", "").equals("nocache") ? 1 : 0);
prop.put("search.verify.iffresh", sb.getConfig("search.verify", "").equals("iffresh") ? 1 : 0);
prop.put("search.verify.ifexist", sb.getConfig("search.verify", "").equals("ifexist") ? 1 : 0);
prop.put("search.verify.cacheonly", sb.getConfig("search.verify", "").equals("cacheonly") ? 1 : 0);
prop.put("search.verify.false", sb.getConfig("search.verify", "").equals("false") ? 1 : 0);
prop.put("search.verify.delete", sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true) ? 1 : 0);
prop.put("about.headline", sb.getConfig("about.headline", ""));
prop.put("about.body", sb.getConfig("about.body", ""));
prop.put("search.excludehosts", sb.getConfig("search.excludehosts", ""));
prop.put("search.excludehosth", sb.getConfig("search.excludehosth", ""));
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
prop.put("popupFront", 0);
prop.put("popupSearch", 0);
prop.put("popupInteractive", 0);
prop.put("popupStatus", 0);
if (browserPopUpPage.startsWith("index")) {
prop.put("popupFront", 1);
} else if (browserPopUpPage.startsWith("yacysearch")) {
prop.put("popupSearch", 1);
} else if (browserPopUpPage.startsWith("yacyinteractive")) {
prop.put("popupInteractive", 1);
} else {
prop.put("popupStatus", 1);
}
prop.put("maximumRecords", sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10));
final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self");
prop.put("target_selected_blank", "_blank".equals(target) ? 1 : 0);
prop.put("target_selected_self", "_self".equals(target) ? 1 : 0);
prop.put("target_selected_parent", "_parent".equals(target) ? 1 : 0);
prop.put("target_selected_top", "_top".equals(target) ? 1 : 0);
prop.put("target_selected_searchresult", "searchresult".equals(target) ? 1 : 0);
final String target_special = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self");
prop.put("target_selected_special_blank", "_blank".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_self", "_self".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_parent", "_parent".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_top", "_top".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0);
prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, ""));
String myaddress = (sb.peers == null) ? null : sb.peers.mySeed() == null ? null : sb.peers.mySeed().getPublicAddress();
if (myaddress == null) {
myaddress = "localhost:" + sb.getConfig("port", "8090");
}
prop.put("myaddress", myaddress);
return prop;
}
}
// ConfigPortal.java
// -----------------------
// part of YaCy
// (C) by Michael Peter Christen; mc@yacy.net
// first published on http://yacy.net
// Frankfurt, Germany, 4.7.2008
//
//$LastChangedDate$
//$LastChangedRevision$
//$LastChangedBy$
//
// LICENSE
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.data.meta.DigestURI;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
import net.yacy.server.http.HTTPDFileHandler;
public class ConfigPortal {
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
if (post != null) {
// AUTHENTICATE
if (!sb.verifyAuthentication(header)) {
// force log-in
prop.authenticationRequired();
return prop;
}
if (post.containsKey("popup")) {
final String popup = post.get("popup", "status");
if ("front".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html");
} else if ("search".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html");
} else if ("interactive".equals(popup)) {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html");
} else {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
}
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"));
HTTPDFileHandler.initDefaultPath();
}
if (post.containsKey("searchpage_set")) {
final String newGreeting = post.get(SwitchboardConstants.GREETING, "");
// store this call as api call
sb.tables.recordAPICall(post, "ConfigPortal.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting);
sb.setConfig(SwitchboardConstants.GREETING, newGreeting);
sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, post.get(SwitchboardConstants.GREETING_HOMEPAGE, ""));
sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, post.get(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));
sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, post.get("target", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, post.get("target_special", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, post.get("target_special_pattern", "_self"));
sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10));
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));
HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, "");
sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu"));
sb.setConfig("publicSearchpage", !post.containsKey("publicSearchpage") || post.getBoolean("publicSearchpage"));
sb.setConfig("search.options", post.getBoolean("search.options"));
sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon"));
sb.setConfig("search.text", post.getBoolean("search.text"));
sb.setConfig("search.image", post.getBoolean("search.image"));
sb.setConfig("search.audio", post.getBoolean("search.audio"));
sb.setConfig("search.video", post.getBoolean("search.video"));
sb.setConfig("search.app", post.getBoolean("search.app"));
sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date"));
sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size"));
sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata"));
sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser"));
sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures"));
sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache"));
sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy"));
sb.setConfig("search.result.show.hostbrowser", post.getBoolean("search.result.show.hostbrowser"));
sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete"));
sb.setConfig("about.headline", post.get("about.headline", ""));
sb.setConfig("about.body", post.get("about.body", ""));
String excludehosts = post.get("search.excludehosts", "");
sb.setConfig("search.excludehosts", excludehosts);
sb.setConfig("search.excludehosth", DigestURI.hosthashes(excludehosts));
// construct navigation String
String nav = "";
if (post.getBoolean("search.navigation.hosts")) nav += "hosts,";
if (post.getBoolean("search.navigation.authors")) nav += "authors,";
if (post.getBoolean("search.navigation.namespace")) nav += "namespace,";
if (post.getBoolean("search.navigation.topics")) nav += "topics,";
if (nav.endsWith(",")) nav = nav.substring(0, nav.length() - 1); sb.setConfig("search.navigation", nav);
}
if (post.containsKey("searchpage_default")) {
sb.setConfig(SwitchboardConstants.GREETING, "P2P Web Search");
sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, "http://yacy.net");
sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "/env/grafics/YaCyLogo_120ppi.png");
sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "/env/grafics/YaCyLogo_60ppi.png");
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, "");
HTTPDFileHandler.indexForward = "";
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self");
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self");
sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "");
sb.setConfig("publicTopmenu", true);
sb.setConfig("publicSearchpage", true);
sb.setConfig("search.navigation", "hosts,authors,namespace,topics");
sb.setConfig("search.options", true);
sb.setConfig("interaction.userlogon.enabled", false);
sb.setConfig("search.text", true);
sb.setConfig("search.image", true);
sb.setConfig("search.audio", false);
sb.setConfig("search.video", false);
sb.setConfig("search.app", false);
sb.setConfig("search.result.show.date", true);
sb.setConfig("search.result.show.size", false);
sb.setConfig("search.result.show.metadata", false);
sb.setConfig("search.result.show.parser", false);
sb.setConfig("search.result.show.pictures", false);
sb.setConfig("search.result.show.cache", true);
sb.setConfig("search.result.show.proxy", false);
sb.setConfig("search.result.show.hostbrowser", true);
sb.setConfig("search.result.show.tags", false);
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh");
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");
sb.setConfig("about.headline", "");
sb.setConfig("about.body", "");
sb.setConfig("search.excludehosts", "");
sb.setConfig("search.excludehosth", "");
}
}
prop.putHTML(SwitchboardConstants.GREETING, sb.getConfig(SwitchboardConstants.GREETING, ""));
prop.putHTML(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));
prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, ""));
prop.put("publicTopmenu", sb.getConfigBool("publicTopmenu", false) ? 1 : 0);
prop.put("publicSearchpage", sb.getConfigBool("publicSearchpage", false) ? 1 : 0);
prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0);
prop.put("interaction.userlogon", sb.getConfigBool("interaction.userlogon.enabled", false) ? 1 : 0);
prop.put("search.text", sb.getConfigBool("search.text", false) ? 1 : 0);
prop.put("search.image", sb.getConfigBool("search.image", false) ? 1 : 0);
prop.put("search.audio", sb.getConfigBool("search.audio", false) ? 1 : 0);
prop.put("search.video", sb.getConfigBool("search.video", false) ? 1 : 0);
prop.put("search.app", sb.getConfigBool("search.app", false) ? 1 : 0);
prop.put("search.result.show.date", sb.getConfigBool("search.result.show.date", false) ? 1 : 0);
prop.put("search.result.show.size", sb.getConfigBool("search.result.show.size", false) ? 1 : 0);
prop.put("search.result.show.metadata", sb.getConfigBool("search.result.show.metadata", false) ? 1 : 0);
prop.put("search.result.show.parser", sb.getConfigBool("search.result.show.parser", false) ? 1 : 0);
prop.put("search.result.show.pictures", sb.getConfigBool("search.result.show.pictures", false) ? 1 : 0);
prop.put("search.result.show.cache", sb.getConfigBool("search.result.show.cache", false) ? 1 : 0);
prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);
prop.put("search.result.show.hostbrowser", sb.getConfigBool("search.result.show.hostbrowser", false) ? 1 : 0);
prop.put("search.result.show.tags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0);
prop.put("search.navigation.authors", sb.getConfig("search.navigation", "").indexOf("authors",0) >= 0 ? 1 : 0);
prop.put("search.navigation.namespace", sb.getConfig("search.navigation", "").indexOf("namespace",0) >= 0 ? 1 : 0);
prop.put("search.navigation.topics", sb.getConfig("search.navigation", "").indexOf("topics",0) >= 0 ? 1 : 0);
prop.put("search.verify.nocache", sb.getConfig("search.verify", "").equals("nocache") ? 1 : 0);
prop.put("search.verify.iffresh", sb.getConfig("search.verify", "").equals("iffresh") ? 1 : 0);
prop.put("search.verify.ifexist", sb.getConfig("search.verify", "").equals("ifexist") ? 1 : 0);
prop.put("search.verify.cacheonly", sb.getConfig("search.verify", "").equals("cacheonly") ? 1 : 0);
prop.put("search.verify.false", sb.getConfig("search.verify", "").equals("false") ? 1 : 0);
prop.put("search.verify.delete", sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true) ? 1 : 0);
prop.put("about.headline", sb.getConfig("about.headline", ""));
prop.put("about.body", sb.getConfig("about.body", ""));
prop.put("search.excludehosts", sb.getConfig("search.excludehosts", ""));
prop.put("search.excludehosth", sb.getConfig("search.excludehosth", ""));
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
prop.put("popupFront", 0);
prop.put("popupSearch", 0);
prop.put("popupInteractive", 0);
prop.put("popupStatus", 0);
if (browserPopUpPage.startsWith("index")) {
prop.put("popupFront", 1);
} else if (browserPopUpPage.startsWith("yacysearch")) {
prop.put("popupSearch", 1);
} else if (browserPopUpPage.startsWith("yacyinteractive")) {
prop.put("popupInteractive", 1);
} else {
prop.put("popupStatus", 1);
}
prop.put("maximumRecords", sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10));
final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self");
prop.put("target_selected_blank", "_blank".equals(target) ? 1 : 0);
prop.put("target_selected_self", "_self".equals(target) ? 1 : 0);
prop.put("target_selected_parent", "_parent".equals(target) ? 1 : 0);
prop.put("target_selected_top", "_top".equals(target) ? 1 : 0);
prop.put("target_selected_searchresult", "searchresult".equals(target) ? 1 : 0);
final String target_special = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self");
prop.put("target_selected_special_blank", "_blank".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_self", "_self".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_parent", "_parent".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_top", "_top".equals(target_special) ? 1 : 0);
prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0);
prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, ""));
String myaddress = (sb.peers == null) ? null : sb.peers.mySeed() == null ? null : sb.peers.mySeed().getPublicAddress();
if (myaddress == null) {
myaddress = "localhost:" + sb.getConfig("port", "8090");
}
prop.put("myaddress", myaddress);
return prop;
}
}

@ -156,9 +156,11 @@ function updatepage(str) {
<div style="width:80px; text-align:right; float: left; white-space:nowrap; overflow:hidden;">#[count]# URLs</div>
</div>
#{/list}#
#(admin)#::
<p style="clear:both"><br/>
<img src="/WebStructurePicture_p.png?host=#[host]#&depth=3&width=1024&height=576&nodes=200&time=1000&colortext=888888&colorback=FFFFFF&colordot0=1111BB&colordota=11BB11&colorline=222222&colorlineend=333333">
</p>
#(/admin)#
</fieldset>
#(/outbound)#
@ -183,4 +185,4 @@ function updatepage(str) {
#%env/templates/footer.template%#
</body>
</html>
</html>

@ -226,6 +226,7 @@ public class HostBrowser {
DigestURI uri = new DigestURI(path);
String host = uri.getHost();
prop.putHTML("outbound_host", host);
if (admin) prop.putHTML("outbound_admin_host", host); //used for WebStructurePicture_p link
prop.putHTML("inbound_host", host);
String hosthash = ASCII.String(uri.hash(), 6, 6);
String[] pathparts = uri.getPaths();

@ -31,8 +31,8 @@
#(showPictures)#::&nbsp;|&nbsp;<a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#">Pictures</a>#(/showPictures)#
#(showCache)#::&nbsp;|&nbsp;<a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)#
#(showProxy)#::&nbsp;|&nbsp;<a href="proxy.html?url=#[link]#" target="_blank">Augmented Browsing</a>#(/showProxy)#
#(showHostBrowser)#::&nbsp;|&nbsp;<a href="/HostBrowser.html?path=#[link]#"><img src="/env/grafics/minitree.png" width="15" height="8"/></a>#(/showHostBrowser)#
#(showTags)#::<br/><!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#&amp;url=#[url]#" -->#(/showTags)#
&nbsp;|&nbsp;<a href="/HostBrowser.html?path=#[link]#"><img src="/env/grafics/minitree.png" width="15" height="8"/></a>
</p>
</div>
::

@ -131,6 +131,7 @@ public class yacysearchitem {
prop.put("content_showPictures", sb.getConfigBool("search.result.show.pictures", true) ? 1 : 0);
prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) ? 1 : 0);
prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0);
prop.put("content_showHostBrowser", sb.getConfigBool("search.result.show.hostbrowser", true) ? 1 : 0);
prop.put("content_showTags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("content_authorized", authenticated ? "1" : "0");
final String urlhash = ASCII.String(result.hash());
@ -190,6 +191,7 @@ public class yacysearchitem {
prop.put("content_showMetadata_urlhash", resulthashString);
prop.put("content_showCache_link", resultUrlstring);
prop.put("content_showProxy_link", resultUrlstring);
prop.put("content_showHostBrowser_link", resultUrlstring);
prop.put("content_showParser_urlhash", resulthashString);
prop.put("content_showTags_urlhash", resulthashString);
prop.put("content_urlhexhash", Seed.b64Hash2hexHash(resulthashString));

Loading…
Cancel
Save