CN103744645A - Resource multi-page distributing method based on AJAX - Google Patents

Resource multi-page distributing method based on AJAX Download PDF

Info

Publication number
CN103744645A
CN103744645A CN201310064689.XA CN201310064689A CN103744645A CN 103744645 A CN103744645 A CN 103744645A CN 201310064689 A CN201310064689 A CN 201310064689A CN 103744645 A CN103744645 A CN 103744645A
Authority
CN
China
Prior art keywords
role
resource
binding
bindingset
ajax
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310064689.XA
Other languages
Chinese (zh)
Inventor
王新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yiqilian Technology Co Ltd
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201310064689.XA priority Critical patent/CN103744645A/en
Publication of CN103744645A publication Critical patent/CN103744645A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a resource multi-page distributing method based on AJAX. The method includes the following steps of firstly, initially setting a bindingSet, and setting an initial set of the bindingSet as a role master key which is bound with resources in a database; secondly, reflecting change of the bindingSet through a binding/unbinding operation performed on a foreground page by a user; thirdly, performing submission operation by the user to update the new set bindingSet to the database or other storage entities. According to the method, by easily clicking a button or link, the binding/unbinding operation of queried multi-page role lists and resources which meet conditions is realized at one time.

Description

A kind of resource multipage distribution method based on AJAX
Technical field
The present invention relates to utilize AJAX (Asynchronous JavaScript and XML) framework to carry out WEB development field, particularly a kind of resource multipage distribution method based on AJAX.
Background technology
In application system, resource and role's binding is a general problem.In existing application system, be generally by inquiry, to obtain role's list of the condition of conforming to, choose/cancel check box corresponding to certain role, realize binding/cancellation bindings of corresponding role and resource; Or choose/cancel the role of current page, to realize binding/cancellation bindings of current page role and resource.
If the role who inquires is much in the situation such as thousands of page, one by one or page by page, by itself and resource binding, just seem extremely loaded down with trivial details.
Therefore, being badly in need of a kind of method can all realize binding or cancel binding with resource the multipage role who inquires is disposable.
AJAX is the comprehensive of multiple technologies, comprises Javascript, XHTML and CSS, DOM, XML and XSTL, XMLHttpRequest.It uses XHTML and CSS standardization to present, and use DOM realizes and dynamically shows and alternately, use XML and XSTL to carry out exchanges data and processing, uses XMLHttpRequest object to carry out asynchronous data and reads, and uses Javascript binding and processes all data.
Different from traditional Web application, AJAX adopts asynchronous interactive process.AJAX introduces an intermediary between user and server, thereby has eliminated the processing-wait-processing-wait shortcoming in network interaction process.User's browser has loaded AJAX engine when executing the task.AJAX engine JavaScript language compilation, ensconces in a hiding framework conventionally.It is responsible for compiling user interface and and server between mutual.AJAX engine allows asynchronous the carrying out of reciprocal process between user and application software, is independent of exchanging between user and the webserver.Now, can call the user action that AJAX engine replaces producing a HTTP with Javascript, these demands that do not need to be again written into full page of the data edition in internal memory, page navigation, data check can be given AJAX and be carried out.
Use AJAX, can for ISP, developer, terminal user bring visible convenient:
● alleviate the burden of server.The principle of AJAX is " fetching data as required ", can farthest reduce redundant request, and responds the burden that server is caused.
● updating web, reduces user psychology and actual stand-by period.Especially, when will read a large amount of data, the situation that need not occur white screen as Reload, AJAX is used XMLHTTP object to send request and obtain server response, the Javascript operation DOM final updated page in the situation that not again being written into full page.So in the process of reading out data, what user faced is not white screen, be original content of pages (prompting frame that also can add a Loading allows user know in reading out data process), only have the content of just upgrading appropriate section after data receiver is complete.This renewal is moment, and user is almost imperceptible.
● bring better user to experience.The work of some server burdens in the past can be married again to client, utilize client idle capacity to process, alleviate the burden of server and bandwidth, conserve space and broadband lease cost.
● can call external data.Based on technology standardized and that extensively supported, do not need download plug-in or small routine.Further promote the page to present separated with data.
In sum, how AJAX technology is applied to during resource multipage distributes, all to realize binding with resource or cancellation is bound by the multipage role who inquires is disposable, is the direction place of those skilled in the art institute wish research.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of resource multipage distribution method based on AJAX, and it has been realized and has all realized binding or cancel binding with resource the multipage role who inquires is disposable.
In order to achieve the above object, the invention provides a kind of resource multipage distribution method based on AJAX, it comprises following
Step:
Step S1: bindingSet is carried out to initialization setting, its initial sets is made as to role's major key of having bound with resource in database;
Step S2: binding/cancellation bindings that user carries out at front page layout is reacted to the variation of bindingSet;
Step S3: user carries out submit operation, will newly gather bindingSet and be updated to database or other storage entity.
Preferably, in embodiment, in step S1, by described initial sets, determine whether check box is chosen to show the role who checks out, and inquires qualified role's list, the corresponding check box of each role, arranges the initial value of check box.
, in embodiment, in step S1, be preferably to retrieve at bindingSet by major key, if can retrieve, this check box is " choosing " state; Otherwise this check box is " not choosing " state.
Preferably, in embodiment, in step S2, described binding/cancellation binding comprises single role bindings/cancellation binding, current page role bindings/cancellation binding and all role bindings/cancellation binding.
Preferably in embodiment, in step S2, a kind of base class of the role's of inquiry paging is provided, the major key set bindingSet that its main private variable comprising is all roles and resource binding and all the Boolean type variable allSelected of binding/cancel all binding, binding/cancellation bindings that user carries out at front page layout is reacted to the variation of bindingSet and allSelected.
Preferably in embodiment, the operation of the single role that user carries out on foreground and resource binding/cancellation binding and current page role and resource binding/cancellation binding can cause the variation of bindingSet, the role who inquires all realizes the variation that can cause allSelected with resource binding/cancellation bindings, in page management BEAN, to, according to above-mentioned variation, reset role's major key set bindingSet that need to be tied to resource.
Preferably in embodiment, the described bindingSet generating in page management BEAN, when being updated to database, need to compare with role's list of primary keys roleIds of resource binding.
Preferably, in embodiment, the role's major key all existing in bindingSet and roleIds, need to remove these major keys from bindingSet.
Preferably in embodiment, in roleIds, exist and non-existent role's major key in bindingSet, need to be by corresponding role and the resource unbind relation of these major keys.
Preferably in embodiment, in bindingSet, exist and non-existent role's major key in roleIds, corresponding role and the resource of these major keys need to be set up to binding relationship.
Compared with prior art, beneficial effect of the present invention is:
By light click one button or link, bindings is bound/cancelled to disposable realization by multipage role list and the resource of the condition that conforms to inquiring.
Accompanying drawing explanation
Fig. 1 is a kind of resource multipage distribution method process flow diagram based on AJAX provided by the invention;
Fig. 2 is to be role's major key set bindingSet change figure that the resource multipage distribution method that the present invention is based on Ajax is tied to resource;
Fig. 3 be the resource multipage distribution method that the present invention is based on Ajax in management BEAN, obtain need to role's major key set bindingSet of resource binding;
Fig. 4 is that the resource multipage distribution method that the present invention is based on Ajax need to be updated to database with role's major key set bindingSet of resource binding;
Fig. 5 A to Fig. 5 E, for realizing an object lesson of the present invention, is that bulletin is distributed to personal account, and E-mail address is the identity information of sign personal account.Wherein, Fig. 5 A, i.e. querying individual account; Fig. 5 B, the personal account paging list inquiring; Fig. 5 C-1 and Fig. 5 C-2, click " choosing entirely " page design sketch; Fig. 5 D-1 and Fig. 5 D-2, click " Quan Buxuan " page design sketch; With Fig. 5 E, be about to bulletin the distribution of personal account is updated to database.
Embodiment
Below in conjunction with accompanying drawing, to the present invention is above-mentioned, be described in more detail with other technical characterictic and advantage.
The present invention is a kind of resource multipage distribution method based on AJAX, and it is the web technologies based on AJAX, and resource and the polygonal look inquiring are realized to binding or cancelled bindings.
The invention provides a kind of base class of the role's of inquiry paging, the major key that it main private variable comprising is all roles and resource binding (or can represent field and the structure of role's uniqueness, as follows) set bindingSet and the Boolean type variable allSelected that all binding/cancel alls are bound.The single role who carries out on foreground as user and resource binding/cancellation binding and current page role can cause bindingSet variation with resource binding/cancellation bindings.When the role who inquires all realizes the variation that can cause allSetected with resource binding/cancellation bindings.Therefore, binding/cancellation bindings that user realizes on foreground directly causes the variation of bindingSet and allSelected, then the management BEAN by the page newly gathers bindingSet by this reacting condition to role's major key that need to be tied to resource, finally by submit operation, is updated to database or other storage entity.
Above-mentioned front page layout adopts AJAX technology, the operation that user carries out, for example: certain role and resource binding, certain role and resource are cancelled binding; Certain page of role and resource binding, certain page of role and resource are cancelled binding; All page roles and resource binding and all page role cancel and binding with resource, the change of all can dynamic reflection arriving bindingSet.
BindingSet described in the resource multipage distribution method of the invention described above based on AJAX, its finite element set comprise from data base querying to role's major key of all and resource binding, by described finite element set, can determine whether the check box control original state of whether binding with resource corresponding to single role is chosen; Through user, operate role and resource binding/cancellation bindings, in the management BEAN of the page, obtain need to role's major key set bindingSet of resource binding, and this set is compared with role's list roleId of known resource binding, there is following several situation:
The role's major key all existing in bindingSet and roleIds need to remove these role's major keys from bindingSet set;
In roleIds, exist and non-existent role's major key in bindingSet, need to be by corresponding role and the resource unbind relation of these role's major keys;
In bindingSet, exist and non-existent role's major key in roleIds, corresponding role and the resource of these role's major keys need to be set up to binding relationship.
Above-mentioned situation can be by embodying in table one: whether table one exists mutual relationship operation table for the present invention is based in the resource multipage distribution method bindingSet of Ajax major key in role's major key and role's list of primary keys of having bound.
Table one
Figure BSA00000859697700061
To sum up, consulting Fig. 1, is a kind of resource multipage distribution method process flow diagram based on AJAX provided by the invention, and its concrete steps are as follows:
Step S1: bindingSet is carried out to initialization setting, its initial sets is made as to role's major key of having bound with resource in database;
Step S2: binding/cancellation bindings that user carries out at front page layout is reacted to the variation of bindingSet;
Step S3: user carries out submit operation, will newly gather bindingSet and be updated to database or other storage entity.
Below above-mentioned steps is elaborated:
First consult Fig. 2, for the present invention is based on the resource multipage distribution method of Ajax, be tied to role's major key set bindingSet change figure of resource, as shown in the figure:
First, to carry out initialization setting to bindingSet, its initial sets is made as to role's major key of having bound with resource in database, by this initial sets, can determines whether check box chooses to show whether the role who checks out binds with resource, inquire qualified role's list, the corresponding check box of each role, arranges the initial value of check box, and this can retrieve at bindingSet by major key, if can retrieve, this check box is " choosing " state; Otherwise this check box is " not choosing " state.
Secondly, user is tied to resource for role bindings/cancellation action need at front page layout is updated in set bindingSet, described binding/cancellation binding comprises single role bindings/cancellation binding, current page role bindings/cancellation binding and all role bindings/cancellation binding, and this process will be described in detail in Fig. 3.
Finally, also will from bindingSet set, remove the role's major key with resource binding, this process will be described in detail in Fig. 4
Refer to shown in Fig. 3, for the resource multipage distribution method that the present invention is based on Ajax in management BEAN, obtain need to role's major key set bindingSet of resource binding; Processing page operation has a public class, in such, include two private variables, one is that user carries out routine operation and causes role's major key set bindingSet change and resource binding as the binding of single role bindings/cancellation and the complete not selection operation of the full choosing/page of page, another one variable is the Boolean type variable allSelected that the binding of all bind/cancel all causes variation, and its initial value is false.User is reacted directly into the variation of gathering bindingSet and variable allSelected in this public class to the operation of front page layout.But finally the two will be reacted to and need to newly gather bindingSet with role's major key of resource binding, and it can be processed by implementation method function in page management BEAN, what Fig. 3 described is the idiographic flow of these class methods.
Refer to shown in Fig. 3, first the null set bindingSet of role's major key type of initialization; Then by the public class of definition, obtain the Boolean type variable allSelected that need to cause variation with role's major key set bindingSet and whole binding/cancel all binding of resource binding that foregrounding causes variation; Secondly according to querying condition, inquiry obtains role's list of primary keys, and sets the vernier it of this list of traversal; Again secondly by vernier it traversal of lists, if role's Major key roleId of corresponding node is present in bindingSet set or allSelected is true (i.e. all binding), is about to roleId and adds role's major key that new needs bind to and gather in temp temporarily; Finally by temp assignment to bindingSet, return really and need to newly gather bindingSet with role's major key of resource binding.
Please refer to Fig. 4, for the present invention is based on the resource multipage distribution method of Ajax, need to be updated to database with role's major key set bindingSet of resource binding.In Fig. 3 by the management BEAN corresponding with the page obtain really need to role's major key set of resource binding, but user, bind/cancel in bindings process, the role that may need to bind resource is in fact with resource binding.Like this will be to the processing of classifying of role corresponding to major key in bindingSet set.
As shown in Figure 4, first according to the method for Fig. 3 obtain really need to role's major key set bindingSet of resource binding, then inquiry obtain existing with role's list of primary keys of resource binding, and the vernier it of this list of setting traversal, secondly by vernier it traversal of lists, if role's Major key roleId of corresponding node is present in bindingSet set, roleId is removed from bindingSet, otherwise by corresponding role and the resource unbind relation of roleId; Finally the role that in bindingSet, all major keys are corresponding is all set up to binding relationship with resource.BindingSet set be role's major key and inquire have respectively " existence " and " not existing " two kinds of situations with role's major key of resource binding, combine and just have four kinds of situations, such as the role's major key existing in bindingSet set, also be present in role's list of primary keys of having bound, the operation of implementing is that this major key is removed from bindingSet set, as shown in Table 1.
Fig. 5 A to Fig. 5 E, for realizing an object lesson of the present invention, is that bulletin is distributed to personal account, and E-mail address is the identity information of sign personal account.Comprise Fig. 5 A, i.e. querying individual account; Fig. 5 B, the personal account paging list inquiring; Fig. 5 C-1 and Fig. 5 C-2, click " choosing entirely " page design sketch; Fig. 5 D-1 and Fig. 5 D-2, click " Quan Buxuan " page design sketch; With Fig. 5 E, be about to bulletin the distribution of personal account is updated to database.
This embodiment distributes to personal account by bulletin, and E-mail address is the identity information of sign personal account.Fig. 5 A fills in personal account querying condition, what is not filled out, represent that inquiry is all, obtain Fig. 5 B personal account paging list, in figure, show and find altogether two pages of 14 records, article one, record check box above is chosen, represent that bulletin has been assigned to this personal account, click " choosing entirely " link on the page, effect is as Fig. 5 C-1 and Fig. 5 C-2, two pages of all records check box above is all chosen, " Quan Buxuan " if on click page link, as Fig. 5 D-1 and Fig. 5 D-2, all records of two pages check box above all becomes not selected state, click " determining " button of page lower end, turn back to bulletin administration page, click data manipulation the first row on the page " submit to and revise " as Fig. 5 E, bulletin is updated to database to the distribution of personal account.
It should be noted that, the present invention is directed to the embodiment that resource is distributed to role and set forth, vice versa, is about to role assignments to multipage resource.
In sum, the invention provides a kind of resource multipage distribution method based on AJAX, whether it chooses to realize binding/cancellation bindings of itself and resource by the check box corresponding with each role; By clicking the button of " page is choosing entirely ", " page does not select entirely " in the page or linking binding/cancellation bindings that disposable batch is realized current page role and resource; By clicking the button of " choosing entirely ", " Quan Buxuan " in the page or linking disposable batch, realize all multipage roles of the condition that conforms to and the binding/cancellation bindings of resource inquiring.Be that the present invention has realized and all realizes binding or cancel binding with resource the multipage role who inquires is disposable.
More than explanation is just illustrative for the purpose of the present invention, and nonrestrictive, those of ordinary skills understand; in the situation that do not depart from the spirit and scope that following claims limit, can make many modifications, change; or equivalence, but all will fall within the scope of protection of the present invention.

