Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Sep 21, 2017
1 parent 72e62cb commit a2aba04
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
**/pom.xml.versionsBackup
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# 拓展工具,office文档处理,动态脚本等

[![Maven Central](https://img.shields.io/maven-central/v/org.hswebframework/hsweb-expands.svg?style=plastic)](http://search.maven.org/#search%7Cga%7C1%7Chsweb-expands)
2 changes: 1 addition & 1 deletion hsweb-expands-compress/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-office/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-request/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public void testEmail() throws Exception {

@Test
public void testWebService() throws Exception {
WebServiceRequest request = builder.webService().wsdl("http://192.168.2.150:9003/webservices/dataCollection?wsdl");
WebServiceRequest request = builder.webService()
.wsdl("/home/zhouhao/云文档/项目/apsp/接口文档/WSDL/查询密码验证.wsdl");
System.out.println(request.interfaces());
System.out.println(request.services());
for (String s : request.interfaces()) {
Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-script/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public boolean compile(String id, String code) throws Exception {

@Override
public void addListener(ScriptListener scriptListener) {
if (scriptListeners != null) {
if (scriptListeners == null) {
scriptListeners = new LinkedList<>();
}
scriptListeners.add(scriptListener);
Expand Down Expand Up @@ -139,4 +139,12 @@ public CompiledScript getScript() {
return script;
}
}

public Bindings getUtilBindings() {
return utilBindings;
}

public void setUtilBindings(Bindings utilBindings) {
this.utilBindings = utilBindings;
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package org.hswebframework.expands.script.engine;

import org.hswebframework.expands.script.engine.common.CommonScriptEngine;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.script.AbstractScriptEngine;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import java.util.*;

public class DynamicScriptEngineTest {

@Test
public void testJava() throws Exception {
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("java");
engine.compile("111", "package test.myTest;" +
"\npublic class Test implements org.hsweb.expands.script.engine.java.Executor{\n" +
"\npublic class Test implements org.hswebframework.expands.script.engine.java.Executor{\n" +
" public Object execute(java.util.Map<String, Object> param){" +
" param.put(\"test\",\"测试\");" +
" return param;" +
Expand Down Expand Up @@ -65,11 +66,27 @@ public void testOgnl() throws Exception {

@Test
public void testJavascript() throws Exception {
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("js");
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("groovy");
Bindings bindings = ((CommonScriptEngine) engine).getUtilBindings();
((CommonScriptEngine) engine).setUtilBindings(new SimpleBindings(bindings) {
@Override
public Object get(Object key) {
return super.get(key);
}

@Override
public boolean containsKey(Object key) {
return super.containsKey(key);
}

@Override
public Set<Entry<String, Object>> entrySet() {
return super.entrySet();
}
});
engine.addGlobalVariable(Collections.singletonMap("logger", LoggerFactory.getLogger("org.hsweb.script.javascript")));

engine.compile("test", "logger.info('test')");
engine.compile("test", "logger.error('test')");
engine.execute("test").getIfSuccess();
}

Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-shell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion hsweb-expands-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-expands</artifactId>
<groupId>org.hswebframework</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
118 changes: 111 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.hswebframework</groupId>
<artifactId>hsweb-expands</artifactId>
<packaging>pom</packaging>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<modules>
<module>hsweb-expands-script</module>
<module>hsweb-expands-office</module>
Expand All @@ -17,6 +17,38 @@
<module>hsweb-expands-template</module>
<module>hsweb-expands-security</module>
</modules>


<name>${project.groupId}:${project.artifactId}</name>
<url>http://www.hswebframework.org</url>
<description>hsweb拓展工具集</description>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>zhouhao</name>
<email>[email protected]</email>
<roles>
<role>Owner</role>
</roles>
<timezone>+8</timezone>
<url>https://github.com/zhou-hao</url>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/hs-web/hsweb-expands.git</connection>
<developerConnection>scm:git:https://github.com/hs-web/hsweb-expands.git</developerConnection>
<url>https://github.com/hs-web/hsweb-expands</url>
<tag>${project.version}</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.locales>zh_CN</project.build.locales>
Expand All @@ -27,8 +59,68 @@
<slf4j.version>1.7.21</slf4j.version>
<logback.version>1.1.7</logback.version>

<hsweb.utils.version>3.0.0-SNAPSHOT</hsweb.utils.version>
<hsweb.utils.version>3.0.0</hsweb.utils.version>
</properties>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-releases</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
Expand Down Expand Up @@ -172,16 +264,28 @@
</snapshots>
</repository>
</repositories>
<!--<distributionManagement>-->
<!--<repository>-->
<!--<id>releases</id>-->
<!--<name>Nexus Release Repository</name>-->
<!--<url>http://nexus.hsweb.me/content/repositories/releases/</url>-->
<!--</repository>-->
<!--<snapshotRepository>-->
<!--<id>snapshots</id>-->
<!--<name>Nexus Snapshot Repository</name>-->
<!--<url>http://nexus.hsweb.me/content/repositories/snapshots/</url>-->
<!--</snapshotRepository>-->
<!--</distributionManagement>-->
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://nexus.hsweb.me/content/repositories/releases/</url>
<id>sonatype-releases</id>
<name>sonatype repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<id>sonatype-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://nexus.hsweb.me/content/repositories/snapshots/</url>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

0 comments on commit a2aba04

Please sign in to comment.