fr.paris.telecomParisTech.dbWEB.arcomem.wp5.appliocationAwareHelper.integration
Class ApplicationAwareHelperImpl

java.lang.Object
  extended by fr.paris.telecomParisTech.dbWEB.arcomem.wp5.appliocationAwareHelper.integration.ApplicationAwareHelperImpl
All Implemented Interfaces:
ApplicationAwareHelper

public class ApplicationAwareHelperImpl
extends Object
implements ApplicationAwareHelper

Implementation of ApplicationAwareHelper class Interface. It extract structured information from the Web page and return as a object of AugmentedDocument class to the caller.


Field Summary
static BlogHandler blogHandle
          An object of BlogHandler class.
static AppLevelHandler instance
          An object of AppLevelHandler class.
static Logger logger
          An object of log4j class.
static MicroBlogHandler microBlogHandle
          An object of MicroBlog class.
static SystemLevel system
          An object of SystemLevel class.
static WebForumHandler webForumHandle
          An object of WebForumHandler class.
static CommonUtil xpathInstance
          An object of CommonUtil class.
 
Fields inherited from interface eu.arcomem.framework.aahelper.ApplicationAwareHelper
KEY_APPLICATION_AWARE_HELPER_CLASS
 
Constructor Summary
ApplicationAwareHelperImpl()
          Sole constructor.
 
Method Summary
 void ApplicationAwareHelper()
          This method perform the main functionalities of Application-aware Helper Module.
 void checkBlogLevel()
          Try to detect the level of a blog type of Web application.
 void checkForumLevel()
          Try to detect the level of a Web forum type of Web application.
 void checkMicroBlogLevel()
          Try to detect the level of a Micro-Blog type of Web application.
 void closeSystem()
          Close the application-aware helper system.
 void detectForumLevel(String expression)
          This method calls another method (named detectWebForumlevel) to check whether a given Web page is a type of "list of forums".
static void detectPostLevel(String expression)
          This method calls another method (named detectWebForumlevel) to check whether a given Web page is a type of "Post level".
static void detectThreadLevel(String expression)
          This method calls another method (named detectWebthreadlevel) to check whether a given Web page is a type of "list of thread".
 AugmentedDocument extractStructuredInformation(String url, String content, List<String> outLinks)
          
 String replaceLineBreak(String html)
          Replaces existing Line breaks with "" in a given string.
static void searchAndExcuteBlogCrawlingActions()
          Search the related Blog list level crawling actions and execute them.
static void searchAndExcuteBlogPostCrawlingActions()
          Search the related individual blog level crawling actions and execute them.
static void searchAndExcuteForumCrawlingActions()
          Search the related forum level crawling actions and execute them.
static void searchAndExcuteMicroBlogCrawlingActions()
          Search the related post level crawling actions for Blog type CMS and execute them.
static void searchAndExcutePostCrawlingActions()
          Search the related Post level crawling actions and execute them.
static void searchAndExcuteThreadCrawlingActions()
          Search the related Thread level crawling actions and execute them.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blogHandle

public static BlogHandler blogHandle
An object of BlogHandler class.


instance

public static AppLevelHandler instance
An object of AppLevelHandler class.


logger

public static Logger logger
An object of log4j class.


microBlogHandle

public static MicroBlogHandler microBlogHandle
An object of MicroBlog class.


system

public static SystemLevel system
An object of SystemLevel class.


webForumHandle

public static WebForumHandler webForumHandle
An object of WebForumHandler class.


xpathInstance

public static CommonUtil xpathInstance
An object of CommonUtil class.

Constructor Detail

ApplicationAwareHelperImpl

public ApplicationAwareHelperImpl()
                           throws XPathExpressionException,
                                  XPathFactoryConfigurationException,
                                  ParserConfigurationException,
                                  SAXException,
                                  IOException
Sole constructor. (For invocation by subclass constructors, typically implicit.) It loads the System.

Throws:
XPathExpressionException
XPathFactoryConfigurationException
ParserConfigurationException
SAXException
IOException
Method Detail

ApplicationAwareHelper

public void ApplicationAwareHelper()
                            throws XPathFactoryConfigurationException,
                                   org.htmlcleaner.XPatherException,
                                   IOException,
                                   InterruptedException,
                                   XPathExpressionException,
                                   ParserConfigurationException,
                                   SAXException,
                                   gr.ntua.h2rdf.bytes.NotSupportedDatatypeException
This method perform the main functionalities of Application-aware Helper Module. It detects the Web Application, level of the Web application and execute the related crawling actions of the given Web page.

Throws:
XPathFactoryConfigurationException
org.htmlcleaner.XPatherException
IOException
InterruptedException
XPathExpressionException
ParserConfigurationException
SAXException
gr.ntua.h2rdf.bytes.NotSupportedDatatypeException

checkBlogLevel

public void checkBlogLevel()
                    throws XPathExpressionException,
                           IOException,
                           ParserConfigurationException,
                           SAXException,
                           org.htmlcleaner.XPatherException,
                           gr.ntua.h2rdf.bytes.NotSupportedDatatypeException
Try to detect the level of a blog type of Web application.

