Hi Friends,
Recently i moved to another project with Mark Logic but its kind of UI application. Where entire development of UI, business logic all is developed based on a framework which is known as XQuerrail framework which means to xquery on rail. Yes friends, Xquery is code language for development in this framework. And as i just shared that it is also termed as xquery on rail so i believe that this framework is running based on rail but i am not much familiar with rail.
So initial step for me was to configure development environment to run application based on xquerrail framework. Initially i thought it would be some installer as most of the windows user thinks but no when started exploring it i found that it is a directory based framework and also supports MVC pattern so has very specific naming conventions and folder structure etc.
I found some problems initially in it but later on tried to make it little simple for configuration and removed some/extra/optional steps which was confusing, so that at least we would be able to execute application on xquerrail framework.
So, Today i am not going to discuss about how to develop application in xquerrail framework but going to share about the requirements and steps that needed to configure framework and specifically application that would be using xquerrail framework to run.
Xquerrail framework (pronounced as ‘Squirrel’) - is an XQuery based rails framework for rapid application development
The XQuerrail framework is encapsulated in single folder that provides all the features. Below is the quick intro of directories available in framework
/base/ - It provides all the basic implementation for model, view and controllers.
/dispatchers/ - These are the relays that routes all the incoming requests and outgoing responses.
/engines/ - This folder contains all files/implementation for transformation and response rendering of views and controllers
/handlers/ - Handlers are responsible to compose the output for delivery for any public resource or non-controller requests.
/interceptors/ - Interceptors provides security, authorization and compression features
/helpers/ - Helpers are libraries with some powerful utilities that is usable with framework
/lib/ - Provides third party dependencies with xquery parsing library
/schemas/ - Contains schema definitions for all configuration files.
Now lets directly jump to environment configuration. Like other framework installation we have some prerequisites with this framework as well which are following
Prerequisites
1) Mark logic should be installed on your machine
2) NodeJS [1]. npm is used as package manager for xquerrail2.framework. Currently tested with v0.10.26.
3) Gulp [4]. It is used to build xuqerrail2.framework. Currently tested with 3.6.0
Now lets create folder structure and configure application to run on xquerrail framework
Instructions to install xquerrail framework
1) Create #project_home directory (Ex - D:\Project_Home)
2) Download xquerrail2.framework in project home directory from GIT or copy directly
a) open cmd command
b) go to #project_home directory and
run command - git clone https://github.com/nativelogix/xquerrail2.framework.git
this should create xquerrail2.framework in #project_home directory
3) Now install xquerrail2.framework throught navigating to #project_home/xquerrail2.framework in cmd and then execute following command
a) npm install
b) gulp update-xqy (this will create dist folder with latest _framework files after comparing with /src/main/_framework/), This command is used to compile framework level changes and contains latest framework files in dist folder.
c) copy and paste "src" folder from "/xquerrail2.framework/" to "#project_home/poc/"
c) copy and paste "_framework" folder from "/xquerrail2.framework/dist/" to "#project_home/poc/src/main/"
d) Rename "app-test" folder to "app" in "#project_home/poc/src/main/"
Instructions to configure application database (Mark Logic)
1) Create database/forests and attach them
2) Create app servers - XDBC and http server with database as created in above step and select “(file system)” as modules. Suppose http server port is 9300.
3) Root in http server should be "#project_home/poc/src/"
4) Update URL Rewriter setting to "/main/_framework/rewriter.xqy" in http app server
Instructions to configure application configuration
1) Open application-domain in "#project_home/poc/src/main/app/domains/" and update all instance of "app-test" to "app" .
2) Open default-controller in "#project_home/poc/src/main/app/controllers/" and update all instance of "app-test" to "app" .
3) update application from "app-test" to "app" in folder "#project_home/poc/src/main/_config/" for following files
a) routes.xml
b) ml-security.xml
c) config.xml
Access application through http server configured on port (as taken as example in above 9300)
Go to browser and browse http://localhost:9300/initialize.xqy to initialize your application as configured through above steps then browse http://localhost:9300/ to access your application. Default page will appear with welcome message.
So, that’s all about installation of xquerrail framework and application configuration to run on it.
Now for how to code logic to create application with xquerrail framework using provided MVC pattern , you can continue to explore xquerrail framework and can refer references shared by me to understand various available options, configurations to create application.
I will try to share a quick view to create small application with xquerrail framework in near future. Till than keep exploring.
References
https://github.com/nativelogix/xquerrail2/wiki/Application
https://github.com/nativelogix/xquerrail2/wiki/Getting-Started
No comments:
Post a Comment