Skip to content

Commit

Permalink
Merge pull request #1 from gavincornwell/feature-comprehend
Browse files Browse the repository at this point in the history
Added new type to model insurance claim reports.
  • Loading branch information
Gavin Cornwell committed Dec 19, 2017
2 parents ca78002 + 3303150 commit 76255ff
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 29 deletions.
2 changes: 1 addition & 1 deletion firehose-extension-platform-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>firehose-extension</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.1</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,37 +41,41 @@
</constraint>
</constraints>

<!-- ===============================================================================================================
Constraints, Types, and Aspects go here...
-->

<types>
<!-- Type to represent insurance claim images -->
<type name="acme:insuranceClaimImage">
<title>Insurance Claim Image</title>
<!-- Base type of insurance claim types -->
<type name="acme:insuranceClaimBase">
<title>Insurance Claim Base Type</title>
<parent>cm:content</parent>
<properties>
<property name="acme:imageId">
<title>Image Identification Number</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="acme:claimNumber">
<title>Claim Number</title>
<type>d:long</type>
</property>
<property name="acme:insuranceNumber">
<title>Insurance Number</title>
<type>d:long</type>
</property>
<property name="acme:claimDate">
<title>Claim Date</title>
<type>d:date</type>
</property>
<property name="acme:insuranceNumber">
<title>Insurance Number</title>
<type>d:long</type>
</property>
<property name="acme:insuredName">
<title>Insured Name</title>
<type>d:text</type>
</property>
</properties>
</type>

<!-- Type to represent insurance claim images -->
<type name="acme:insuranceClaimImage">
<title>Insurance Claim Image</title>
<parent>acme:insuranceClaimBase</parent>
<properties>
<property name="acme:imageId">
<title>Image Identification Number</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="acme:claimType">
<title>Claim Type</title>
<type>d:text</type>
Expand All @@ -86,6 +90,35 @@
</property>
</properties>
</type>

<!-- Type to represent insurance claim reports -->
<type name="acme:insuranceClaimReport">
<title>Insurance Claim Report</title>
<parent>acme:insuranceClaimBase</parent>
<properties>
<property name="acme:reportId">
<title>Report Identification Number</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="acme:claimAdjuster">
<title>Claim Adjuster</title>
<type>d:text</type>
</property>
<property name="acme:visitDate">
<title>Visit Date</title>
<type>d:date</type>
</property>
<property name="acme:visitLocation">
<title>Visit Location</title>
<type>d:text</type>
</property>
<property name="acme:visitFollowUp">
<title>Follow Up Visit Required</title>
<type>d:boolean</type>
</property>
</properties>
</type>
</types>

</model>
2 changes: 1 addition & 1 deletion firehose-extension-share-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>firehose-extension</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.1</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<config evaluator="string-compare" condition="DocumentLibrary">

<types>
<!-- Define the ACME claim image type as decedent from cm:content -->
<!-- Define the ACME claim image types as a decedent from cm:content -->
<type name="cm:content">
<subtype name="acme:insuranceClaimImage"/>
<subtype name="acme:insuranceClaimReport"/>
</type>
</types>
</config>
Expand Down Expand Up @@ -79,5 +80,64 @@
</form>
</forms>
</config>

<!-- View and Edit forms for acme:insuranceClaimReport -->
<config evaluator="node-type" condition="acme:insuranceClaimReport">
<forms>
<form>
<field-visibility>
<!-- default fields -->
<show id="cm:name"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>
<show id="mimetype"/>
<show id="cm:author" force="true"/>
<show id="size" for-mode="view"/>
<show id="cm:creator" for-mode="view"/>
<show id="cm:created" for-mode="view"/>
<show id="cm:modifier" for-mode="view"/>
<show id="cm:modified" for-mode="view"/>

<!-- tags -->
<show id="cm:taggable" for-mode="edit" force="true"/>

<!-- cm:geographic aspect -->
<show id="cm:latitude"/>
<show id="cm:longitude"/>

<!-- ACME custom props -->
<show id="acme:reportId" force="true"/>
<show id="acme:insuranceNumber" force="true"/>
<show id="acme:insuredName" force="true"/>
<show id="acme:claimNumber" force="true"/>
<show id="acme:claimDate" force="true"/>
<show id="acme:claimAdjuster" force="true"/>
<show id="acme:visitDate" force="true"/>
<show id="acme:visitLocation" force="true"/>
<show id="acme:visitFollowUp" force="true"/>
</field-visibility>
</form>

<!-- Document Library pop-up Edit Metadata form -->
<form id="doclib-simple-metadata">
<field-visibility>
<show id="cm:name"/>
<show id="cm:title" force="true"/>
<show id="cm:description" force="true"/>

<!-- ACME custom props -->
<show id="acme:reportId" force="true"/>
<show id="acme:insuranceNumber" force="true"/>
<show id="acme:insuredName" force="true"/>
<show id="acme:claimNumber" force="true"/>
<show id="acme:claimDate" force="true"/>
<show id="acme:claimAdjuster" force="true"/>
<show id="acme:visitDate" force="true"/>
<show id="acme:visitLocation" force="true"/>
<show id="acme:visitFollowUp" force="true"/>
</field-visibility>
</form>
</forms>
</config>

</alfresco-config>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
# Labels for custom types and aspects
# Used in "Manage Aspects" and "Change Type" dialogs
#
type.acme_insuranceClaimImage=Insurance Claim Image
type.acme_insuranceClaimImage=Insurance Claim Image
type.acme_insuranceClaimReport=Insurance Claim Report
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class FirehoseExtensionContentModelIT extends AbstractAlfrescoIT {
private static final String ACME_MODEL_NS = "{http://www.acme.org/model/content/1.0}";
private static final String ACME_MODEL_LOCALNAME = "contentModel";
private static final String ACME_TYPE_CLAIM_IMAGE = "insuranceClaimImage";
private static final String ACME_ASPECT_MISSING_PROPERTY = "missingClaimTypeProperty";
private static final String ACME_TYPE_CLAIM_REPORT = "insuranceClaimReport";

@Test
public void testCustomContentModelPresence() {
Expand All @@ -65,17 +65,17 @@ public void testCustomContentModelPresence() {
assertTrue("Custom content model " + customContentModelQName.toString() +
" is not present", allContentModels.contains(customContentModelQName));

System.out.println("checking type...");
// check type is present
System.out.println("checking image type...");
// check image type is present
QName claimImageType = createQName(ACME_TYPE_CLAIM_IMAGE);
assertNotNull("'claimImageType' type is not present",
dictionaryService.getType(claimImageType));

System.out.println("checking aspect...");
// check aspect is present
QName missingAspect = createQName(ACME_ASPECT_MISSING_PROPERTY);
assertNotNull("'missingClaimTypeProperty' aspect is not present",
dictionaryService.getAspect(missingAspect));
System.out.println("checking report type...");
// check report type is present
QName claimReportType = createQName(ACME_TYPE_CLAIM_REPORT);
assertNotNull("'claimReportType' type is not present",
dictionaryService.getType(claimReportType));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,5 @@
<module>firehose-extension-share-jar</module>
<module>integration-tests</module>
</modules>
<version>1.1-SNAPSHOT</version>
<version>1.1</version>
</project>

0 comments on commit 76255ff

Please sign in to comment.