| 1 |
- MWF.xApplication.File.Actions=MWF.xApplication.File.Actions||{};MWF.xDesktop.requireApp("Common","Actions.RestActions",null,false);MWF.xApplication.File.Actions.RestActions=new Class({Extends:MWF.xApplication.Common.Actions.RestActions,initialize:function(){this.parent();MWF.getJSON("/x_component_File/Actions/action.json",function(t){this.fileActions=t}.bind(this),false)},getDesignAddress:function(t,e){this.designAddress="http://xa01.zoneland.net:9080/x_file_service_control";if(t)t.apply()},_listTopFolder:function(t,e){var i=this.designAddress+this.fileActions.listFolderTop;var n=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(i,n)},listTopFolder:function(t,e){this.request(t,e,"listTopFolder")},_listSubCompany:function(t,e,i){var n=this.designAddress+this.organizationActions.getSubCompanyDirect;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listSubCompany:function(t,e,i){this.request(t,e,"listSubCompany",i)},_listDepartment:function(t,e,i){var n=this.designAddress+this.organizationActions.listDepartmentDirect;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listDepartment:function(t,e,i){this.request(t,e,"listDepartment",i)},_listSubDepartment:function(t,e,i){var n=this.designAddress+this.organizationActions.getSubDepartmentDirect;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listSubDepartment:function(t,e,i){this.request(t,e,"listSubDepartment",i)},_listCompanyDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.listCompanyDuty;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listCompanyDuty:function(t,e,i){this.request(t,e,"listCompanyDuty",i)},_listDepartmentDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.listDepartmentDuty;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listDepartmentDuty:function(t,e,i){this.request(t,e,"listDepartmentDuty",i)},_listCompanyDutyByIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.listCompanyDutyByIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listCompanyDutyByIdentity:function(t,e,i){this.request(t,e,"listCompanyDutyByIdentity",i)},_listDepartmentDutyByIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.listDepartmentDutyByIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listDepartmentDutyByIdentity:function(t,e,i){this.request(t,e,"listDepartmentDutyByIdentity",i)},_listCompanyAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.listCompanyAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listCompanyAttribute:function(t,e,i){this.request(t,e,"listCompanyAttribute",i)},_listDepartmentAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.listDepartmentAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listDepartmentAttribute:function(t,e,i){this.request(t,e,"listDepartmentAttribute",i)},_listIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.listIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listIdentity:function(t,e,i){this.request(t,e,"listIdentity",i)},_listIdentityByPerson:function(t,e,i){var n=this.designAddress+this.organizationActions.listIdentityByPerson;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listIdentityByPerson:function(t,e,i){this.request(t,e,"listIdentityByPerson",i)},_listGroupNext:function(t,e,i){var n=this.designAddress+this.organizationActions.listGroupNext;n=n.replace(/{id}/g,i.last?i.last:"(0)");n=n.replace(/{count}/g,i.count?i.count:"20");var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listGroupNext:function(t,e,i,n){this.request(i,n,"listGroupNext",{last:t,count:e})},_listRoleNext:function(t,e,i){var n=this.designAddress+this.organizationActions.listRoleNext;n=n.replace(/{id}/g,i.last?i.last:"(0)");n=n.replace(/{count}/g,i.count?i.count:"20");var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listRoleNext:function(t,e,i,n){this.request(i,n,"listRoleNext",{last:t,count:e})},_listPersonNext:function(t,e,i){var n=this.designAddress+this.organizationActions.listPersonNext;n=n.replace(/{id}/g,i.last?i.last:"(0)");n=n.replace(/{count}/g,i.count?i.count:"20");var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listPersonNext:function(t,e,i,n){this.request(i,n,"listPersonNext",{last:t,count:e})},_listPersonAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.listPersonAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},listPersonAttribute:function(t,e,i){this.request(t,e,"listPersonAttribute",i)},_getIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.getIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getIdentityNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getIdentity:function(t,e,i,n){if(n!=false){this.request(t,e,"getIdentity",i)}else{this.request(t,e,"getIdentityNotAsync",i)}},_getPersonByKey:function(t,e,i){var n=this.designAddress+this.organizationActions.getPersonByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getPersonByKeyNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getPersonByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getPersonByKey:function(t,e,i,n){if(n!=false){this.request(t,e,"getPersonByKey",i)}else{this.request(t,e,"getPersonByKeyNotAsync",i)}},_getRoleByKey:function(t,e,i){var n=this.designAddress+this.organizationActions.getRoleByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getRoleByKeyNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getRoleByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getRoleByKey:function(t,e,i,n){if(n!=false){this.request(t,e,"getRoleByKey",i)}else{this.request(t,e,"getRoleByKeyNotAsync",i)}},_getPerson:function(t,e,i){var n=this.designAddress+this.organizationActions.getPerson;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getPersonNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getPerson;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getPerson:function(t,e,i,n){if(n!=false){this.request(t,e,"getPerson",i)}else{this.request(t,e,"getPersonNotAsync",i)}},_getDepartment:function(t,e,i){var n=this.designAddress+this.organizationActions.getDepartment;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getDepartmentNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getDepartment;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getDepartment:function(t,e,i,n){if(n!=false){this.request(t,e,"getDepartment",i)}else{this.request(t,e,"getDepartmentNotAsync",i)}},_getCompany:function(t,e,i){var n=this.designAddress+this.organizationActions.getCompany;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getCompanyNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getCompany;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getCompany:function(t,e,i,n){if(n!=false){this.request(t,e,"getCompany",i)}else{this.request(t,e,"getCompanyNotAsync",i)}},_getGroup:function(t,e,i){var n=this.designAddress+this.organizationActions.getGroup;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getGroupNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getGroup;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getGroup:function(t,e,i,n){if(n!=false){this.request(t,e,"getGroup",i)}else{this.request(t,e,"getGroupNotAsync",i)}},_getGroupByKey:function(t,e,i){var n=this.designAddress+this.organizationActions.getGroupByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s)},_getGroupByKeyNotAsync:function(t,e,i){var n=this.designAddress+this.organizationActions.getGroupByKey;n=n.replace(/{key}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.getJSON(n,s,false)},getGroupByKey:function(t,e,i,n){if(n!=false){this.request(t,e,"getGroupByKey",i)}else{this.request(t,e,"getGroupByKeyNotAsync",i)}},saveCompany:function(t,e,i){if(this.designAddress){if(t.id){this.updateCompany(t,e,i)}else{this.addCompany(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateCompany(t,e,i)}else{this.addCompany(t,e,i)}}.bind(this),i)}},updateCompany:function(t,e,i){var n=this.designAddress+this.organizationActions.updateCompany;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addCompany:function(t,e,i){this.getId(1,function(n){t.id=n.data[0].id;var s=this.designAddress+this.organizationActions.addCompany;var o=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",s,JSON.encode(t),o)}.bind(this))},saveCompanyDuty:function(t,e,i){if(this.designAddress){if(t.id){this.updateCompanyDuty(t,e,i)}else{this.addCompanyDuty(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateCompanyDuty(t,e,i)}else{this.addCompanyDuty(t,e,i)}}.bind(this),i)}},updateCompanyDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.updateCompanyDuty;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addCompanyDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.addCompanyDuty;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveDepartmentDuty:function(t,e,i){if(this.designAddress){if(t.id){this.updateDepartmentDuty(t,e,i)}else{this.addDepartmentDuty(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateDepartmentDuty(t,e,i)}else{this.addDepartmentDuty(t,e,i)}}.bind(this),i)}},updateDepartmentDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.updateDepartmentDuty;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addDepartmentDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.addDepartmentDuty;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveCompanyAttribute:function(t,e,i){if(this.designAddress){if(t.id){this.updateCompanyAttribute(t,e,i)}else{this.addCompanyAttribute(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateCompanyAttribute(t,e,i)}else{this.addCompanyAttribute(t,e,i)}}.bind(this),i)}},updateCompanyAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.updateCompanyAttribute;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addCompanyAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.addCompanyAttribute;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveDepartmentAttribute:function(t,e,i){if(this.designAddress){if(t.id){this.updateDepartmentAttribute(t,e,i)}else{this.addDepartmentAttribute(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateDepartmentAttribute(t,e,i)}else{this.addDepartmentAttribute(t,e,i)}}.bind(this),i)}},updateDepartmentAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.updateDepartmentAttribute;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addDepartmentAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.addDepartmentAttribute;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveGroup:function(t,e,i){if(this.designAddress){if(t.id){this.updateGroup(t,e,i)}else{this.addGroup(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateGroup(t,e,i)}else{this.addGroup(t,e,i)}}.bind(this),i)}},updateGroup:function(t,e,i){var n=this.designAddress+this.organizationActions.updateGroup;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addGroup:function(t,e,i){var n=this.designAddress+this.organizationActions.addGroup;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveRole:function(t,e,i){if(this.designAddress){if(t.id){this.updateRole(t,e,i)}else{this.addRole(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateRole(t,e,i)}else{this.addRole(t,e,i)}}.bind(this),i)}},updateRole:function(t,e,i){var n=this.designAddress+this.organizationActions.updateRole;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addRole:function(t,e,i){var n=this.designAddress+this.organizationActions.addRole;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},savePerson:function(t,e,i){if(this.designAddress){if(t.id){this.updatePerson(t,e,i)}else{this.addPerson(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updatePerson(t,e,i)}else{this.addPerson(t,e,i)}}.bind(this),i)}},updatePerson:function(t,e,i){var n=this.designAddress+this.organizationActions.updatePerson;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addPerson:function(t,e,i){var n=this.designAddress+this.organizationActions.addPerson;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},savePersonAttribute:function(t,e,i){if(this.designAddress){if(t.id){this.updatePersonAttribute(t,e,i)}else{this.addPersonAttribute(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updatePersonAttribute(t,e,i)}else{this.addPersonAttribute(t,e,i)}}.bind(this),i)}},updatePersonAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.updatePersonAttribute;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addPersonAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.addPersonAttribute;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},saveIdentity:function(t,e,i){if(this.designAddress){if(t.id){this.updateIdentity(t,e,i)}else{this.addIdentity(t,e,i)}}else{this.getDesignAddress(function(){if(t.id){this.updateIdentity(t,e,i)}else{this.addIdentity(t,e,i)}}.bind(this),i)}},updateIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.updateIdentity;n=n.replace(/{id}/g,t.id);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("PUT",n,JSON.encode(t),s)},addIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.addIdentity;var s=new MWF.xApplication.Common.Actions.RestActions.Callback(e,i);MWF.restful("POST",n,JSON.encode(t),s)},_deleteCompanyDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.removeCompanyDuty;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteCompanyDuty:function(t,e,i){this.request(e,i,"deleteCompanyDuty",t)},_deleteDepartmentDuty:function(t,e,i){var n=this.designAddress+this.organizationActions.removeDepartmentDuty;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteDepartmentDuty:function(t,e,i){this.request(e,i,"deleteDepartmentDuty",t)},_deleteCompanyAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.removeCompanyAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteCompanyAttribute:function(t,e,i){this.request(e,i,"deleteCompanyAttribute",t)},_deleteDepartmentAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.removeDepartmentAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteDepartmentAttribute:function(t,e,i){this.request(e,i,"deleteDepartmentAttribute",t)},_deletePersonAttribute:function(t,e,i){var n=this.designAddress+this.organizationActions.removePersonAttribute;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deletePersonAttribute:function(t,e,i){this.request(e,i,"deletePersonAttribute",t)},_deleteIdentity:function(t,e,i){var n=this.designAddress+this.organizationActions.removeIdentity;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteIdentity:function(t,e,i){this.request(e,i,"deleteIdentity",t)},_deleteGroup:function(t,e,i){var n=this.designAddress+this.organizationActions.removeGroup;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteGroup:function(t,e,i){this.request(e,i,"deleteGroup",t)},_deleteRole:function(t,e,i){var n=this.designAddress+this.organizationActions.removeRole;n=n.replace(/{id}/g,i);var s=new MWF.xApplication.Common.Actions.RestActions.Callback(t,e);MWF.restful("DELETE",n,"",s)},deleteRole:function(t,e,i){this.request(e,i,"deleteRole",t)}});
|