Generation of series (1, 2, 3... N) application instances, Application Instances

Source: Internet
Author: User

Generation of series (1, 2, 3... N) application instances, Application Instances

Take the number of series @ {sn: favorite} and put it in the bag doc.

<bag id=doc><we name=we_id>@{sn:favorite}</we></bag>
If the number of series @ {doc: we_id} is null, the maximum value of the we_id field in the primary key of the favorite_base table is queried. Initialization @ {sn: favorite = @ {Pk: favorite_id}} Series
<if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if>
Insert the number of systems and related content separately Favorite_base, Favorite_userTable

<ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql>
Complete code
<Html> <chtml> <if x = "@ {session: user_id}" else = 1> <script> alert ("Log on first! "); Top. location. href = "@ {sys: path}"; </script> <we> <bag id = doc> <we name = we_id >@{ sn: favorite} </we> </bag> <if x = "@ {doc: we_id} "> <we> <esql module = base id = pk commit = true> Select max (WE_ID) as favorite_id from favorite_base </esql> <bag id = doc> <we name = we_id >@{ sn: favorite =@{ pk: favorite_id }}</we> </bag> </we> </if> <! -- Word segmentation --> <call> doc2words </call> <ESql module = base act = edit commit = true> Insert Into favorite_base (we_id, title, words, content, words_content) values (@ {doc: we_id: int}, @ {pPage: title: string}, @ {pPage: words: string}, @ {pPage: content: memo }, @ {pPage: words_content: memo}) </ESql> <bag id = pPage> <we name = content1 >@{ intLeft :@{ pPage: content1} (580 )} </we> </bag> <ESql module = base act = edit> Insert Into favorite_user (f_id, author, Tree_id, ondate, memo) Values ('@ {doc: we_id}', '@ {session: user_id}', '@ {pPage: n }', '@ {sys: date}', @ {pPage: content1: memo}) </ESql> <to >@{ sys: path }@{ sys: curpath1_blogs.html? N = @ {pPage: n} & myid = @ {session: user_id }</to> </we> </if> </chtml> File (blog_add_save.chtml) in the site/blog directory of the B2C e-commerce website, use the relevant files to experience it

Download Easy Do IT resources

Platform and the latest development manual free download: http://download.csdn.net/detail/tx18/8464425

Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585

The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.