Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,4 @@ site
.jqwik-database

# Eclipse

.factorypath
26 changes: 5 additions & 21 deletions TrueFilingEcf4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>

<executions>
<!--executions>
<execution>
<id>copy-wsdl</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<outputDirectory>target/classes/wsdl/xsd</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>../Niem/src/main/resources/xsd</directory>
<includes>
<include>**/*.xsd</include>
<include>**/**/*.xsd</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</executions-->
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
Expand All @@ -128,16 +115,13 @@
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>target/classes/wsdl/WebServices/dev/ECF-4.0-FilingReviewMDEService.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
<wsdl>target/classes/wsdl/WebServices/dev/ECF-4.0-CourtRecordMDEService.wsdl</wsdl>
<wsdl>src/main/resources/wsdl/WebServices/dev/ECF-4.0-FilingReviewMDEService.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
<wsdl>target/classes/wsdl/WebServices/dev/ECF-4.0-ServiceMDEService.wsdl</wsdl>
<wsdl>src/main/resources/wsdl/WebServices/dev/ECF-4.0-CourtRecordMDEService.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
<wsdl>target/classes/wsdl/WebServices/dev/ECF-4.0-FilingAssemblyMDEService.wsdl</wsdl>
<wsdl>src/main/resources/wsdl/WebServices/dev/ECF-4.0-FilingAssemblyMDEService.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
<additionalJvmArgs>-Djavax.xml.accessExternalDTD=all</additionalJvmArgs>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
package edu.suffolk.litlab.efsp.server.ecf4;
package edu.suffolk.litlab.efsp.tyler;

import java.io.File;
import java.io.StringWriter;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Optional;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ecf4.latest.gov.niem.niem.domains.jxdm._4.CourtType;
import ecf4.latest.gov.niem.niem.fips_10_4._2.CountryCodeType;
Expand All @@ -11,51 +28,27 @@
import ecf4.latest.oasis.names.tc.legalxml_courtfiling.schema.xsd.commontypes_4.CaseFilingType;
import ecf4.latest.oasis.names.tc.legalxml_courtfiling.schema.xsd.commontypes_4.PersonType;
import ecf4.latest.oasis.names.tc.legalxml_courtfiling.schema.xsd.commontypes_4.QueryMessageType;
import ecf4.latest.oasis.names.tc.legalxml_courtfiling.schema.xsd.commontypes_4.QueryResponseMessageType;
import edu.suffolk.litlab.efsp.server.utils.ServiceHelpers;
import edu.suffolk.litlab.efsp.tyler.TylerErrorCodes;
import jakarta.ws.rs.core.Response;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import java.io.File;
import java.io.StringWriter;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Helper class that easily converts Java native types to Cumbersome XML Schema types, particularly
* those from Oasis's ECF standard, and the National Information Exchange Model (NIEM).
*
* <p>Some information about NIEM: Many of the types here all include the
* "SimpleObjectAttributeGroup", which, "provides a collection of attributes which are appropriate
* for definition of object types", including an ID attribute, a Metadata attribute, and a Link
* Metadata attribute that directly reference objects via IDs instead of including the object as an
* element. TBH, I'm not sure what the design decisions that dictate the use of them are, but they
* exist.
*
* @author Bryce Willey
*/
public class Ecf4Helper {
private static final Logger log = LoggerFactory.getLogger(Ecf4Helper.class);

static final ecf4.latest.gov.niem.niem.proxy.xsd._2.ObjectFactory niemProxyObjFac;
static final ecf4.latest.gov.niem.niem.niem_core._2.ObjectFactory niemCoreObjFac;
static final ecf4.latest.gov.niem.niem.domains.jxdm._4.ObjectFactory jxObjFac;
static final DatatypeFactory datatypeFac;

/**
* One of the ways that you can communicate over ECF. For more information, see
* https://docs.oasis-open.org/legalxml-courtfiling/specs/ecf/v4.01/ecf-v4.01-spec/errata02/os/ecf-v4.01-spec-errata02-os-complete.html#_Toc425241629
*/
public static final String MDE_PROFILE_CODE =
"urn:oasis:names:tc:legalxml-courtfiling:schema:xsd:WebServicesMessaging-2.0";


static {
niemProxyObjFac = new ecf4.latest.gov.niem.niem.proxy.xsd._2.ObjectFactory();
niemCoreObjFac = new ecf4.latest.gov.niem.niem.niem_core._2.ObjectFactory();
Expand Down Expand Up @@ -83,6 +76,11 @@ public static DateType convertDate(LocalDate date) {
dt.setDateRepresentation(niemCoreObjFac.createDate(d));
return dt;
}

public static LocalDate parseDate(DateType dt) {
var d = ((ecf4.latest.gov.niem.niem.proxy.xsd._2.Date) dt.getDateRepresentation().getValue()).getValue();
return LocalDate.of(d.getYear(), d.getMonth(), d.getDay());
}

/** Niem's Boolean type: either true or false. */
public static ecf4.latest.gov.niem.niem.proxy.xsd._2.Boolean convertBool(boolean bool) {
Expand Down Expand Up @@ -293,7 +291,7 @@ public static CountryCodeType strToCountryCode(String country) {
return cct;
}

public static <T extends QueryMessageType> T prep(T newMsg, String courtId) {
public static <T extends QueryMessageType> T prep(T newMsg, String courtId, String locationId) {
EntityType typ = new EntityType();
var commonObjFac =
new ecf4.latest.oasis.names.tc.legalxml_courtfiling.schema.xsd.commontypes_4
Expand All @@ -305,16 +303,11 @@ public static <T extends QueryMessageType> T prep(T newMsg, String courtId) {
// Example in the ECF4 docs is "https://filingreviewmde.com", which matches best to
// EXTERNAL_URL.
// Doesn't seem to be used by Tyler however.
newMsg.setSendingMDELocationID(Ecf4Helper.convertId(ServiceHelpers.EXTERNAL_URL));
newMsg.setSendingMDEProfileCode(ServiceHelpers.MDE_PROFILE_CODE);
newMsg.setSendingMDELocationID(Ecf4Helper.convertId(locationId));
newMsg.setSendingMDEProfileCode(MDE_PROFILE_CODE);
return newMsg;
}

public static Response makeResponse(
QueryResponseMessageType resp, Supplier<Response> defaultRespFunc) {
return mapTylerCodesToHttp(checkErrors(resp.getError()), defaultRespFunc);
}

public record Error(String code, String text) {}

/**
Expand All @@ -337,23 +330,8 @@ public static List<Error> checkErrors(
return errors.stream().flatMap(err -> checkError(err).stream()).toList();
}

public static Response mapTylerCodesToHttp(List<Error> err, Supplier<Response> defaultResp) {
if (!err.isEmpty()) {
var mainErr = err.getFirst();
if (TylerErrorCodes.tylerToHttp.containsKey(mainErr.code)) {
return Response.status(TylerErrorCodes.tylerToHttp.get(mainErr.code))
.entity(mainErr.text)
.build();
}

// 422 as semantic issues covers most of the error codes
return Response.status(422).entity(mainErr.text).build();
}
return defaultResp.get();
}

public static void setupReplys(CaseFilingType reply) {
reply.setSendingMDELocationID(Ecf4Helper.convertId(ServiceHelpers.SERVICE_URL));
reply.setSendingMDEProfileCode(ServiceHelpers.MDE_PROFILE_CODE);
public static void setupReplys(CaseFilingType reply, String locationId) {
reply.setSendingMDELocationID(Ecf4Helper.convertId(locationId));
reply.setSendingMDEProfileCode(MDE_PROFILE_CODE);
}
}
2 changes: 2 additions & 0 deletions TylerEfmClient/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.apt_generated/
/.apt_generated_tests/
3 changes: 2 additions & 1 deletion TylerEfmClient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<artifactId>efspserver-parent</artifactId>
<version>1.4.0</version>
</parent>
<groupId>edu.suffolk.litlab</groupId>
<artifactId>tyler-efm-client</artifactId>
<name>Tyler EFM Services Client code</name>
<description>For Tyler's EFMUserService and EFMFirmService. Lets you choose the specific version that you want to interact with.</description>

<properties>
<cxf.version>4.1.6</cxf.version>
<!-- automatically run annotation processors within the incremental compilation -->
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>

<dependencies>
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<module>TylerEfmClient</module>
<module>TylerEcf4</module>
<module>TylerEcf5</module>
<module>TrueFilingEcf4</module>
<module>proxyserver</module>
</modules>

Expand Down Expand Up @@ -74,6 +75,11 @@
<artifactId>tyler-ecf5</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>edu.suffolk.litlab</groupId>
<artifactId>truefiling-ecf4</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.mapstruct</groupId>
Expand Down Expand Up @@ -108,6 +114,7 @@
<goals>
<goal>docs</goal>
</goals>
<phase>site</phase>
<configuration>
<configFile>enunciate.xml</configFile>
<docsDir>${project.build.directory}/enunciate-docs</docsDir>
Expand Down
4 changes: 4 additions & 0 deletions proxyserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<groupId>edu.suffolk.litlab</groupId>
<artifactId>tyler-ecf5</artifactId>
</dependency>
<dependency>
<groupId>edu.suffolk.litlab</groupId>
<artifactId>truefiling-ecf4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package edu.suffolk.litlab.efsp.ecf4;

/**
* Straight from ECF4 Spec:
* https://docs.oasis-open.org/legalxml-courtfiling/specs/ecf/v4.01/ecf-v4.01-spec/os/ecf-v4.01-spec-os.html#_Toc343512773
*
* <p>Enumerated in a few other places, but none of the XML has a straight enum to use.
*/
public enum EcfCaseTypes {
AppellateCase,
BankruptcyCase,
CitationCase,
CivilCase,
CriminalCase,
DomesticCase,
JuvenileCase;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -40,6 +42,8 @@ public CodeDatabaseAPI(Connection conn) {
* Maps the name of an ECF element to be substituted by a court-specific code list or extension.
*/
public abstract Map<String, String> xmlElemToTableName();

public abstract Set<String> systemTables();

/**
* Gets all court location identifiers (CLI) stored in the database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
public class CodeDatabaseUtils {
/** This exception is returned when a given table name isn't in the pre-approved list of names. */
public static class UnsupportedTableException extends SQLException {
public UnsupportedTableException(String message) {
private static final long serialVersionUID = 42L;

public UnsupportedTableException(String message) {
super(message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* (instead of an ops issue).
*/
public class CodeDocException extends Exception {
private static final long serialVersionUID = 1L;

public CodeDocException(String message, Throwable ex) {
super(message, ex);
}
Expand Down
Loading
Loading