|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.makumba.devel.relations.RelationCrawler
public class RelationCrawler
This crawler looks for relations between Makumba files and stores them in a database table.
TODO keep a list of things that could not be analyzed (may it be entire files, or query strings etc
| Nested Class Summary | |
|---|---|
static class |
RelationCrawler.MakumbaRelatedFileFilter
A filenameFilter that accepts .jsp, .mdd and .java files, or directories. |
| Field Summary | |
|---|---|
protected static boolean |
subProcess
|
| Method Summary | |
|---|---|
protected void |
addJavaAnalysisError(String s)
|
protected void |
addJSPAnalysisError(String s,
Throwable t)
|
protected void |
addRelation(String fromFile,
String toFile,
String type,
Dictionary<String,Object> relationData)
Adds a relation which will later on be written to the database |
void |
crawl(String path)
Crawls through a file using the relation miners |
void |
deleteFileRelations(String relativePath)
Deletes the dependency relations of this file |
static String |
getDefaultTargetDatabase()
Gets the default target database, can be set using the org.makumba.devel.relations.databaseName JVM property. |
FileRelations |
getFileDependencies(String relativePath)
Gets the dependencies of a file, i.e. the JSP, Java and MDD files this file depends on |
FileRelations |
getFileDependents(String relativePath)
Gets the dependents of a file, i.e. the JSP, Java and MDD files that depend on this file |
Vector<String> |
getJavaAnalysisErrors()
|
Hashtable<String,Throwable> |
getJSPAnalysisErrors()
|
int |
getJSPCrawlCount()
|
static RelationCrawler |
getRelationCrawler(String webappRoot,
String targetDatabase,
boolean forcetarget,
String URLprefix,
String URLroot,
boolean relationTypeDetail)
Gets a RelationCrawler instance. |
String |
getTargetDatabaseName()
|
protected String |
getWebappRoot()
|
static void |
main(String[] args)
Extracts relations from a set of files. |
boolean |
wasCrawled()
Checks whether this webapp has already been crawled |
static void |
writeJSPAnalysisError(String fileName,
Hashtable<String,Throwable> analysisErrors,
int JSPCrawlCount)
|
void |
writeRelationsToDb(boolean updateExistingRelations)
Writes the relations to the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean subProcess
| Method Detail |
|---|
public static RelationCrawler getRelationCrawler(String webappRoot,
String targetDatabase,
boolean forcetarget,
String URLprefix,
String URLroot,
boolean relationTypeDetail)
webappRoot - the path to the root of the webapp that should be crawledtargetDatabase - the makumba name of the database the relations should be written to.forcetarget - indicates whether the target database should be forced: if set to true, even if relations were
previously written to another database, this will force writing them to the indicated databaseURLprefix - the prefix of the relation URL, e.g. "file://"URLroot - the root of the relation, e.g. a webapp namerelationTypeDetail - TODO
RelationCrawler instancepublic static String getDefaultTargetDatabase()
public String getTargetDatabaseName()
protected String getWebappRoot()
public Hashtable<String,Throwable> getJSPAnalysisErrors()
public int getJSPCrawlCount()
public Vector<String> getJavaAnalysisErrors()
protected void addJSPAnalysisError(String s,
Throwable t)
protected void addJavaAnalysisError(String s)
public static void writeJSPAnalysisError(String fileName,
Hashtable<String,Throwable> analysisErrors,
int JSPCrawlCount)
public static void main(String[] args)
args - the arguments needed to crawl: webappRoot destinationDb forceDatabase URLprefix URLroot [fileList]public void crawl(String path)
path - the path to the file
protected void addRelation(String fromFile,
String toFile,
String type,
Dictionary<String,Object> relationData)
toFile - the path to the file there is a relation withtype - TODOrelationData - the relation datapublic void writeRelationsToDb(boolean updateExistingRelations)
updateExistingRelations - if true, recomputes existing relations one by one, if
false, flush all the previous relationspublic boolean wasCrawled()
public void deleteFileRelations(String relativePath)
relativePath - the relative path to the filepublic FileRelations getFileDependencies(String relativePath)
relativePath - the relative path to the file, within the webapp root
FileRelations object containing all the dependencies, as well as their origin detailpublic FileRelations getFileDependents(String relativePath)
relativePath - the relative path to the file, within the webapp root
FileRelations object containing all the dependents, as well as their origin detail
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||