Claims (10)

1. the resource multipage distribution method based on AJAX, is characterized in that, it comprises the following steps:
Step S1: bindingSet is carried out to initialization setting, its initial sets is made as to role's major key of having bound with resource in database; Step S2: binding/cancellation bindings that user carries out at front page layout is reacted to the variation of bindingSet; Step S3: user carries out submit operation, will newly gather bindingSet and be updated to database or other storage entity.
2. the resource multipage distribution method based on AJAX according to claim 1, it is characterized in that, in step S1, by described initial sets, determine whether check box chooses to show the role who checks out, inquire qualified role's list, the corresponding check box of each role, arranges the initial value of check box.
3. the resource multipage distribution method based on AJAX according to claim 2, is characterized in that, in step S1, is to retrieve at bindingSet by major key, if can retrieve, this check box is " choosing " state; Otherwise this check box is " not choosing " state.
4. the resource multipage distribution method based on AJAX according to claim 1, it is characterized in that, in step S2, described binding/cancellation binding comprises single role bindings/cancellation binding, current page role bindings/cancellation binding and all role bindings/cancellation binding.
5. according to the resource multipage distribution method based on AJAX described in claim 1 or 4, it is characterized in that, in step S2, a kind of base class of the role's of inquiry paging is provided, the major key set bindingSet that its main private variable comprising is all roles and resource binding and all the Boolean type variable allSelected of binding/cancel all binding, binding/cancellation bindings that user carries out at front page layout is reacted to the variation of bindingSet and allSelected.
6. the resource multipage distribution method based on AJAX according to claim 5, it is characterized in that, the operation of the single role that user carries out on foreground and resource binding/cancellation binding and current page role and resource binding/cancellation binding can cause the variation of bindingSet, the role who inquires all realizes the variation that can cause allSelected with resource binding/cancellation bindings, in page management BEAN, to, according to above-mentioned variation, reset role's major key set bindingSet that need to be tied to resource.
7. the resource multipage distribution method based on AJAX according to claim 6, it is characterized in that, the described bindingSet generating in page management BEAN, when being updated to database, need to compare with role's list of primary keys roleIds of resource binding.
8. the resource multipage distribution method based on AJAX according to claim 7, is characterized in that the role's major key all existing in bindingSet and roleIds need to remove these major keys from bindingSet.
9. the resource multipage distribution method based on AJAX according to claim 7, is characterized in that, exists and non-existent role's major key in bindingSet in roleIds, need to be by corresponding role and the resource unbind relation of these major keys.
10. the resource multipage distribution method based on AJAX according to claim 7, is characterized in that, exists and non-existent role's major key in roleIds in bindingSet, corresponding role and the resource of these major keys need to be set up to binding relationship
CN201310064689.XA 2013-03-01 2013-03-01 Resource multi-page distributing method based on AJAX Pending CN103744645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310064689.XA CN103744645A (en) 2013-03-01 2013-03-01 Resource multi-page distributing method based on AJAX

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310064689.XA CN103744645A (en) 2013-03-01 2013-03-01 Resource multi-page distributing method based on AJAX

