HV_handler.R

Uploaded by:acooper

              title.common<-"History Explorer"

# override the defaults. Set to NA to use defaults
#NB if these dates are not in the DB then limits based on the DB are used instead.
override.start.year<-NA
run.mode<-"simple"#simple = R plots, motion = Google motion chart

#for manual processing. Overridden when run as a service
entry.words<-""#testing times"
source.type<-"b"

if(exists("GET")){
  entry.words<-ifelse(is.null(GET$words),"",GET$words)
  source.type<-ifelse(is.null(GET$source_type),"b",GET$source_type)
}

entry.words<-unlist(strsplit(entry.words," "))
word.lists<-list((entry.words))
names(word.lists)<-entry.words[1]
do.groups<-length(entry.words)>0
set.name<-entry.words[1] #directory name

if(length(word.lists[[1]])>0){
#this code can cope with multiple word.lists but will only every have a single list from here
source("../../private/HV/HistoryVis.R")
#source("/data/user-data/acooper/public/services/private/HV/HistoryVis.R")

cat.radio<-function(name, value, sel=F){
  value<-gsub("-","",value)
  cat(paste("",value,"
", sep="")) } cat("
") cat(paste("", sep="")) cat(paste("", sep="")) cat("

Statistic:
") cat.radio("stat","docs", T) cat.radio("stat","freq") cat("


") cat("

") #here we use run.words, which may differ if some query terms had the same stem. len<-length(run.words) if(len>1){ cat("Drill-down:
") cat.radio("word","---all---",T) for(i in 1:len){ cat.radio("word",run.words[i]) } }else{ #a hidden field if only 1 word cat("") } cat("

") cat("
") }else{ cat("Please enter some query words") }