Skip to content

Commit f16fb6c

Browse files
GeorgeGeorge
George
authored and
George
committed
开源后提交全部源代码
1 parent cdfe2d7 commit f16fb6c

15 files changed

+1301
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target
2+
nbactions.xml
3+
.idea
4+
out
5+
*.bat
6+
*.sh
7+
*.iml

lib/Georgeinfo-BasicToolkit.jar

924 KB
Binary file not shown.

pom.xml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.georgeinfo.pagination</groupId>
8+
<artifactId>GPagination</artifactId>
9+
<version>1.0.0</version>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<maven.compiler.source>1.8</maven.compiler.source>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.fasterxml.jackson.core</groupId>
20+
<artifactId>jackson-core</artifactId>
21+
<version>2.9.1</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.fasterxml.jackson.core</groupId>
25+
<artifactId>jackson-annotations</artifactId>
26+
<version>2.9.1</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.fasterxml.jackson.core</groupId>
30+
<artifactId>jackson-databind</artifactId>
31+
<version>2.9.1</version>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>javax</groupId>
36+
<artifactId>javaee-web-api</artifactId>
37+
<version>7.0</version>
38+
<scope>provided</scope>
39+
</dependency>
40+
41+
42+
<dependency>
43+
<groupId>javax.servlet</groupId>
44+
<artifactId>jstl</artifactId>
45+
<version>1.2</version>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>junit</groupId>
50+
<artifactId>junit</artifactId>
51+
<version>4.12</version>
52+
<scope>test</scope>
53+
</dependency>
54+
55+
56+
<!-- 添加本地依赖 开始 -->
57+
<dependency>
58+
<groupId>com.georgeinfo.basictoolkit</groupId>
59+
<artifactId>GBasicToolkit</artifactId>
60+
<version>1.1.1</version>
61+
<scope>system</scope>
62+
<!--本地jar的路径,相对或者绝对都可以-->
63+
<systemPath>${project.basedir}\lib\Georgeinfo-BasicToolkit.jar</systemPath>
64+
</dependency>
65+
66+
67+
<!-- 添加本地依赖 结束 -->
68+
</dependencies>
69+
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-surefire-plugin</artifactId>
76+
<version>2.21.0</version>
77+
<configuration>
78+
<forkMode>once</forkMode>
79+
<argLine>-Dfile.encoding=UTF-8</argLine>
80+
<!-- 打包时,不执行单元测试 -->
81+
<skipTests>true</skipTests>
82+
</configuration>
83+
</plugin>
84+
85+
<!-- 生成jar相关的插件 开始(主要是为了生成带有main方法的可执行jar,否则不需要配置这些插件) -->
86+
<plugin>
87+
<artifactId>maven-jar-plugin</artifactId>
88+
<version>3.0.0</version>
89+
<configuration>
90+
<archive>
91+
<addMavenDescriptor>false</addMavenDescriptor>
92+
<manifestEntries>
93+
<Main-Version>${version}</Main-Version>
94+
</manifestEntries>
95+
<manifest>
96+
<mainClass>mainentry.PaginationMain</mainClass>
97+
<addClasspath>true</addClasspath>
98+
<classpathPrefix>lib/</classpathPrefix>
99+
</manifest>
100+
</archive>
101+
<excludes>
102+
<exclude>test</exclude>
103+
</excludes>
104+
<classesDirectory>target/classes/</classesDirectory>
105+
</configuration>
106+
</plugin>
107+
<!-- 生成jar相关的插件 结束(主要是为了生成带有main方法的可执行jar,否则不需要配置这些插件) -->
108+
</plugins>
109+
110+
<!-- 让maven可以编译静态配置文件 开始 -->
111+
<resources>
112+
<resource>
113+
<directory>src/main/resources</directory>
114+
</resource>
115+
<resource>
116+
<directory>src/main/java</directory>
117+
<includes>
118+
<include>**/*.xml</include>
119+
<include>**/*.tld</include>
120+
<include>**/*.properties</include>
121+
</includes>
122+
<filtering>true</filtering>
123+
</resource>
124+
<!-- resource>
125+
<directory>src/test/resources</directory>
126+
</resource -->
127+
</resources>
128+
<!-- 让maven可以编译静态配置文件 结束 -->
129+
</build>
130+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
5+
version="2.0">
6+
7+
<description>Ginkgo 分页标签</description>
8+
9+
<display-name>"Ginkgo Pagination Kit Tags"</display-name>
10+
<tlib-version>1.0</tlib-version>
11+
<short-name>si</short-name>
12+
<!-- 定义该标签库的URI -->
13+
<uri>http://georgeinfo.com/paginationframework/tags</uri>
14+
15+
<!-- 定义分页栏 标签 开始 -->
16+
<!-- 普通Html分页栏 -->
17+
<tag>
18+
<!-- 标签描述 -->
19+
<description>
20+
<![CDATA[ 乔治JDBC分页栏标签 ]]>
21+
</description>
22+
<!-- 定义标签名 -->
23+
<name>paging</name>
24+
<!-- 定义标签处理类 -->
25+
<tag-class>com.georgeinfo.pagination.tags.jsp.PaginationTag</tag-class>
26+
<!-- 定义标签体为空 -->
27+
<body-content>empty</body-content>
28+
29+
<attribute>
30+
<name>data</name>
31+
<required>true</required>
32+
<fragment>true</fragment>
33+
</attribute>
34+
35+
<attribute>
36+
<name>cssClass</name>
37+
<required>false</required>
38+
<fragment>false</fragment>
39+
</attribute>
40+
41+
<attribute>
42+
<name>htmlFormTag</name>
43+
<required>false</required>
44+
<fragment>false</fragment>
45+
</attribute>
46+
</tag>
47+
48+
<!-- Json分页栏 -->
49+
<tag>
50+
<!-- 标签描述 -->
51+
<description><![CDATA[ 乔治Json-JDBC分页栏标签 ]]>
52+
</description>
53+
<!-- 定义标签名:jpb = Json Paging Bar -->
54+
<name>jpb</name>
55+
<!-- 定义标签处理类 -->
56+
<tag-class>com.georgeinfo.pagination.tags.jsp.JsonPaginationTag</tag-class>
57+
<!-- 定义标签体为空 -->
58+
<body-content>empty</body-content>
59+
60+
<attribute>
61+
<name>data</name>
62+
<required>true</required>
63+
<fragment>true</fragment>
64+
</attribute>
65+
66+
<attribute>
67+
<name>varName</name>
68+
<required>false</required>
69+
<fragment>true</fragment>
70+
</attribute>
71+
72+
<attribute>
73+
<name>renderer</name><!-- 渲染器:目前支持的值:bootstrap -->
74+
<required>false</required>
75+
<fragment>true</fragment><!-- 设置该属性是否支持JSP脚本、表达式等动态内容,取值为true或false -->
76+
</attribute>
77+
</tag>
78+
79+
<!-- Json解析执行器调用标签 -->
80+
<tag>
81+
<!-- 标签描述 -->
82+
<description><![CDATA[ 乔治Json-JDBC-解析分页栏标签 ]]>
83+
</description>
84+
<!-- 定义标签名:jpb = Json Paging Bar -->
85+
<name>jpbdo</name>
86+
<!-- 定义标签处理类 -->
87+
<tag-class>com.georgeinfo.pagination.tags.jsp.JsonActuatorTag</tag-class>
88+
<!-- 定义标签体为空 -->
89+
<body-content>empty</body-content>
90+
91+
<attribute>
92+
<name>varName</name>
93+
<required>false</required>
94+
<fragment>true</fragment>
95+
</attribute>
96+
</tag>
97+
<!-- 定义分页栏 标签 结束 -->
98+
99+
</taglib>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.georgeinfo.pagination.context;
2+
3+
import java.util.HashMap;
4+
import java.util.List;
5+
6+
public interface GenericPagingContext {
7+
8+
public static final Long DEFAULT_PAGE_SIZE = 16L;
9+
10+
/**
11+
* 初始化分页上下文环境
12+
*/
13+
public void init();
14+
15+
public Long getTotalRecords();
16+
17+
public void setTotalRecords(Long totalRecords);
18+
19+
public Long getCurrentPageNo();
20+
21+
public void setCurrentPageNo(Long currentPageNo);
22+
23+
public Long getPageSize();
24+
25+
public void setPageSize(Long pageSize);
26+
27+
public void setTotalPages(Long totalPages);
28+
29+
public Long getTotalPages();
30+
31+
public String getBaseUri();
32+
33+
public void setBaseUri(String baseUri);
34+
35+
public HashMap<String, Object> getParams();
36+
37+
public void setParams(HashMap<String, Object> params);
38+
39+
/**
40+
* 得到url的参数字符串部分,类似“paramA=123&viewType=hello&dateTime=2010-06-18 11:12:10”,
41+
* 返回值不是以&作为开始和结束字符
42+
*
43+
* @return URL查询参数串
44+
*/
45+
public String getParamsQueryString();
46+
47+
public String getBaseUriWithQueryString();
48+
49+
public String getSql();
50+
51+
public void setSql(String sql);
52+
53+
public String getCountSql();
54+
55+
public void setCountSql(String countSql);
56+
57+
public String getFinalSQL();
58+
59+
public void setFinalSQL(String finalSQL);
60+
61+
public HashMap<String, Object> getFinalParams();
62+
63+
public void setFinalParams(HashMap<String, Object> finalParams);
64+
65+
public <T> List<T> getRecordList();
66+
67+
public void setRecordList(List recordList);
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* A George software product.
3+
* Copyright (C) George (http://www.georgeinfo.com), All Rights Reserved..
4+
*/
5+
package com.georgeinfo.pagination.context;
6+
7+
/**
8+
* 分页链接实体类
9+
*
10+
* @author George <[email protected]>
11+
*/
12+
public class PItem {
13+
14+
private String href;
15+
private boolean noLink = false;
16+
17+
private PItem() {
18+
}
19+
20+
public static PItem noLink() {
21+
PItem pi = new PItem();
22+
pi.setNoLink(true);
23+
return pi;
24+
}
25+
26+
public static PItem link(String href) {
27+
PItem pi = new PItem();
28+
pi.setHref(href);
29+
return pi;
30+
}
31+
32+
public String getHref() {
33+
return href;
34+
}
35+
36+
public void setHref(String href) {
37+
this.href = href;
38+
}
39+
40+
public boolean isNoLink() {
41+
return noLink;
42+
}
43+
44+
public void setNoLink(boolean noLink) {
45+
this.noLink = noLink;
46+
}
47+
48+
@Override
49+
public String toString() {
50+
return "PItem{" + "href=" + href + ", noLink=" + noLink + '}';
51+
}
52+
53+
}

0 commit comments

Comments
 (0)