Package scone.proxy

This package contains the classes related to the proxy.

See:
          Description

Class Summary
AddPreambleEditor Adds a preamble to a Html-Document.
FixContentTypeEditor2  
GeneralResourceGenerator This meg is able to return documents to the browser.
HtmlTokenEditor The HtmlTokenEditor is a WBI MEG that allows for manipulating HTML documents in the HTTP-Response of the proxy.
NewServerRequestEditor This meg is able to return documents to the browser.
NewServerResponseEditor  
NoCacheMeg The NoCacheMeg is a WBI MEG that adds "NoCache" command in the header of the response of a server.
PageTimeoutMeg The PageTimeoutMeg is a WBI MEG that adds timeout commands to the header of the server response.
ParsingMeg transforms tokens into database objects.
Proxy the proxy class of the Scone framework.
ServerScoutLinkRewriter  
ServerSide This plugin enables the proxy to run as a web server
 

Package scone.proxy Description

This package contains the classes related to the proxy. IBM's WBI is used as a proxy and scone is a WBI-plugin.

Scone basically analyzes the streams which flow through the proxy: The AccessTrackingMeg identifies users and logs their actions. The TokenHandlerMeg and its StandardHtmlTokenHandler (see TokenHandlerController for the TokenHandler-Framework) analyze HTML documents and create corresponding net-objects (see the scone.netobjects package documentation).

Scone also may contain SconePlugin objects and offers them the following services:


SconePlugin objects are registered via the file scone/config/plugins.ini

This package also includes the Retriever class. This class can be used to fetch any document from the internet. It is designed especially for fetching and analyzing HTML documents.

example:

plugins.ini:

//leave exactly one space after plugin: !
plugin: scone.ObserverTest

scone/ObserverTest.java:


package scone;

import java.util.*;
import scone.netobjects.*;
import scone.proxy.*;

public class ObserverTest implements Observer, SconePluginInterface{

  public ObserverTest(){}

  //diese Methode ruft Scone bei allen plugins auf!
  public void init(Scone scone){
    //diesen Observer anmelden
    NetNodeCache.putObserver(this);
    HtmlNodeCache.putObserver(this);

    //alle 30 sekunden notifien
    HtmlNodeCache.setObservePeriod(1000*30);
  }


  //wir koennen davon ausgehen, dass o irgendein cache ist
  //und arg eine enumeration von netobjects...
  public void update(Observable o, Object arg){
    System.out.println("ObserverTest!");

    //yes, the NetNodeCache notifies us!
    if(o instanceof NetNodeCache){
      //just print all new NetNode objects to the screen
      for (Enumeration e = (Enumeration)arg; e.hasMoreElements() ;) {
        System.out.println("New NetNode: "+((NetNode)e.nextElement()).getUri());
      }
    }else{
      if(o instanceof HtmlNodeCache){
        //just print all new HtmlNode objects to the screen
        for (Enumeration e = (Enumeration)arg; e.hasMoreElements() ;) {
          System.out.println("New HtmlNode: "+((HtmlNode)e.nextElement()).getTitle());
        }
      }
    }
  }
}