Skip to content

Commit

Permalink
Merge pull request #86 from lunasoft/release/1.0.11.1
Browse files Browse the repository at this point in the history
Release/1.0.11.1
  • Loading branch information
marifersw authored Oct 3, 2023
2 parents 395ab98 + 1bb3b2e commit 552c6ed
Show file tree
Hide file tree
Showing 124 changed files with 2,585 additions and 1,492 deletions.
19 changes: 18 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand All @@ -29,5 +29,22 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 3 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=ISO-8859-1
encoding//src/test/java=ISO-8859-1
encoding//src/test/resources=ISO-8859-1
encoding/<project>=ISO-8859-1
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.lambda.genericSignature=do not generate
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.shareCommonFinallyBlocks=disabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -169,7 +169,7 @@ org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.storeAnnotations=disabled
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
Expand Down
2 changes: 1 addition & 1 deletion .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
activeProfiles=
activeProfiles=release
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
603 changes: 350 additions & 253 deletions README.md

Large diffs are not rendered by default.

168 changes: 94 additions & 74 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
<artifactId>SW-JAVA</artifactId>
<version>1.0.7.2</version>
<version>1.0.11.1</version>
<packaging>jar</packaging>
<scm>
<url>https://github.com/lunasoft/sw-sdk-java</url>
Expand Down Expand Up @@ -96,7 +96,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -106,6 +106,14 @@
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand Down Expand Up @@ -143,6 +151,11 @@
</goals>
</execution>
</executions>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
<detectJavaApiLink>false</detectJavaApiLink>
<failOnError>false</failOnError>
</configuration>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -202,77 +215,84 @@
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<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>
<configuration>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
<detectJavaApiLink>false</detectJavaApiLink>
<source>1.6</source>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<skip>true</skip>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
<detectJavaApiLink>false</detectJavaApiLink>
<failOnError>false</failOnError>
<source>1.7</source>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
13 changes: 13 additions & 0 deletions src/main/java/Services/Pdf/SWPdfService.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,17 @@ public IResponse GeneratePdf(String xml, PdfTemplates templateId, String b64Logo
PdfRequest req = new PdfRequest();
return req.sendRequest(settings);
}
/**
* Servicio para regenerar el PDF de un comprobante previamente timbrado.
* @param uuid UUID del comprobante a regenerar el PDF.
* @return {@link} Utils.Responses.Pdf.PdfResponse
* @throws GeneralException
* @throws AuthException
* @throws IOException
*/
public IResponse RegeneratePdf(String uuid) throws GeneralException, AuthException, IOException{
PdfOptionsRequest settings = new PdfOptionsRequest(getToken(), uuid, RequestHelper.stringEmptyOrNull(getURIAPI()) ? getURI() : getURIAPI(), getProxyHost(), getProxyPort());
PdfRequest request = new PdfRequest();
return request.sendRequestUuid(settings);
}
}
2 changes: 1 addition & 1 deletion src/main/java/Services/SWService.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected SWService(String token, String URI) {

protected SWService(String token, String URI, String ProxyHost, int ProxyPort) {
Token = token;
this.URI = URI;
this.URIAPI = URI;
this.ProxyHost = ProxyHost;
this.ProxyPort = ProxyPort;
this.time = new Date((long)999999999*100000);
Expand Down
28 changes: 21 additions & 7 deletions src/main/java/Services/Stamp/SWStampService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;

public class SWStampService extends SWService {

Expand All @@ -20,8 +22,9 @@ public SWStampService(String user, String password, String URI) throws AuthExcep
public SWStampService(String token, String URI) {
super(token, URI);
}

public SWStampService(String user, String password, String URI, String proxyHost, int proxyPort) throws AuthException {

public SWStampService(String user, String password, String URI, String proxyHost, int proxyPort)
throws AuthException {
super(user, password, URI, proxyHost, proxyPort);
}

Expand All @@ -30,19 +33,22 @@ public SWStampService(String token, String URI, String proxyHost, int proxyPort)
}

public IResponse Stamp(String xml, String version) throws AuthException, GeneralException, IOException {
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, getProxyHost(), getProxyPort(), false);
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, getProxyHost(),
getProxyPort(), false);
StampRequest req = new StampRequest();
return req.sendRequest(settings);
}

public IResponse Stamp(String xml, String version, boolean isb64)
throws AuthException, GeneralException, IOException {
if (isb64) {
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, isb64, getProxyHost(), getProxyPort(), false);
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, isb64,
getProxyHost(), getProxyPort(), false);
StampRequest req = new StampRequest();
return req.sendRequest(settings);
} else {
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, getProxyHost(), getProxyPort(), false);
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xml, version, getProxyHost(),
getProxyPort(), false);
StampRequest req = new StampRequest();
return req.sendRequest(settings);
}
Expand All @@ -51,16 +57,24 @@ public IResponse Stamp(String xml, String version, boolean isb64)
public IResponse Stamp(byte[] xmlFile, String version, boolean isb64)
throws AuthException, GeneralException, IOException {
String xmlProcess = new String(xmlFile, Charset.forName("UTF-8"));
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xmlProcess, version, getProxyHost(), getProxyPort(), false);
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xmlProcess, version,
getProxyHost(), getProxyPort(), false);
StampRequest req = new StampRequest();
return req.sendRequest(settings);
}

public IResponse Stamp(byte[] xmlFile, String version) throws AuthException, GeneralException, IOException {
String xmlProcess = new String(xmlFile, Charset.forName("UTF-8"));
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xmlProcess, version, getProxyHost(), getProxyPort(), false);
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), xmlProcess, version,
getProxyHost(), getProxyPort(), false);
StampRequest req = new StampRequest();
return req.sendRequest(settings);
}

public IResponse StampZip(byte[] zipFile, String version) throws AuthException, GeneralException, IOException {
StampOptionsRequest settings = new StampOptionsRequest(getToken(), getURI(), zipFile, version, getProxyHost(),
getProxyPort());
StampRequest req = new StampRequest();
return req.sendRequestZip(settings);
}
}
Loading

0 comments on commit 552c6ed

Please sign in to comment.