Defines a page block to be "defined" on the fly at runtime
For example blah will be replaced by the data provided
in the view element with dataId "toto" if it exists.
Defines an HTML tag to be "redefined" on the fly at runtime
For example , content will be replaced by the data provided
in the view element with dataId "toto" if it exists.
Use this to run an Exception test
You should create a test method that throws the exception you want to test
And call this to test the exception is indeed thrown
ie: checkThrowsException(java.lang.NullPointerException.class,"myExceptionTestMethod",null);
Your implementation should create return a JOTFileBrowserSession,
which basically tells the FileBrowser how to behave, what to allow and what is expected of the user.
Define a field of the form (name/field type)
You should define all the types you want to use / see in the html form
Typically you make calls to this method from within init()
This is here, if you want to make manual custom SQL calls not covered by the other methods
NOTE: your request MUST return records matching your model. THIS IS ONLY SUPPORTED WITH THE SQL Model (JOTDBModel)
return the color depth in bits (ie: how big the palette needs to be)
ie:
1: 2 colors or less
4: 16 colors or less
8: 256 colors or less
16: 65536 colors or less
24: 16 777 216 colors or less
32: > 16 777 216 colors
resource intensive
Note: maxColors, is the maximum you want to look for, if more that "maxColor" colors are found, an exception will be thrown.
Return a file handle(JOTMultiPartItem) from the request(multipart request) for an uploaded file, which you can then save somewhere
NOTE: parseMultiPartContent() MUST have been called first otherwise it will return nothing(null).
For a file returns the name of the file provided by the user
Note: some browsers give a full path, some others give only the file name (no path)
you probably want to use getFileName() instead;
use this method to get/create a form object
Will provide either :
- a new form object if this form is newly used
- the existing form if used earlier in this request
(ie: validation failed)
This allows you to get the form and put it in the View, or to populate/validate it in your controller.
use this method to get/create a form object
Will provide either :
- a new form object if this form is newly used
- the existing form if used earlier in this request
(ie: validation failed)
This allows you to get the form and put it in the View, or to populate/validate it in your controller.
Return an array of Integer[], containing the line number(s) where the keyword was found in the specified file(identified by it's id)
If a keyword is on the same line twice, that line number will be in the array twice
Add a keyword to the index
id: id of the key in index.txt
word: the keyword to be indexed
lines: vector of line numbers
return: wether it was a new keyword or not
You can use this method to set initial form values (Called the first time the form is created)
Ex: defineField("name", JOTFormConst.TEXTAREA); get("fname").setValue("toto");
Returns wether the parsing of flow.conf fails
Note: this does not run the extra validations in runValidation(), so usually would be called after runValidation()
The token is here for security reasons, so that somebody can't fake the form request and change a different DB entry than the one he is suppose to be editing
Object representing a permission set (a.k.a profile) in DB
The dataProfile is basically used to map a user to a set of permissions
The dataProfile name should be unique.
1 liner templates are generated using the "main" here from the templates in the "templates" folder
Those are just some JOT default/failover templates used when the user did not defined his own.
Extends this generic class to implement a Controller
The Controller is here to process a request (do the logic required to process it)
It gives you easy access to the following objects:
request,response,session.
This form helps into automatically generating/parsing an HTMl form to/From a Database entry(DB Model)
It allows for simple CRUD actions on a db object.
This is an implementation of a database connection pooling system
It manages connections, adds some when needed, and periodically
check there status and renew them is they appear corrupt/hung.
Implementation of The Query Interface for an SQL database.
Handle all the SQL CRUD functions
Transforms DB java objects into actual SQL queries string and back.
Default search sorter
Sorting results by score / hits
if all keywords are found in the page then you get maximum score(10/10)
each time one of the keyword is found in the page it counts as a "hit"
also finds the best line in the file(most keywords) can be use to show an abstract
Generic class for handling HTML forms (validate, save the values when validation fail etc...)
You probably will want to use one of the subclass rather than this directly: ie: JOTGeneratedForm, JOTDBForm etc...
Generator: the generator that will be used to generate the image, when captchcaUrl is called
This is used to show in the help which chars might be used in the captcha
RadioButton type field
Note than "radioName" is the name of the radio button in html(used to group radios together):
Ex input type="radio" name="radioName"
Implementation of The Query Interface for an the JOT FSDB database.
Handle all the CRUD functions
We use an "index" file to speed up things and cleanup data file during vacuum
Implements a simple/generic user message View
The request should provide the attributes MESSAGE_TITLE,MESSAGE_TEXT,MESSAGE_LINK
The view implementation will then use link,message and title and a template to render the message to the user.
This class is designed to parse a request coming from a multipart encoded form (ie: file upload form)
This does not support the full multipart spec, but support mixed form fields and files (multiple ok).
Generic class that provides easy mapping of a property file to a form
This allow for an easy "setup form" where as the setup options are stored in a property file.
This is the "Main" Object for retrieving records from the persistance/database.
Ie: Vector users=JOTQueryManager.findUsingSQL(User.class, "SELECT * FROM mytable", null);
Use to "throttle" requests
You create a counter with a unique name and how many minutes it stores data for (in memory)
then call addRequest() to count how many request for this IP, in the time span.
Extension of JOTFlowRequest allowing rewriting of the request URL "on the fly" without loosing the original request and associated parameters/attributes
The original request is "wrapped" in a new request with the url, manipulated
Represented an entry of the sorted search result (ie: a file)
This is of type hashtable, so that a user writing it's own JOTSearchsorter implementation could add it's own extra element data
My own captcha impl, called "drunk" because of the way the letters look (wavy)
Generate 200x60 captcha containing 5 characters
characters used are listed in CHARS (others can be confusing)
Background of image is white
Characters use Random colors
We add some random lines of the same color as the characters to the background(1 pixel thick)
Characters "size" varies a bit between (scale: 3 to 5)
Characters lines thickness vary from 3 to 5
Characters are drown using "wavy" lines (wavyness: 1 to 4)
Wavy lines will also have holes in them (sometimes)
This is the Main class of the "Tester"
The Tester is used to run all the test code you added in your own classes.
You add test code to your own classes by implementing :
public static void jotTest() throws Throwable {}
You can run the tester either by using this class "Main method" or using the Ant task provided.
Note: you could also run this class from your own java code if you wanted to.
Call the -help option to get more infos.
This is the equivalent of the nextval function on many database (ex:postgresql sequence)
This is use to have a safe incremental counter(usually a primary key / ID).
This is the implementaion of the "meat" of your controller, where the controller does it's stuff (logic)
Thta should return a result code, either a standard one.
This is a dummy controller that just does nothing but print a debug message to the log file when called
Used for testing or as atemporary controller until a real one is written.
It's is best/much safer to use query(con,query,params) as the parameters will be safely formatted for you (for example quotes in parameter values issues etc...)
The query is gonna be something like "get * from toto where id=5"
Special return code used for for a controller that will be called many times until ity his considered "completed"
For example the Filemanager where you can browse around until you pick a file(completed)
Runs a validation of the loaded flow.conf, calls setValidationError if an error is found
Checks that view/controller/forms classes exists and are of right type etc...
If set to false, the save() method will NOT save this field
Use to have a form field that you don't want to save (or not as part of the save() method at least)
The Standard java response.sendredirect tries to rebuild the full URL using the servlet path
This will not work with java behind a proxy (since it will use the proxy path rather than vanity URL)
So here we just send a simple (possibly relative) URL.
Request a run "right now"
Very much like an unix cron line
But the order is different:
Month(o=january) Day(1=1st) DayOfWeek(0=sunday) Hour Minute
'* * * 5,14 0' any day at 5:00 AM and 2:00 PM
'* * * 5,14 8' any day at 5:08 AM and 2:08 PM
'* * 0 0 0' any sunday at 00:00 AM
'* 1 * 0 0' any 1st of the month at 00:00 AM
'* 13 5 0 0' any Friday the 13th at 00:00AM
'* * * * *' any minute of any day.
'0 * * * *' any minute of any day in January
'2 13 5 0 0' Friday the 13th in March at 00:00 AM";
Easy way to set the value of an element
for example for most fields it's the value="" property
but for a textarea it will be the content
and for a checkbox a SELECTED flag etc...
Unzip z zip file in the given folder (recursively);
Retrieve is use as this
if retrieve is set to ".swf", the last file found
ending by .swf will be returned.
Similar to query(con,query,params) but for the sql "update"
Update is NOT used to make an "SQL update" (confusing name :-)
But usually used to make a query which no result are expected such as an
SQL "insert" command.
It's is best/much safer to use update(con,query,params) as the parameters will be safely formatted for you (for example quotes in parameter values issues etc...)