Publications (1)

Publication Number Publication Date
CN103744645A true CN103744645A (en) 2014-04-23

Family

ID=50501665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310064689.XA Pending CN103744645A (en) 2013-03-01 2013-03-01 Resource multi-page distributing method based on AJAX

Country Status (1)

Country Link
CN (1) CN103744645A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783088A (en) * 2004-12-01 2006-06-07 佳能株式会社 WEB browser operation method and operation apparatus
US20090070190A1 (en) * 2007-09-12 2009-03-12 Microsoft Corporation Updating contents of asynchronously refreshable webpages
CN102236673A (en) * 2010-04-30 2011-11-09 航天信息股份有限公司 AJAX (Asynchronous JavaScript and XML)-based resource multi-page distribution method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783088A (en) * 2004-12-01 2006-06-07 佳能株式会社 WEB browser operation method and operation apparatus
US20090070190A1 (en) * 2007-09-12 2009-03-12 Microsoft Corporation Updating contents of asynchronously refreshable webpages
CN102236673A (en) * 2010-04-30 2011-11-09 航天信息股份有限公司 AJAX (Asynchronous JavaScript and XML)-based resource multi-page distribution method

Similar Documents

Publication Publication Date Title
CN102521230B (en) For the result type that data with good conditionsi show
US9420034B2 (en) Providing services to multiple tenants of an application
KR101376916B1 (en) Techniques to perform gradual upgrades
EP2260413B1 (en) Web content management
CN103201997B (en) A kind of document services method and system of sing on web
US8904363B2 (en) Projecting software and data onto client
CN103368986A (en) Information recommendation method and information recommendation device
CN104281455A (en) Interface calling method and device and terminal
JP2014512601A (en) Tenant data recovery across tenant migration
CN107329991A (en) A kind of list access to web page and methods of exhibiting and its system
CN102236673B (en) AJAX (Asynchronous JavaScript and XML)-based resource multi-page distribution method
CN102355499A (en) Cloud computing system
CN104144202A (en) Hadoop distributed file system access method, system and device
CN105045789A (en) Game server database buffer memory method and system
CN106502757A (en) A kind of plug-in management method and device
CN114461209A (en) Page configuration and switching method, device, equipment and storage medium
CN103501341A (en) Method and device for establishing Web service
US7856344B2 (en) Method for transforming overlapping paths in a logical model to their physical equivalent based on transformation rules and limited traceability
CN116466915A (en) MVP architecture-based iOS development framework construction method and device
CN116208676A (en) Data back-source method, device, computer equipment, storage medium and program product
CN115311399A (en) Image rendering method and device, electronic equipment and storage medium
CN114637499A (en) Visualization component processing method, device, equipment and medium
CN103744645A (en) Resource multi-page distributing method based on AJAX
CN102281257B (en) Entertainment information platform
CN117193740A (en) Data distribution method, device, computing equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: BEIJING YIQILIAN TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: WANG XIN

Effective date: 20140815

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 242310 XUANCHENG, ANHUI PROVINCE TO: 101121 TONGZHOU, BEIJING

TA01 Transfer of patent application right

Effective date of registration: 20140815

Address after: 101121, No. 141, No. 2-1, 2536 North brick factory, Beijing, Tongzhou District

Applicant after: Beijing billion union Technology Co., Ltd.

Address before: 242310, No. 214, Ningguo cement factory, Ningguo Town, port town, Anhui, China

Applicant before: Wang Xin

WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140423

WD01 Invention patent application deemed withdrawn after publication