Throws:
XPathExpressionException
IOException
ParserConfigurationException
SAXException
org.htmlcleaner.XPatherException
gr.ntua.h2rdf.bytes.NotSupportedDatatypeException

checkForumLevel

public void checkForumLevel()
                     throws XPathExpressionException,
                            IOException,
                            ParserConfigurationException,
                            SAXException,
                            org.htmlcleaner.XPatherException,
                            gr.ntua.h2rdf.bytes.NotSupportedDatatypeException
Try to detect the level of a Web forum type of Web application.

Throws:
XPathExpressionException
IOException
ParserConfigurationException
SAXException
org.htmlcleaner.XPatherException
gr.ntua.h2rdf.bytes.NotSupportedDatatypeException

checkMicroBlogLevel

public void checkMicroBlogLevel()
                         throws XPathExpressionException,
                                IOException,
                                ParserConfigurationException,
                                SAXException,
                                org.htmlcleaner.XPatherException
Try to detect the level of a Micro-Blog type of Web application.

Throws:
XPathExpressionException
IOException
ParserConfigurationException
SAXException
org.htmlcleaner.XPatherException

closeSystem

public void closeSystem()
                 throws IOException
Close the application-aware helper system.

Throws:
IOException

detectForumLevel

public void detectForumLevel(String expression)
                      throws XPathExpressionException,
                             ParserConfigurationException,
                             SAXException,
                             IOException
This method calls another method (named detectWebForumlevel) to check whether a given Web page is a type of "list of forums".

Parameters:
expression - Xpath expression (for now as a string) to copy all Forum level detection rules from KB
Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException

detectPostLevel

public static void detectPostLevel(String expression)
                            throws XPathExpressionException,
                                   ParserConfigurationException,
                                   SAXException,
                                   IOException
This method calls another method (named detectWebForumlevel) to check whether a given Web page is a type of "Post level".

Parameters:
expression - Xpath expression (for now as a string) to copy all Forum level detection rules from KB
Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException

detectThreadLevel

public static void detectThreadLevel(String expression)
                              throws XPathExpressionException,
                                     ParserConfigurationException,
                                     SAXException,
                                     IOException
This method calls another method (named detectWebthreadlevel) to check whether a given Web page is a type of "list of thread".

Parameters:
expression - Xpath expression (for now as a string) to copy all Forum level detection rules from KB
Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException

extractStructuredInformation

public AugmentedDocument extractStructuredInformation(String url,
                                                      String content,
                                                      List<String> outLinks)

Specified by:
extractStructuredInformation in interface ApplicationAwareHelper

replaceLineBreak

public String replaceLineBreak(String html)
Replaces existing Line breaks with "" in a given string.

Parameters:
html - Html content
Returns:
return return Html content without line break

searchAndExcuteBlogCrawlingActions

public static void searchAndExcuteBlogCrawlingActions()
                                               throws XPathExpressionException,
                                                      ParserConfigurationException,
                                                      SAXException,
                                                      IOException,
                                                      org.htmlcleaner.XPatherException
Search the related Blog list level crawling actions and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException

searchAndExcuteBlogPostCrawlingActions

public static void searchAndExcuteBlogPostCrawlingActions()
                                                   throws XPathExpressionException,
                                                          ParserConfigurationException,
                                                          SAXException,
                                                          IOException,
                                                          org.htmlcleaner.XPatherException,
                                                          gr.ntua.h2rdf.bytes.NotSupportedDatatypeException
Search the related individual blog level crawling actions and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException
gr.ntua.h2rdf.bytes.NotSupportedDatatypeException

searchAndExcuteForumCrawlingActions

public static void searchAndExcuteForumCrawlingActions()
                                                throws XPathExpressionException,
                                                       ParserConfigurationException,
                                                       SAXException,
                                                       IOException,
                                                       org.htmlcleaner.XPatherException
Search the related forum level crawling actions and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException

searchAndExcuteMicroBlogCrawlingActions

public static void searchAndExcuteMicroBlogCrawlingActions()
                                                    throws XPathExpressionException,
                                                           ParserConfigurationException,
                                                           SAXException,
                                                           IOException,
                                                           org.htmlcleaner.XPatherException
Search the related post level crawling actions for Blog type CMS and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException

searchAndExcutePostCrawlingActions

public static void searchAndExcutePostCrawlingActions()
                                               throws XPathExpressionException,
                                                      ParserConfigurationException,
                                                      SAXException,
                                                      IOException,
                                                      org.htmlcleaner.XPatherException,
                                                      gr.ntua.h2rdf.bytes.NotSupportedDatatypeException
Search the related Post level crawling actions and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException
gr.ntua.h2rdf.bytes.NotSupportedDatatypeException

searchAndExcuteThreadCrawlingActions

public static void searchAndExcuteThreadCrawlingActions()
                                                 throws XPathExpressionException,
                                                        ParserConfigurationException,
                                                        SAXException,
                                                        IOException,
                                                        org.htmlcleaner.XPatherException
Search the related Thread level crawling actions and execute them.

Throws:
XPathExpressionException
ParserConfigurationException
SAXException
IOException
org.htmlcleaner.XPatherException