├── .idea
├── .name
├── dictionaries
│ └── baobao.xml
├── scopes
│ └── scope_settings.xml
├── vcs.xml
├── encodings.xml
└── copyright
│ ├── Webx_License.xml
│ └── profiles_settings.xml
├── petstore
├── web
│ └── src
│ │ └── main
│ │ ├── webapp
│ │ ├── user
│ │ │ ├── templates
│ │ │ │ ├── screen
│ │ │ │ │ ├── login.vm
│ │ │ │ │ └── register.vm
│ │ │ │ ├── layout
│ │ │ │ │ └── default.vm
│ │ │ │ └── control
│ │ │ │ │ └── login.vm
│ │ │ └── css
│ │ │ │ └── petstore-user.css
│ │ ├── store
│ │ │ ├── templates
│ │ │ │ ├── screen
│ │ │ │ │ ├── categoryList.vm
│ │ │ │ │ ├── edit
│ │ │ │ │ │ ├── categoryList.vm
│ │ │ │ │ │ ├── itemList.vm
│ │ │ │ │ │ └── addProduct.vm
│ │ │ │ │ ├── itemList.vm
│ │ │ │ │ └── viewCart.vm
│ │ │ │ ├── control
│ │ │ │ │ └── categoryList.vm
│ │ │ │ └── layout
│ │ │ │ │ └── default.vm
│ │ │ ├── images
│ │ │ │ ├── bird1.jpg
│ │ │ │ ├── bird4.jpg
│ │ │ │ ├── cat1.jpg
│ │ │ │ ├── cat3.jpg
│ │ │ │ ├── dog1.jpg
│ │ │ │ ├── dog2.jpg
│ │ │ │ ├── dog4.jpg
│ │ │ │ ├── dog5.jpg
│ │ │ │ ├── dog6.jpg
│ │ │ │ ├── fish1.jpg
│ │ │ │ ├── fish2.jpg
│ │ │ │ ├── fish3.jpg
│ │ │ │ ├── fish4.jpg
│ │ │ │ ├── cat_bird.jpg
│ │ │ │ ├── cat_cat.jpg
│ │ │ │ ├── cat_dog.jpg
│ │ │ │ ├── cat_fish.jpg
│ │ │ │ ├── lizard2.jpg
│ │ │ │ ├── lizard3.jpg
│ │ │ │ └── cat_reptile.jpg
│ │ │ └── css
│ │ │ │ └── petstore-store.css
│ │ ├── home
│ │ │ ├── images
│ │ │ │ ├── cart.png
│ │ │ │ ├── tab_mid.png
│ │ │ │ ├── btn_login.png
│ │ │ │ ├── logo_webx.png
│ │ │ │ ├── tab_left.png
│ │ │ │ ├── tab_right.png
│ │ │ │ ├── bg_topline.png
│ │ │ │ ├── logo_alibaba.gif
│ │ │ │ ├── petstore_title.png
│ │ │ │ ├── dot_transparent.png
│ │ │ │ ├── logo_petstore_big.png
│ │ │ │ ├── logo_webx_small.png
│ │ │ │ ├── tab_selected_left.png
│ │ │ │ ├── tab_selected_mid.png
│ │ │ │ ├── logo_petstore_small.png
│ │ │ │ └── tab_selected_right.png
│ │ │ ├── templates
│ │ │ │ ├── screen
│ │ │ │ │ └── homepage.vm
│ │ │ │ ├── control
│ │ │ │ │ ├── topNoLogo.vm
│ │ │ │ │ ├── top.vm
│ │ │ │ │ ├── tabs.vm
│ │ │ │ │ ├── nav.vm
│ │ │ │ │ └── bottom.vm
│ │ │ │ └── layout
│ │ │ │ │ └── default.vm
│ │ │ └── css
│ │ │ │ ├── petstore-common.css
│ │ │ │ └── petstore-homepage.css
│ │ ├── common
│ │ │ └── templates
│ │ │ │ ├── screen
│ │ │ │ └── error.vm
│ │ │ │ ├── layout
│ │ │ │ └── default.vm
│ │ │ │ └── macros.vm
│ │ ├── META-INF
│ │ │ └── autoconf
│ │ │ │ └── auto-config.xml
│ │ └── WEB-INF
│ │ │ ├── home
│ │ │ └── form.xml
│ │ │ ├── common
│ │ │ ├── webx-component.xml
│ │ │ ├── pipeline-exception.xml
│ │ │ └── resources.xml
│ │ │ ├── webx-home.xml
│ │ │ ├── logback.xml
│ │ │ ├── webx-store.xml
│ │ │ ├── web.xml
│ │ │ └── webx-user.xml
│ │ └── java
│ │ └── com
│ │ └── alibaba
│ │ └── sample
│ │ └── petstore
│ │ └── web
│ │ ├── common
│ │ ├── util
│ │ │ └── PetstoreUserTool.java
│ │ ├── PetstoreConstant.java
│ │ └── PetstoreUser.java
│ │ ├── store
│ │ └── module
│ │ │ ├── control
│ │ │ └── CategoryList.java
│ │ │ ├── screen
│ │ │ ├── CategoryList.java
│ │ │ ├── AddProduct.java
│ │ │ ├── ViewCart.java
│ │ │ └── ItemList.java
│ │ │ └── action
│ │ │ └── AddProductAction.java
│ │ ├── user
│ │ └── module
│ │ │ └── screen
│ │ │ ├── Account.java
│ │ │ └── RegisterAccount.java
│ │ ├── home
│ │ └── module
│ │ │ └── screen
│ │ │ └── Redirect.java
│ │ └── servlet
│ │ └── GetLoginUser.java
├── dal
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── petstore
│ │ │ │ │ └── dal
│ │ │ │ │ ├── sqlmap-config.xml
│ │ │ │ │ ├── sqlmap
│ │ │ │ │ ├── Sequence.xml
│ │ │ │ │ ├── Category.xml
│ │ │ │ │ ├── OrderItem.xml
│ │ │ │ │ ├── Product.xml
│ │ │ │ │ └── ProductItem.xml
│ │ │ │ │ ├── dao.xml
│ │ │ │ │ └── data-source.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── alibaba
│ │ │ │ └── sample
│ │ │ │ └── petstore
│ │ │ │ └── dal
│ │ │ │ ├── dao
│ │ │ │ ├── SequenceDao.java
│ │ │ │ ├── CategoryDao.java
│ │ │ │ ├── OrderDao.java
│ │ │ │ ├── UserDao.java
│ │ │ │ ├── ProductDao.java
│ │ │ │ ├── ProductItemDao.java
│ │ │ │ └── ibatis
│ │ │ │ │ ├── IbatisCategoryDao.java
│ │ │ │ │ ├── IbatisSequenceDao.java
│ │ │ │ │ ├── IbatisOrderDao.java
│ │ │ │ │ ├── IbatisUserDao.java
│ │ │ │ │ ├── IbatisProductDao.java
│ │ │ │ │ └── IbatisProductItemDao.java
│ │ │ │ └── dataobject
│ │ │ │ ├── Sequence.java
│ │ │ │ ├── Profile.java
│ │ │ │ ├── CartItem.java
│ │ │ │ ├── User.java
│ │ │ │ ├── Category.java
│ │ │ │ ├── Product.java
│ │ │ │ └── Cart.java
│ │ └── test
│ │ │ ├── config
│ │ │ └── resources.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── alibaba
│ │ │ └── sample
│ │ │ └── petstore
│ │ │ └── dal
│ │ │ └── dao
│ │ │ ├── AbstractDataAccessTests.java
│ │ │ ├── SequenceDaoTests.java
│ │ │ └── CategoryDaoTests.java
│ └── pom.xml
└── biz
│ ├── src
│ ├── main
│ │ ├── resources
│ │ │ └── petstore
│ │ │ │ └── biz
│ │ │ │ └── manager.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── alibaba
│ │ │ └── sample
│ │ │ └── petstore
│ │ │ └── biz
│ │ │ ├── StoreManagerException.java
│ │ │ ├── DuplicatedProductException.java
│ │ │ ├── UserManagerException.java
│ │ │ ├── DuplicatedUserException.java
│ │ │ ├── StoreManager.java
│ │ │ ├── UserManager.java
│ │ │ └── impl
│ │ │ └── UserManagerImpl.java
│ └── test
│ │ ├── config
│ │ └── resources.xml
│ │ └── java
│ │ └── com
│ │ └── alibaba
│ │ └── sample
│ │ └── petstore
│ │ └── biz
│ │ └── AbstractBizManagerTests.java
│ └── pom.xml
├── archetype-webx-quickstart
├── src
│ └── main
│ │ └── resources
│ │ ├── archetype-resources
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── webapp
│ │ │ │ ├── app1
│ │ │ │ │ └── templates
│ │ │ │ │ │ ├── screen
│ │ │ │ │ │ ├── form
│ │ │ │ │ │ │ ├── welcome.vm
│ │ │ │ │ │ │ └── register.vm
│ │ │ │ │ │ ├── list
│ │ │ │ │ │ │ ├── asHtml.vm
│ │ │ │ │ │ │ ├── asXml.vm
│ │ │ │ │ │ │ └── asJson.vm
│ │ │ │ │ │ └── index.vm
│ │ │ │ │ │ └── layout
│ │ │ │ │ │ └── default.vm
│ │ │ │ ├── common
│ │ │ │ │ └── templates
│ │ │ │ │ │ ├── screen
│ │ │ │ │ │ └── error.vm
│ │ │ │ │ │ ├── layout
│ │ │ │ │ │ └── default.vm
│ │ │ │ │ │ └── macros.vm
│ │ │ │ └── WEB-INF
│ │ │ │ │ ├── common
│ │ │ │ │ ├── webx-component.xml
│ │ │ │ │ ├── uris.xml
│ │ │ │ │ ├── resources.xml
│ │ │ │ │ ├── pipeline-exception.xml
│ │ │ │ │ └── pipeline.xml
│ │ │ │ │ ├── web.xml
│ │ │ │ │ ├── webx-app1.xml
│ │ │ │ │ ├── logback.xml
│ │ │ │ │ └── app1
│ │ │ │ │ └── form.xml
│ │ │ │ └── java
│ │ │ │ └── app1
│ │ │ │ ├── Visitor.java
│ │ │ │ └── module
│ │ │ │ ├── screen
│ │ │ │ ├── form
│ │ │ │ │ └── Welcome.java
│ │ │ │ ├── list
│ │ │ │ │ └── Default.java
│ │ │ │ ├── simple
│ │ │ │ │ ├── SayHi.java
│ │ │ │ │ ├── Download.java
│ │ │ │ │ ├── SayHiImage.java
│ │ │ │ │ └── Count.java
│ │ │ │ └── multievent
│ │ │ │ │ ├── SayHello1.java
│ │ │ │ │ └── SayHello2.java
│ │ │ │ └── action
│ │ │ │ └── RegisterAction.java
│ │ └── .gitignore
│ │ └── META-INF
│ │ └── maven
│ │ └── archetype-metadata.xml
└── pom.xml
├── .gitignore
└── DEPLOY.txt
/.idea/.name:
--------------------------------------------------------------------------------
1 | citrus-sample
--------------------------------------------------------------------------------
/petstore/web/src/main/webapp/user/templates/screen/login.vm:
--------------------------------------------------------------------------------
1 | $control.setTemplate("login")
--------------------------------------------------------------------------------
/petstore/web/src/main/webapp/store/templates/screen/categoryList.vm:
--------------------------------------------------------------------------------
1 | $control.setTemplate("categoryList")
--------------------------------------------------------------------------------
/.idea/dictionaries/baobao.xml:
--------------------------------------------------------------------------------
1 |
Welcome, $name!
3 | -------------------------------------------------------------------------------- /petstore/web/src/main/webapp/home/images/logo_petstore_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webx/citrus-sample/HEAD/petstore/web/src/main/webapp/home/images/logo_petstore_small.png -------------------------------------------------------------------------------- /petstore/web/src/main/webapp/home/images/tab_selected_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webx/citrus-sample/HEAD/petstore/web/src/main/webapp/home/images/tab_selected_right.png -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 || $control.setTemplate("nav") | 5 ||
| 11 | | |
| $control.setTemplate("nav") | 7 ||||
| 13 | | |||
|
8 | $cat.name
9 |
10 | #foreach ( $prod in $cat.productList)
11 | #if($velocityCount > 1) | #end
12 | $prod.name
13 | #end
14 | |
15 |
| $control.setTemplate("home:top") | 15 |
| $screen_placeholder | 18 |
| $control.setTemplate("home:bottom") | 21 |
| $control.setTemplate("home:top") | 15 ||
18 |
|
24 | |
| $control.setTemplate("home:bottom") | 27 |
8 |
|
23 | |||||
|
10 |
|
17 |
| $category.name | 7 ||||||||||||
| $product.name - $product.description | 10 ||||||||||||
13 |
|
32 | |||||||||||
| 4 | 注册 5 | | 6 |7 | | 8 | | 9 |10 | #if ($petstoreUser.hasLoggedIn()) 11 | 退出 $petstoreUser.id 12 | #else 13 | 登录 14 | #end 15 | | 16 |17 | | 18 | | 19 |20 | 用户信息 21 | | 22 |23 | | 24 | | 25 |
26 | |
28 | 29 | | 30 | | 31 |32 | 库存管理 33 | | 34 |
|
6 | 7 | 网上贸易 尽在阿里巴巴: 中国站 | 国际站 | 日文站 | 淘宝站 | 支付宝 8 | 9 |10 | Copyright © 1999-2005 Alibaba.com Corporation and its licensors. All rights reserved. 11 | 12 | |
13 |
null
34 | */
35 | User login(String userId, String password);
36 |
37 | /**
38 | * 注册用户。
39 | *
40 | * @param user 用户对象
41 | */
42 | void register(User user) throws DuplicatedUserException;
43 |
44 | /**
45 | * 更新用户的信息。
46 | *
47 | * @param user 用户对象
48 | */
49 | void update(User user);
50 |
51 | /**
52 | * 取得指定id的用户。
53 | *
54 | * @param userId 用户id
55 | * @return 指定id的用户
56 | */
57 | User getUser(String userId);
58 | }
59 |
--------------------------------------------------------------------------------
/petstore/dal/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | | $category.name | 7 ||||||||||||||||||||||
| $product.name - $product.description 10 | #if ($itemAdded) 11 | | 已加入购物车,您可以 [继续购物] 12 | #end 13 | | 14 ||||||||||||||||||||||
17 |
|
42 | |||||||||||||||||||||
null
41 | */
42 | public User login(String userId, String password) {
43 | return userDao.getAuthenticatedUser(userId, password);
44 | }
45 |
46 | /**
47 | * 注册用户。
48 | *
49 | * @param user 用户对象
50 | * @return 新的用户信息
51 | */
52 | public void register(User user) throws DuplicatedUserException {
53 | User dupuser = userDao.getUserById(user.getUserId());
54 |
55 | if (dupuser != null) {
56 | throw new DuplicatedUserException("duplicated user: " + user.getUserId());
57 | }
58 |
59 | userDao.insertUser(user);
60 | }
61 |
62 | /**
63 | * 更新用户的信息。
64 | *
65 | * @param user 用户对象
66 | * @return 新的用户信息
67 | */
68 | public void update(User user) {
69 | userDao.updateUser(user);
70 | }
71 |
72 | /**
73 | * 取得指定id的用户。
74 | *
75 | * @param userId 用户id
76 | * @return 指定id的用户
77 | */
78 | public User getUser(String userId) {
79 | return userDao.getUserById(userId);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/petstore/dal/src/main/java/com/alibaba/sample/petstore/dal/dao/ibatis/IbatisProductDao.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2002-2012 Alibaba Group Holding Limited.
3 | * All rights reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.alibaba.sample.petstore.dal.dao.ibatis;
19 |
20 | import static com.alibaba.citrus.util.CollectionUtil.*;
21 | import static com.alibaba.citrus.util.StringUtil.*;
22 |
23 | import java.util.List;
24 |
25 | import com.alibaba.sample.petstore.dal.dao.ProductDao;
26 | import com.alibaba.sample.petstore.dal.dataobject.Product;
27 | import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
28 |
29 | public class IbatisProductDao extends SqlMapClientDaoSupport implements ProductDao {
30 | @SuppressWarnings("unchecked")
31 | public List| 9 | 71 | | 72 |