Main features

Facades

Facade is a utility class for accessing attributes prepared by Acornsnap. If you use it, you don't need to remember the name of attributes(to put it the other way around, is that all).

  • ApplicationFacade - Supports accessing Application Scope attributes.
  • UserFacade - Supports accessing Session(=User) Scope attributes.

Reserved attributes

Attrubutes used in acornsnap. Attribute is the value which can be fetched by 'getAttribute' method in some object(ServletContext,HttpSession and HttpServletRequest). Attributes in 'Application scope' are initialized at the context is starting up by ApplicationListner. Other attributes are set arbitrarily.

  • Application scope
    • acornsnap.cas :AuthFilter.CasInfo[] - Information of CAS servers.
    • acornsnap.database :DatabaseFacade - Database used by the application.
    • acornsnap.executor :ExecutorService - SingleThreadExecutor is ready to use.
    • acornsnap.parser.wiki :DefaultWikiParser -
    • acornsnap.parser.macro :DefaultMacroParser -
    • acornsnap.properties :SnapProperties - Some properties.
    • acornsnap.runlevel :String - Some one of none,development,test,product.
    • acornsnap.scheduled_executor :ScheduledExecutorService - An ExecutorService that can schedule commands to run after a given delay, or to execute periodically.
    • acornsnap.version_of_classes :AbstractReleaseNotes - Version of the class files.
    • acornsnap.version_of_templates :String - Version of the template files(you can see it in acornsnap.xml).
    • acornsnap.{Name of Controller}.* :Object - Used for the controller independent attributes.
  • Session(=User) scope
    • acornsnap.current_model :ActiveRecord - Current editing model. (Maybe, it will be deprecated.)
    • acornsnap.flash.error :List<Elements> - Error messages.
    • acornsnap.flash.warning :List<Elements> - Warning messages.
    • acornsnap.flash.notice :List<Elements> - Notice messages.
    • acornsnap.flash.ttl :Integer - Time to live of all flashes.
    • acornsnap.locale :Locale - User's locale. Default is same as request.getLocale().
    • acornsnap.principal :SnapPrincipal - User's principal.
    • acornsnap.{Name of Controller}.* :Object - Used for the controller independent attributes.
  • Request scope
    • acornsnap.action.path :ActionPath - Path indicates current action.
    • acornsnap.views.body :String - Path indicates the view.
    • acornsnap.views.snap :SnapModel - Snap. If requested path has no data, value is null.

Reserved properties

Followings are the constants determining acornsnap. They are defined in 'WEB-INF/acornsnap.xml( dtd)'.

  • acornsnap.access_log.enable - Whether the access logger is enabled, default is true.
  • acornsnap.access_log.retention_period - Days for preserving access logs, default is 30(days).
  • acornsnap.application.retention_period - Days for preserving appication flows, default is 30(days).
  • acornsnap.admin.start - The rolename required when the application initialized.
  • acornsnap.backup.interval - Interval(days) for running backup task, default is 1(day).
  • acornsnap.backup.max_of_files - Max number of backup(zip) files stored in the exported folder.
  • acornsnap.backup.start_time - The time to starting backup task, default is 02:00(AM).
  • acornsnap.blank.version - Version of the template fieles(you can refer it in Application scope).
  • acornsnap.cas.X - Cas server url(X is a number starting from 0).
  • acornsnap.init.role - The rolename required when the application initialized.
  • acornsnap.smtp.host - The host address where sendmail daemon is running, default is localhost.
  • database.user - Username for connecting to database.
  • database.pass - Password for commecting to database.
  • database.path - Pathname for storeing database entity, default is '~/WEB-INF/db'.

Reserved files

Acornsnap requires and expects some files and folders to determine the behavior of context. In Eclipse(JEE), these are placed in WebContent folder.

vendors/
The files used commonly are placed here. For example JavaScript Libraries, icons of indicator and button images for Java are here.
WEB-INF/db/
Database difinition files(*.sql) are placed here. The files(named *.sql) are executed in alphabetic order when the context start up without database(equals to first boot). And it's important to remember that the entity of H2 Database (*.db files) are created here.
WEB-INF/layouts/
JSP files used as layout are placed here.
WEB-INF/layouts/acornsnap/
Layout files used by Acornsnap. You should NOT modify these files.
WEB-INF/views/
JSP files used as View(of MVC) are placed here.
WEB-INF/views/acornsnap/
View files used by Acornsnap. You should NOT modify these files.
WEB-INF/acornsnap.xml
Properties kept in acornsnap.properties attribute are written here.
WEB-INF/web.xml
Deployment discriptor. Acornsnap never uses it(because already registerd in ServletContailer(=Tomcat)'s web.xml). You can modify it freely.

Reserved (Java's)Packages

  • controllers.* - Controllers(of MVC). If the class in this package extends AbstractController, the class will be activated by request. For detail, see  Javadoc for AbstractController.
  • helpers.* - Any utility classes. And if the class which named 'Initializer' and implements 'AbstractInitializer' is exist, the class will be invoked at the context startup.
  • models.* - Models(of MVC).

Attachments