SPA Route

From Chorke Wiki
Revision as of 02:55, 6 November 2017 by Shahed (talk | contribs) (Created page with "__TOC__ == Single Page Application (SPA) Route == To make an '''Single Page Application (SPA)''' User Friendly, Robust and Simple, Routing is the main factor. Here is planin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Single Page Application (SPA) Route

To make an Single Page Application (SPA) User Friendly, Robust and Simple, Routing is the main factor. Here is planing and guide line to build and user friendly application. Simple URL/Token make the application simple for modern web application.

Config for Handle Server Side

//initialization
var CKi=CKi||{};

//ebis core context
CKi.ebis={
    getContexPath : function($, contextPath){
        $           = CKi.ebis.server;
        contextPath = $.protocol + '://' + $.host 
            + (!$.hasReverseProxy ? ':' + $.port : '')
            + '/'+ $.contextPath + '/' + $.language + '/';
        return contextPath;
    }
};

//ebis server context
CKi.ebis.server={
    hasReverseProxy : !0,
    contextPath     : 'ebis',
    language        : 'en',
    protocol        : 'http',
    host            : 'chorke.org',
    port            : '8080'
};


Config Modules, Submodules & Forms

CKi.ebis.modules = {
    M00 : 'system',        //token='system'
    M01 : 'security',      //token='security'
    M02 : 'resource',      //token='resource'
    M03 : 'human/resource' //token='human/resource'
};
CKi.ebis.subModules = {
    E : 'entries',  //token='entries'
    Q : 'queries',  //token='queries'
    R : 'reports',  //token='reports'
    S : 'settings', //token='settings'
    T : 'schedules' //token='schedules'
};
CKi.ebis.M03 = {
    E : {
        E03001 : {
            token : 'recruits',
            X01   : 'new',       //subForm='E03001X01', token='new'
            X02   : 'old'        //subForm='E03001X02', token='new'
        },
        E03002 : {
            token : 'allowance',
            X01   : 'ta',        //subForm='E03002X01', token='ta'
            X02   : 'da'         //subForm='E03002X02', token='da'
        },
        E03003 : 'performance',  //token='performance'
        E03004 : 'attendance',   //token='attendance'
        E03005 : 'payrolls'      //token='payrolls'
    },
    Q : {
        Q03001 : {
            token : 'recruits',
            X01   : 'new',       //subForm='Q03001X01', token='new'
            X02   : 'old'        //subForm='Q03001X02', token='old'
        },
        Q03002 : {
            token : 'allowance',
            X01   : 'ta',        //subForm='Q03002X01', token='ta'
            X02   : 'da'         //subForm='Q03002X02', token='da'
        },
        Q03003 : 'performance',  //token='performance'
        Q03004 : 'attendance',   //token='attendance'
        Q03005 : 'payrolls'      //token='payrolls'
    },
    R : {
        R03001 : {
            token : 'recruits',
            X01   : 'new',         //subForm='R03001X01', token='ta'
            X02   : 'old'          //subForm='R03001X02', token='ta'
        },
        R03002 : {
            token : 'allowance',
            X01   : 'ta',          //subForm='R03002X01', token='ta'
            X02   : 'da'           //subForm='R03002X02', token='ta'
        },
        R03003 : 'performance',    //token='performance'
        R03004 : 'attendance',     //token='attendance'
        R03005 : 'payrolls'        //token='payrolls'
    },
    S : {
        S02003 : 'gender',         //token='gender'
        S02004 : 'marital/status', //token='marital/status'
        S02005 : 'relation',       //token='relation'
        S02006 : 'religion',       //token='religion'
        S02007 : 'nationality'     //token='nationality'
    },
    T : {
        T05001 : 'appointment',    //token='appointment'
        T07001 : 'promotion'       //token='promotion'
    }
};