diff --git a/o2web/jsdoc_static/actionOut_examples/x_organization_assemble_express.json b/o2web/jsdoc_static/actionOut_examples/x_organization_assemble_express.json index 7a1f627bd64a56ddbdf86fef31b77b048eedc7e2..2e84c7ef4bc28b3263f7cd5db900038d080e16da 100644 --- a/o2web/jsdoc_static/actionOut_examples/x_organization_assemble_express.json +++ b/o2web/jsdoc_static/actionOut_examples/x_organization_assemble_express.json @@ -95,9 +95,16 @@ "张三@zhangsan@P", "李四@lisi@P" ], + "identityList": [ + "王五@kfb_wangwu@I", + "赵六@kfb_zhaoliu@I" + ], "groupList": [ "所有部门领导@AllDepartLeader@G", "所有部门汇报管理员@AllDepartReportManager@G" + ], + "unitList": [ + "开发部@kfb@U" ] } } \ No newline at end of file diff --git a/o2web/source/o2_core/o2/xScript/Actions/UnitActions.js b/o2web/source/o2_core/o2/xScript/Actions/UnitActions.js index dc9e388e8326d4e018c7c373f716ed0af6734c4f..01ade7380542211adb716a7f794ad7546fc74659 100644 --- a/o2web/source/o2_core/o2/xScript/Actions/UnitActions.js +++ b/o2web/source/o2_core/o2/xScript/Actions/UnitActions.js @@ -19,6 +19,7 @@ MWF.xScript.Actions.UnitActions = new Class({ listSupGroupDirect: invoke("listSupGroupDirect"), listSupGroupNested: invoke("listSupGroupNested"), listGroupWithPerson: invoke("listGroupWithPerson"), + listGroupWithIdentity: invoke("listGroupWithIdentity"), groupHasRole: invoke("groupHasRole"), //角色-------- diff --git a/o2web/source/o2_core/o2/xScript/Actions/unitAction.json b/o2web/source/o2_core/o2/xScript/Actions/unitAction.json index ff3b2233fb867e4094f5b25058a580b21f1f9827..621fbfb32c85a583a630c54a5c5a42c3cc2e5ef3 100644 --- a/o2web/source/o2_core/o2/xScript/Actions/unitAction.json +++ b/o2web/source/o2_core/o2/xScript/Actions/unitAction.json @@ -9,6 +9,7 @@ //data: {"personList":[]} "listGroupWithPerson": {"uri": "/jaxrs/group/list/person/object", "method": "POST"}, //人员所在群组(嵌套) + "listGroupWithIdentity": {"uri": "/jaxrs/group/list/identity/object", "method": "POST"}, //人员所在群组(嵌套) //data: {"group":"","roleList":[""]} "groupHasRole": {"uri": "/jaxrs/group/has/role", "method": "POST"}, //群组是否拥有角色 diff --git a/o2web/source/o2_core/o2/xScript/CMSEnvironment.js b/o2web/source/o2_core/o2/xScript/CMSEnvironment.js index 0efc5af2eae0f8f5dc8aeeb68f9e833f772be28a..87ac9fe719a025bb24f3d377981e8b94ada0c2ec 100644 --- a/o2web/source/o2_core/o2/xScript/CMSEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/CMSEnvironment.js @@ -218,6 +218,21 @@ MWF.xScript.CMSEnvironment = function(ev){ // orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false); // return v; }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(identity, async){ + getOrgActions(); + var data = {"identityList": getNameFlag(identity)}; + + var v = null; + var cb = function(json){ + v = json.data; + if (async && o2.typeOf(async)=="function") return async(v); + return v; + }; + + var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async); + return (!!async) ? promise : v; + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role, async){ getOrgActions(); diff --git a/o2web/source/o2_core/o2/xScript/Environment.js b/o2web/source/o2_core/o2/xScript/Environment.js index b477bd2edc5155af4bc3fcb4f4738cbacd265baa..d71f1a1064e9c9b6aa7864aaba53ccf5a166a320 100644 --- a/o2web/source/o2_core/o2/xScript/Environment.js +++ b/o2web/source/o2_core/o2/xScript/Environment.js @@ -767,6 +767,21 @@ MWF.xScript.Environment = function(ev){ // orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false); // return v; }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(identity, async){ + getOrgActions(); + var data = {"identityList": getNameFlag(identity)}; + + var v = null; + var cb = function(json){ + v = json.data; + if (async && o2.typeOf(async)=="function") return async(v); + return v; + }; + + var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async); + return (!!async) ? promise : v; + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role, async){ getOrgActions(); diff --git a/o2web/source/o2_core/o2/xScript/PageEnvironment.js b/o2web/source/o2_core/o2/xScript/PageEnvironment.js index a950698d3a06d3d08de6854e14a047d7725e281a..b76ccf456135f76dd0ee76a08151b71786c602d5 100644 --- a/o2web/source/o2_core/o2/xScript/PageEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/PageEnvironment.js @@ -294,6 +294,21 @@ if (!MWF.xScript || !MWF.xScript.PageEnvironment) { // orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false); // return v; }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(identity, async){ + getOrgActions(); + var data = {"identityList": getNameFlag(identity)}; + + var v = null; + var cb = function(json){ + v = json.data; + if (async && o2.typeOf(async)=="function") return async(v); + return v; + }; + + var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async); + return (!!async) ? promise : v; + }, //群组是否拥有角色--返回true, false groupHasRole: function (name, role, async) { getOrgActions(); diff --git a/o2web/source/o2_core/o2/xScript/ServerApi.js b/o2web/source/o2_core/o2/xScript/ServerApi.js index 091155602d6ab82b1965925ee34f0bf32dbfbbeb..ee08dbb8324e684afc6acf6bd9c70fd05adb6303 100644 --- a/o2web/source/o2_core/o2/xScript/ServerApi.js +++ b/o2web/source/o2_core/o2/xScript/ServerApi.js @@ -626,6 +626,21 @@ * var groupList = this.org.listGroupWithPerson( name ); */ + //身份所在群组(嵌套)--返回群组的对象数组 + /** + * 根据身份标识获取所有的群组对象数组。如果群组具有群组(group)成员,且群组成员中包含该身份,那么该群组也被返回。 + * @method listGroupWithIdentity + * @o2membercategory group + * @methodOf module:server.org + * @static + * @param {IdentityFlag|IdentityFlag[]} name - 身份的distinguishedName、name、id、unique属性值,身份对象,或上述属性值和对象的数组。 + * @return {GroupData[]} 返回群组对象数组。 + * @o2ActionOut x_organization_assemble_express.GroupAction.listWithPersonObject|example=Group + * @o2syntax + * //返回群组数组。 + * var groupList = this.org.listGroupWithIdentity( name ); + */ + //角色*************** //获取角色--返回角色的对象数组 diff --git a/o2web/source/o2_core/o2/xScript/ViewEnvironment.js b/o2web/source/o2_core/o2/xScript/ViewEnvironment.js index d327886115b2d88c8bd0f700bf88364386bf66d2..2266f20365912e64372081d5cd972be9a94ece37 100644 --- a/o2web/source/o2_core/o2/xScript/ViewEnvironment.js +++ b/o2web/source/o2_core/o2/xScript/ViewEnvironment.js @@ -2143,6 +2143,48 @@ MWF.xScript.ViewEnvironment = function (ev) { // orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false); // return v; }, + //身份所在群组(嵌套)--返回群组的对象数组 + /** + * 根据身份标识获取所有的群组对象数组。如果群组具有群组(group)成员,且群组成员中包含该身份,那么该群组也被返回。 + * @method listGroupWithIdentity + * @o2membercategory group + * @methodOf module:org + * @static + * @param {IdentityFlag|IdentityFlag[]} identity - 身份的distinguishedName、id、unique属性值,身份对象,或上述属性值和对象的数组。 + * @param {(Boolean|Function)} [asyncOrCallback] 当参数为boolean,表示是否异步执行,默认为false。当参数为function,表示回调方法。 + * @return {Promise|GroupData[]} 当async为true时,返回 + * {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise|Promise}。 + * 否则返回群组对象数组。 + * @o2ActionOut x_organization_assemble_express.GroupAction.listWithPersonObject|example=Group + * @o2syntax + * //同步执行,返回群组数组。 + * var groupList = this.org.listGroupWithIdentity( identity ); + * + * //异步执行,返回Promise对象 + * var promise = this.org.listGroupWithIdentity( identity, true); + * promise.then(function(groupList){ + * //groupList 为返回的群组数组。 + * }) + * + * //异步执行,在回调方法中获取群组 + * this.org.listGroupWithPerson( identity, function(groupList){ + * //groupList 为返回的群组数组。 + * }) + */ + listGroupWithIdentity:function(identity, async){ + getOrgActions(); + var data = {"identityList": getNameFlag(identity)}; + + var v = null; + var cb = function(json){ + v = json.data; + if (async && o2.typeOf(async)=="function") return async(v); + return v; + }; + + var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async); + return (!!async) ? promise : v; + }, //角色*************** //获取角色--返回角色的对象数组 diff --git a/o2web/source/x_desktop/js/initalScriptSubstitute.js b/o2web/source/x_desktop/js/initalScriptSubstitute.js index 4e2b0283ece32412c640fc80cdc3eed6ef1c5f2e..41a1f51ce006f9ea9ea3c90fed69768406efbbf0 100644 --- a/o2web/source/x_desktop/js/initalScriptSubstitute.js +++ b/o2web/source/x_desktop/js/initalScriptSubstitute.js @@ -338,6 +338,11 @@ var _org = { var v = this.oGroup.listWithPerson(getNameFlag(name)); return this.getObject(this.oGroup, v); }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(name){ + var v = this.oGroup.listWithIdentity(getNameFlag(name)); + return this.getObject(this.oGroup, v); + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role){ nameFlag = (library.typeOf(name)==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name; diff --git a/o2web/source/x_desktop/js/initalServiceScriptSubstitute.js b/o2web/source/x_desktop/js/initalServiceScriptSubstitute.js index 69fbdacbe417eb20b805ac0f32608161b4804ead..9f9879eb69c61bc8c6dfee0140a55b7fdcb9ebf2 100644 --- a/o2web/source/x_desktop/js/initalServiceScriptSubstitute.js +++ b/o2web/source/x_desktop/js/initalServiceScriptSubstitute.js @@ -553,6 +553,11 @@ var _org = { var v = this.oGroup.listWithPerson(getNameFlag(name)); return this.getObject(this.oGroup, v); }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(name){ + var v = this.oGroup.listWithIdentity(getNameFlag(name)); + return this.getObject(this.oGroup, v); + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role){ nameFlag = (library.typeOf(name)==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name; diff --git a/o2web/source/x_desktop/js/initialScriptText.js b/o2web/source/x_desktop/js/initialScriptText.js index a6fcbffc5665ab818ca939536042f62be3ba5419..2460cd3aaef54345666d6ab185608d6737b8e832 100644 --- a/o2web/source/x_desktop/js/initialScriptText.js +++ b/o2web/source/x_desktop/js/initialScriptText.js @@ -328,6 +328,11 @@ var _org = { var v = this.oGroup.listWithPerson(getNameFlag(name)); return this.getObject(this.oGroup, v); }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(name){ + var v = this.oGroup.listWithIdentity(getNameFlag(name)); + return this.getObject(this.oGroup, v); + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role){ nameFlag = (library.typeOf(name)==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name; diff --git a/o2web/source/x_desktop/js/initialServiceScriptText.js b/o2web/source/x_desktop/js/initialServiceScriptText.js index 3b33ab91d8d01614bdbaa3c5daab10ffe6891a4b..537802fb183181a1b69e6a0e679be5425a666491 100644 --- a/o2web/source/x_desktop/js/initialServiceScriptText.js +++ b/o2web/source/x_desktop/js/initialServiceScriptText.js @@ -2954,6 +2954,11 @@ var _org = { var v = this.oGroup.listWithPerson(getNameFlag(name)); return this.getObject(this.oGroup, v); }, + //身份所在群组(嵌套)--返回群组的对象数组 + listGroupWithIdentity:function(name){ + var v = this.oGroup.listWithIdentity(getNameFlag(name)); + return this.getObject(this.oGroup, v); + }, //群组是否拥有角色--返回true, false groupHasRole: function(name, role){ nameFlag = (library.typeOf(name)==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name;