Skip to content

Commit

Permalink
Add third address line
Browse files Browse the repository at this point in the history
  • Loading branch information
MDeLuise authored and Coduz committed Nov 7, 2022
1 parent 910f01d commit 436f20c
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 3 deletions.
Expand Up @@ -26,7 +26,8 @@ public class ServiceEventModuleConfigurationTest {

ServiceEventClientConfiguration[] serviceEventClientConfiguration = new ServiceEventClientConfiguration[]
{ new ServiceEventClientConfiguration("address", "subscriberName", null),
new ServiceEventClientConfiguration("address2", "subscriberName2", null) };
new ServiceEventClientConfiguration("address2", "subscriberName2", null),
new ServiceEventClientConfiguration("address3", "subscriberName3", null)};

@Test
public void serviceEventModuleConfigurationRegularTest() {
Expand Down
Expand Up @@ -45,6 +45,8 @@ public class AccountFilterPanel extends EntityFilterPanel<GwtAccount> {
private final KapuaTextField<String> organizationPhoneNumberField;
private final KapuaTextField<String> organizationAddressLine1Field;
private final KapuaTextField<String> organizationAddressLine2Field;

private final KapuaTextField<String> organizationAddressLine3Field;
private final KapuaTextField<String> organizationZipPostCodeField;
private final KapuaTextField<String> organizationCityField;
private final KapuaTextField<String> organizationStateProvinceCountryField;
Expand Down Expand Up @@ -176,6 +178,20 @@ public AccountFilterPanel(AbstractEntityView<GwtAccount> entityView, GwtSession
organizationAddressLine2Field.setStyleAttribute(CssLiterals.MARGIN_BOTTOM, "10px");
fieldsPanel.add(organizationAddressLine2Field);

Label organizationAddresLine3Label = new Label(MSGS.accountFilterOrgAddress3());
organizationAddresLine3Label.setWidth(WIDTH);
organizationAddresLine3Label.setStyleAttribute(CssLiterals.MARGIN, "5px");
fieldsPanel.add(organizationAddresLine3Label);

organizationAddressLine3Field = new KapuaTextField<String>();
organizationAddressLine3Field.setWidth(WIDTH);
organizationAddressLine3Field.setMaxLength(MAX_LEN);
organizationAddressLine3Field.setStyleAttribute(CssLiterals.MARGIN_TOP, "0px");
organizationAddressLine3Field.setStyleAttribute(CssLiterals.MARGIN_LEFT, "5px");
organizationAddressLine3Field.setStyleAttribute(CssLiterals.MARGIN_RIGHT, "5px");
organizationAddressLine3Field.setStyleAttribute(CssLiterals.MARGIN_BOTTOM, "10px");
fieldsPanel.add(organizationAddressLine3Field);

Label organizationZipPostCodeLabel = new Label(MSGS.accountFilterOrgZipPostCode());
organizationZipPostCodeLabel.setWidth(WIDTH);
organizationZipPostCodeLabel.setStyleAttribute(CssLiterals.MARGIN, "5px");
Expand Down Expand Up @@ -243,6 +259,7 @@ public void resetFields() {
organizationPhoneNumberField.setValue(null);
organizationAddressLine1Field.setValue(null);
organizationAddressLine2Field.setValue(null);
organizationAddressLine3Field.setValue(null);
organizationZipPostCodeField.setValue(null);
organizationCityField.setValue(null);
organizationStateProvinceCountryField.setValue(null);
Expand All @@ -264,6 +281,7 @@ public void doFilter() {
query.setOrganizationPhoneNumber(organizationPhoneNumberField.getValue());
query.setOrganizationAddressLine1(organizationAddressLine1Field.getValue());
query.setOrganizationAddressLine2(organizationAddressLine2Field.getValue());
query.setOrganizationAddressLine3(organizationAddressLine3Field.getValue());
query.setOrganizationZipPostCode(organizationZipPostCodeField.getValue());
query.setOrganizationCity(organizationCityField.getValue());
query.setOrganizationStateProvinceCountry(organizationStateProvinceCountryField.getValue());
Expand Down
Expand Up @@ -178,6 +178,13 @@ public Object render(GwtAccount gwtAccount, String property, ColumnData config,
column.setSortable(false);
configs.add(column);

column = new ColumnConfig("address3", 120);
column.setHidden(true);
column.setHeader(ACCOUNT_MSGS.accountTableAddress3());
column.setWidth(150);
column.setSortable(false);
configs.add(column);

column = new ColumnConfig("zipPostCode", 120);
column.setHidden(true);
column.setHeader(ACCOUNT_MSGS.accountTableZipPostCode());
Expand Down
Expand Up @@ -74,6 +74,7 @@ public class AccountAddDialog extends EntityAddEditDialog {
protected final KapuaTextField<String> organizationPhoneNumber = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationAddressLine1 = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationAddressLine2 = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationAddressLine3 = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationZipPostCode = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationCity = new KapuaTextField<String>();
protected final KapuaTextField<String> organizationStateProvinceCounty = new KapuaTextField<String>();
Expand Down Expand Up @@ -249,13 +250,20 @@ public void handleEvent(BaseEvent be) {
organizationAddressLine1.setToolTip(MSGS.accountFormOrgAddress1Tooltip());
organizationSubFieldSet.add(organizationAddressLine1, subFieldsetFormData);

organizationAddressLine1.setName("organizationAddressLine2");
organizationAddressLine1.setMaxLength(255);
organizationAddressLine2.setName("organizationAddressLine2");
organizationAddressLine2.setMaxLength(255);
organizationAddressLine2.setFieldLabel(MSGS.accountFormOrgAddress2());
organizationAddressLine2.setToolTip(MSGS.accountFormOrgAddress2Tooltip());
organizationAddressLine2.setMaxLength(255);
organizationSubFieldSet.add(organizationAddressLine2, subFieldsetFormData);

organizationAddressLine3.setName("organizationAddressLine3");
organizationAddressLine3.setMaxLength(255);
organizationAddressLine3.setFieldLabel(MSGS.accountFormOrgAddress3());
organizationAddressLine3.setToolTip(MSGS.accountFormOrgAddress3Tooltip());
organizationAddressLine3.setMaxLength(255);
organizationSubFieldSet.add(organizationAddressLine3, subFieldsetFormData);

organizationZipPostCode.setName("organizationZipPostCode");
organizationZipPostCode.setMaxLength(255);
organizationZipPostCode.setFieldLabel(MSGS.accountFormOrgZipPostCode());
Expand Down Expand Up @@ -320,6 +328,7 @@ public void submit() {
gwtAccountCreator.setOrganizationPhoneNumber(organizationPhoneNumber.getValue());
gwtAccountCreator.setOrganizationAddressLine1(organizationAddressLine1.getValue());
gwtAccountCreator.setOrganizationAddressLine2(organizationAddressLine2.getValue());
gwtAccountCreator.setOrganizationAddressLine3(organizationAddressLine3.getValue());
gwtAccountCreator.setOrganizationCity(organizationCity.getValue());
gwtAccountCreator.setOrganizationZipPostCode(organizationZipPostCode.getValue());
gwtAccountCreator.setOrganizationStateProvinceCounty(organizationStateProvinceCounty.getValue());
Expand Down
Expand Up @@ -70,6 +70,9 @@ protected void onRender(Element parent, int pos) {
organizationAddressLine2.setValue(selectedAccount.getGwtOrganization().getAddressLine2());
organizationAddressLine2.setOriginalValue(selectedAccount.getGwtOrganization().getAddressLine2());

organizationAddressLine3.setValue(selectedAccount.getGwtOrganization().getAddressLine3());
organizationAddressLine3.setOriginalValue(selectedAccount.getGwtOrganization().getAddressLine3());

organizationZipPostCode.setValue(selectedAccount.getGwtOrganization().getZipPostCode());
organizationZipPostCode.setOriginalValue(selectedAccount.getGwtOrganization().getZipPostCode());

Expand All @@ -96,6 +99,7 @@ public void submit() {
gwtOrganization.setPhoneNumber(organizationPhoneNumber.getValue());
gwtOrganization.setAddressLine1(organizationAddressLine1.getValue());
gwtOrganization.setAddressLine2(organizationAddressLine2.getValue());
gwtOrganization.setAddressLine3(organizationAddressLine3.getValue());
gwtOrganization.setZipPostCode(organizationZipPostCode.getValue());
gwtOrganization.setCity(organizationCity.getValue());
gwtOrganization.setStateProvinceCounty(organizationStateProvinceCounty.getValue());
Expand Down
Expand Up @@ -141,6 +141,7 @@ public GwtAccount create(GwtXSRFToken xsrfToken, GwtAccountCreator gwtAccountCre
accountCreator.setOrganizationPhoneNumber(gwtAccountCreator.getOrganizationPhoneNumber());
accountCreator.setOrganizationAddressLine1(gwtAccountCreator.getOrganizationAddressLine1());
accountCreator.setOrganizationAddressLine2(gwtAccountCreator.getOrganizationAddressLine2());
accountCreator.setOrganizationAddressLine3(gwtAccountCreator.getOrganizationAddressLine3());
accountCreator.setOrganizationCity(gwtAccountCreator.getOrganizationCity());
accountCreator.setOrganizationZipPostCode(gwtAccountCreator.getOrganizationZipPostCode());
accountCreator.setOrganizationStateProvinceCounty(gwtAccountCreator.getOrganizationStateProvinceCounty());
Expand Down Expand Up @@ -267,6 +268,7 @@ public EndpointInfoListResult call() throws Exception {
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationPhoneNumber", account.getOrganization().getPhoneNumber()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationAddress1", account.getOrganization().getAddressLine1()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationAddress2", account.getOrganization().getAddressLine2()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationAddress3", account.getOrganization().getAddressLine3()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationZip", account.getOrganization().getZipPostCode()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationCity", account.getOrganization().getCity()));
accountPropertiesPairs.add(new GwtGroupedNVPair(organizationInfo, "organizationState", account.getOrganization().getStateProvinceCounty()));
Expand Down Expand Up @@ -326,6 +328,7 @@ public GwtAccount update(GwtXSRFToken xsrfToken, GwtAccount gwtAccount)
account.getOrganization().setPhoneNumber(gwtAccount.getGwtOrganization().getPhoneNumber());
account.getOrganization().setAddressLine1(gwtAccount.getGwtOrganization().getAddressLine1());
account.getOrganization().setAddressLine2(gwtAccount.getGwtOrganization().getAddressLine2());
account.getOrganization().setAddressLine3(gwtAccount.getGwtOrganization().getAddressLine3());
account.getOrganization().setZipPostCode(gwtAccount.getGwtOrganization().getZipPostCode());
account.getOrganization().setCity(gwtAccount.getGwtOrganization().getCity());
account.getOrganization().setStateProvinceCounty(gwtAccount.getGwtOrganization().getStateProvinceCounty());
Expand Down
Expand Up @@ -176,6 +176,14 @@ public void setAddress2(String address2) {
set("address2", address2);
}

public String getAddress3() {
return (String) getUnescaped("address3");
}

public void setAddress3(String address3) {
set("address3", address3);
}

public String getZipPostCode() {
return (String) getUnescaped("zipPostCode");
}
Expand Down
Expand Up @@ -29,6 +29,7 @@ public class GwtAccountCreator extends GwtEntityCreator {
private String organizationPhoneNumber;
private String organizationAddressLine1;
private String organizationAddressLine2;
private String organizationAddressLine3;
private String organizationCity;
private String organizationZipPostCode;
private String organizationStateProvinceCounty;
Expand Down Expand Up @@ -102,6 +103,14 @@ public void setOrganizationAddressLine2(String organizationAddressLine2) {
this.organizationAddressLine2 = organizationAddressLine2;
}

public String getOrganizationAddressLine3() {
return organizationAddressLine3;
}

public void setOrganizationAddressLine3(String organizationAddressLine3) {
this.organizationAddressLine3 = organizationAddressLine3;
}

public String getOrganizationCity() {
return organizationCity;
}
Expand Down
Expand Up @@ -31,6 +31,7 @@ public class GwtAccountQuery extends GwtQuery {
private String organizationPhoneNumber;
private String organizationAddressLine1;
private String organizationAddressLine2;
private String organizationAddressLine3;
private String organizationZipPostCode;
private String organizationCity;
private String organizationStateProvinceCountry;
Expand Down Expand Up @@ -100,6 +101,14 @@ public void setOrganizationAddressLine2(String organizationAddressLine2) {
this.organizationAddressLine2 = organizationAddressLine2;
}

public String getOrganizationAddressLine3() {
return organizationAddressLine3;
}

public void setOrganizationAddressLine3(String organizationAddressLine3) {
this.organizationAddressLine3 = organizationAddressLine3;
}

public String getOrganizationZipPostCode() {
return organizationZipPostCode;
}
Expand Down
Expand Up @@ -55,6 +55,7 @@ public static GwtAccount convertAccount(Account account) {
gwtAccount.setPhoneNumber(account.getOrganization().getPhoneNumber());
gwtAccount.setAddress1(account.getOrganization().getAddressLine1());
gwtAccount.setAddress2(account.getOrganization().getAddressLine2());
gwtAccount.setAddress3(account.getOrganization().getAddressLine3());
gwtAccount.setZipPostCode(account.getOrganization().getZipPostCode());
gwtAccount.setCity(account.getOrganization().getCity());
gwtAccount.setStateProvince(account.getOrganization().getStateProvinceCounty());
Expand Down Expand Up @@ -88,6 +89,7 @@ public static GwtOrganization convertOrganization(Organization organization) {
gwtOrganization.setPhoneNumber(organization.getPhoneNumber());
gwtOrganization.setAddressLine1(organization.getAddressLine1());
gwtOrganization.setAddressLine2(organization.getAddressLine2());
gwtOrganization.setAddressLine3(organization.getAddressLine3());
gwtOrganization.setZipPostCode(organization.getZipPostCode());
gwtOrganization.setCity(organization.getCity());
gwtOrganization.setStateProvinceCounty(organization.getStateProvinceCounty());
Expand Down
Expand Up @@ -28,6 +28,7 @@ accountTableContactName=Contact Name
accountTablePhoneNumber=Phone Number
accountTableAddress1=Address 1
accountTableAddress2=Address 2
accountTableAddress3=Address 3
accountTableZipPostCode=Zip/Post Code
accountTableCity=City
accountTableStateProvince=State/Province
Expand Down Expand Up @@ -82,6 +83,7 @@ accountFormOrgAddress1Tooltip=Enter an address for more complete profile of the
accountFormOrgAddress2=Address 2
accountFormOrgAddress2Tooltip=Enter a second address, if necessary, for more complete profile of the account.
accountFormOrgAddress3=Address 3
accountFormOrgAddress3Tooltip=Enter a third address, if necessary, for more complete profile of the account.
accountFormOrgZipPostCode=Zip/Post Code
accountFormOrgZipPostCodeTooltip=Enter a ZIP/Postal code for more complete profile of the account.
accountFormOrgCity=City
Expand Down Expand Up @@ -118,6 +120,7 @@ accountFilterOrgContactName=Contact Name
accountFilterOrgPhoneNumber=Phone Number
accountFilterOrgAddress1=Address 1
accountFilterOrgAddress2=Address 2
accountFilterOrgAddress3=Address 3
accountFilterOrgZipPostCode=Zip/Post code
accountFilterOrgCity=City
accountFilterOrgStateProvince=State/Province
Expand Down
Expand Up @@ -447,6 +447,7 @@ organizationEmail=Email
organizationPhoneNumber=Phone Number
organizationAddress1=Address 1
organizationAddress2=Address 2
organizationAddress3=Address 3
organizationZip=Zip/Post Code
organizationCity=City
organizationState=State/Province
Expand Down
Expand Up @@ -73,6 +73,11 @@ public class AccountAttributes extends KapuaNamedEntityAttributes {
*/
public static final String ADDRESS_2 = ORGANIZATION + ".addressLine2";

/**
* @since 1.0.0
*/
public static final String ADDRESS_3 = ORGANIZATION + ".addressLine3";

/**
* @since 1.0.0
*/
Expand Down
Expand Up @@ -40,6 +40,7 @@
"organizationPhoneNumber",
"organizationAddressLine1",
"organizationAddressLine2",
"organizationAddressLine3",
"organizationCity",
"organizationZipPostCode",
"organizationStateProvinceCounty",
Expand Down Expand Up @@ -151,6 +152,23 @@ public interface AccountCreator extends KapuaNamedEntityCreator<Account> {
*/
void setOrganizationAddressLine2(String organizationAddressLine2);

/*3
* Gets the {@link Organization#getAddressLine3()}.
*
* @return The {@link Organization#getAddressLine3()}.
* @since 1.0.0
*/
@XmlElement(name = "organizationAddressLine3")
String getOrganizationAddressLine3();

/**
* Sets the {@link Organization#getAddressLine3()}.
*
* @param organizationAddressLine3 The {@link Organization#getAddressLine3()}.
* @since 1.0.0
*/
void setOrganizationAddressLine3(String organizationAddressLine3);

/**
* Gets the {@link Organization#getCity()}.
*
Expand Down
Expand Up @@ -34,6 +34,7 @@ public class AccountCreatorImpl extends AbstractKapuaNamedEntityCreator<Account>
private String organizationPhoneNumber;
private String organizationAddressLine1;
private String organizationAddressLine2;
private String organizationAddressLine3;
private String organizationCity;
private String organizationZipPostCode;
private String organizationStateProvinceCounty;
Expand Down Expand Up @@ -112,6 +113,16 @@ public void setOrganizationAddressLine2(String organizationAddressLine2) {
this.organizationAddressLine2 = organizationAddressLine2;
}

@Override
public String getOrganizationAddressLine3() {
return organizationAddressLine3;
}

@Override
public void setOrganizationAddressLine3(String organizationAddressLine3) {
this.organizationAddressLine3 = organizationAddressLine3;
}

@Override
public String getOrganizationCity() {
return organizationCity;
Expand Down
Expand Up @@ -59,6 +59,7 @@ public static Account create(@NotNull EntityManager em, @NotNull AccountCreator
organizationImpl.setPhoneNumber(accountCreator.getOrganizationPhoneNumber());
organizationImpl.setAddressLine1(accountCreator.getOrganizationAddressLine1());
organizationImpl.setAddressLine2(accountCreator.getOrganizationAddressLine2());
organizationImpl.setAddressLine3(accountCreator.getOrganizationAddressLine3());
organizationImpl.setCity(accountCreator.getOrganizationCity());
organizationImpl.setZipPostCode(accountCreator.getOrganizationZipPostCode());
organizationImpl.setStateProvinceCounty(accountCreator.getOrganizationStateProvinceCounty());
Expand Down

0 comments on commit 436f20c

Please sign in to comment.