Jean-Francois Leveque

Renommage minimal des attributs de vue pour éviter les signalements de code dupliqué

......@@ -32,15 +32,15 @@ public class PublisherVersionView implements Serializable {
private int publisherVersionId;
private String publisherName;
private String publisherStreetAddress;
private String publisherPostalCode;
private String publisherPostOfficeBoxNumber;
private String publisherAddressRegion;
private String publisherAddressLocality;
private String streetAddress;
private String postalCode;
private String postOfficeBoxNumber;
private String addressRegion;
private String addressLocality;
private transient Country publisherAddressCountry;
private String publisherTelephone;
private String publisherEmail;
private String publisherURL;
private String telephone;
private String email;
private String uRL;
private String publisherHistory;
private transient Account publisherVersionAuthor;
private Timestamp publisherVersionDatetime;
......@@ -90,15 +90,15 @@ public class PublisherVersionView implements Serializable {
editMode = false;
} else {
publisherName = null;
publisherStreetAddress = null;
publisherPostalCode = null;
publisherPostOfficeBoxNumber = null;
publisherAddressRegion = null;
publisherAddressLocality = null;
streetAddress = null;
postalCode = null;
postOfficeBoxNumber = null;
addressRegion = null;
addressLocality = null;
publisherAddressCountry = null;
publisherTelephone = null;
publisherEmail = null;
publisherURL = null;
telephone = null;
email = null;
uRL = null;
publisherHistory = null;
// Je ne pense pas que la ligne suivante soit nécessaire
publisher = null;
......@@ -124,16 +124,16 @@ public class PublisherVersionView implements Serializable {
private PublisherVersion getNewPublisherVersion() {
PublisherVersion publisherVersion = new PublisherVersion();
publisherVersion.setPublisherAddressCountry(publisherAddressCountry);
publisherVersion.setPublisherAddressLocality(publisherAddressLocality);
publisherVersion.setPublisherAddressRegion(publisherAddressRegion);
publisherVersion.setPublisherEmail(publisherEmail);
publisherVersion.setPublisherAddressLocality(addressLocality);
publisherVersion.setPublisherAddressRegion(addressRegion);
publisherVersion.setPublisherEmail(email);
publisherVersion.setPublisherHistory(publisherHistory);
publisherVersion.setPublisherName(publisherName);
publisherVersion.setPublisherPostalCode(publisherPostalCode);
publisherVersion.setPublisherPostOfficeBoxNumber(publisherPostOfficeBoxNumber);
publisherVersion.setPublisherStreetAddress(publisherStreetAddress);
publisherVersion.setPublisherTelephone(publisherTelephone);
publisherVersion.setPublisherURL(publisherURL);
publisherVersion.setPublisherPostalCode(postalCode);
publisherVersion.setPublisherPostOfficeBoxNumber(postOfficeBoxNumber);
publisherVersion.setPublisherStreetAddress(streetAddress);
publisherVersion.setPublisherTelephone(telephone);
publisherVersion.setPublisherURL(uRL);
return publisherVersion;
}
......@@ -163,10 +163,10 @@ public class PublisherVersionView implements Serializable {
}
void update() {
logger.trace("debut update, attributs locaux, publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
publisherStreetAddress, publisherTelephone, publisherURL);
logger.trace("debut update, attributs locaux, publisherAddressCountry = {} addressLocality = {} addressRegion = {} email = {} publisherHistory = {} publisherName = {} postalCode = {} postOfficeBoxNumber = {} streetAddress = {} telephone {} uRL {}",
publisherAddressCountry, addressLocality, addressRegion,
email, publisherHistory, publisherName, postalCode, postOfficeBoxNumber,
streetAddress, telephone, uRL);
PublisherVersion publisherVersion = getNewPublisherVersion();
......@@ -196,15 +196,15 @@ public class PublisherVersionView implements Serializable {
logger.debug("Found a publisher version : {}", publisherVersion.toString());
publisherName = publisherVersion.getPublisherName();
publisherStreetAddress = publisherVersion.getPublisherStreetAddress();
publisherPostalCode = publisherVersion.getPublisherPostalCode();
publisherPostOfficeBoxNumber = publisherVersion.getPublisherPostOfficeBoxNumber();
publisherAddressRegion = publisherVersion.getPublisherAddressRegion();
publisherAddressLocality = publisherVersion.getPublisherAddressLocality();
streetAddress = publisherVersion.getPublisherStreetAddress();
postalCode = publisherVersion.getPublisherPostalCode();
postOfficeBoxNumber = publisherVersion.getPublisherPostOfficeBoxNumber();
addressRegion = publisherVersion.getPublisherAddressRegion();
addressLocality = publisherVersion.getPublisherAddressLocality();
publisherAddressCountry = publisherVersion.getPublisherAddressCountry();
publisherTelephone = publisherVersion.getPublisherTelephone();
publisherEmail = publisherVersion.getPublisherEmail();
publisherURL = publisherVersion.getPublisherURL();
telephone = publisherVersion.getPublisherTelephone();
email = publisherVersion.getPublisherEmail();
uRL = publisherVersion.getPublisherURL();
publisherHistory = publisherVersion.getPublisherHistory();
publisher = publisherVersion.getPublisher();
......@@ -237,44 +237,44 @@ public class PublisherVersionView implements Serializable {
this.publisherName = publisherName;
}
public String getPublisherStreetAddress() {
return publisherStreetAddress;
public String getStreetAddress() {
return streetAddress;
}
public void setPublisherStreetAddress(String publisherStreetAddress) {
this.publisherStreetAddress = publisherStreetAddress;
public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}
public String getPublisherPostalCode() {
return publisherPostalCode;
public String getPostalCode() {
return postalCode;
}
public void setPublisherPostalCode(String publisherPostalCode) {
this.publisherPostalCode = publisherPostalCode;
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getPublisherPostOfficeBoxNumber() {
return publisherPostOfficeBoxNumber;
public String getPostOfficeBoxNumber() {
return postOfficeBoxNumber;
}
public void setPublisherPostOfficeBoxNumber(String publisherPostOfficeBoxNumber) {
this.publisherPostOfficeBoxNumber = publisherPostOfficeBoxNumber;
public void setPostOfficeBoxNumber(String postOfficeBoxNumber) {
this.postOfficeBoxNumber = postOfficeBoxNumber;
}
public String getPublisherAddressRegion() {
return publisherAddressRegion;
public String getAddressRegion() {
return addressRegion;
}
public void setPublisherAddressRegion(String publisherAddressRegion) {
this.publisherAddressRegion = publisherAddressRegion;
public void setAddressRegion(String addressRegion) {
this.addressRegion = addressRegion;
}
public String getPublisherAddressLocality() {
return publisherAddressLocality;
public String getAddressLocality() {
return addressLocality;
}
public void setPublisherAddressLocality(String publisherAddressLocality) {
this.publisherAddressLocality = publisherAddressLocality;
public void setAddressLocality(String addressLocality) {
this.addressLocality = addressLocality;
}
public Country getPublisherAddressCountry() {
......@@ -285,28 +285,28 @@ public class PublisherVersionView implements Serializable {
this.publisherAddressCountry = publisherAddressCountry;
}
public String getPublisherTelephone() {
return publisherTelephone;
public String getTelephone() {
return telephone;
}
public void setPublisherTelephone(String publisherTelephone) {
this.publisherTelephone = publisherTelephone;
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getPublisherEmail() {
return publisherEmail;
public String getEmail() {
return email;
}
public void setPublisherEmail(String publisherEmail) {
this.publisherEmail = publisherEmail;
public void setEmail(String email) {
this.email = email;
}
public String getPublisherURL() {
return publisherURL;
public String getuRL() {
return uRL;
}
public void setPublisherURL(String publisherURL) {
this.publisherURL = publisherURL;
public void setuRL(String uRL) {
this.uRL = uRL;
}
public String getPublisherHistory() {
......
......@@ -30,28 +30,28 @@
<h:panelGrid columns="2">
<label for="publisherName">publisherName</label>
<input type="text" id="publisherName" jsf:value='#{publisherVersionView.publisherName}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherStreetAddress">publisherStreetAddress</label>
<input type="text" id="publisherStreetAddress" jsf:value='#{publisherVersionView.publisherStreetAddress}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherPostalCode">publisherPostalCode</label>
<input type="text" id="publisherPostalCode" jsf:value='#{publisherVersionView.publisherPostalCode}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherPostOfficeBoxNumber">publisherPostOfficeBoxNumber</label>
<input type="text" id="publisherPostOfficeBoxNumber" jsf:value='#{publisherVersionView.publisherPostOfficeBoxNumber}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherAddressRegion">publisherAddressRegion</label>
<input type="text" id="publisherAddressRegion" jsf:value='#{publisherVersionView.publisherAddressRegion}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherAddressLocality">publisherAddressLocality</label>
<input type="text" id="publisherAddressLocality" jsf:value='#{publisherVersionView.publisherAddressLocality}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="streetAddress">streetAddress</label>
<input type="text" id="streetAddress" jsf:value='#{publisherVersionView.streetAddress}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="postalCode">postalCode</label>
<input type="text" id="postalCode" jsf:value='#{publisherVersionView.postalCode}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="postOfficeBoxNumber">postOfficeBoxNumber</label>
<input type="text" id="postOfficeBoxNumber" jsf:value='#{publisherVersionView.postOfficeBoxNumber}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="addressRegion">addressRegion</label>
<input type="text" id="addressRegion" jsf:value='#{publisherVersionView.addressRegion}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="addressLocality">addressLocality</label>
<input type="text" id="addressLocality" jsf:value='#{publisherVersionView.addressLocality}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherAddressCountry">publisherAddressCountry</label>
<h:selectOneMenu id="publisherAddressCountry" value="#{publisherVersionView.publisherAddressCountry}" converter="omnifaces.SelectItemsConverter" disabled="#{not publisherVersionView.editMode}">
<f:selectItems value="#{publisherVersionView.availableCountries}" var="country" itemLabel="#{country.countryName}"/>
</h:selectOneMenu>
<label for="publisherTelephone">publisherTelephone</label>
<input type="text" id="publisherTelephone" jsf:value='#{publisherVersionView.publisherTelephone}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherEmail">publisherEmail</label>
<input type="text" id="publisherEmail" jsf:value='#{publisherVersionView.publisherEmail}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherURL">publisherURL</label>
<input type="text" id="publisherURL" jsf:value='#{publisherVersionView.publisherURL}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="telephone">telephone</label>
<input type="text" id="telephone" jsf:value='#{publisherVersionView.telephone}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="email">email</label>
<input type="text" id="email" jsf:value='#{publisherVersionView.email}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="uRL">uRL</label>
<input type="text" id="uRL" jsf:value='#{publisherVersionView.uRL}' jsf:disabled="#{not publisherVersionView.editMode}"/>
<label for="publisherHistory">publisherHistory</label>
<textarea id="publisherHistory" rows="" cols="" jsf:disabled="#{not publisherVersionView.editMode}" jsf:value="#{publisherVersionView.publisherHistory}"/>
......
......@@ -92,14 +92,14 @@ public class PublisherVersionViewTest {
publisherVersionView.cancel();
assertThat(publisherVersionView.getPublisherName()).isNull();
assertThat(publisherVersionView.getPublisherStreetAddress()).isNull();
assertThat(publisherVersionView.getPublisherPostalCode()).isNull();
assertThat(publisherVersionView.getPublisherPostOfficeBoxNumber()).isNull();
assertThat(publisherVersionView.getPublisherAddressRegion()).isNull();
assertThat(publisherVersionView.getPublisherAddressLocality()).isNull();
assertThat(publisherVersionView.getPublisherTelephone()).isNull();
assertThat(publisherVersionView.getPublisherEmail()).isNull();
assertThat(publisherVersionView.getPublisherURL()).isNull();
assertThat(publisherVersionView.getStreetAddress()).isNull();
assertThat(publisherVersionView.getPostalCode()).isNull();
assertThat(publisherVersionView.getPostOfficeBoxNumber()).isNull();
assertThat(publisherVersionView.getAddressRegion()).isNull();
assertThat(publisherVersionView.getAddressLocality()).isNull();
assertThat(publisherVersionView.getTelephone()).isNull();
assertThat(publisherVersionView.getEmail()).isNull();
assertThat(publisherVersionView.getuRL()).isNull();
assertThat(publisherVersionView.getPublisherHistory()).isNull();
assertThat(publisherVersionView.isEditMode()).isTrue();
}
......@@ -111,28 +111,28 @@ public class PublisherVersionViewTest {
publisherVersionView.setPublisherVersionId(1);
publisherVersionView.setPublisherName("1");
publisherVersionView.setPublisherStreetAddress("2");
publisherVersionView.setPublisherPostalCode("3");
publisherVersionView.setPublisherPostOfficeBoxNumber("4");
publisherVersionView.setPublisherAddressRegion("5");
publisherVersionView.setPublisherAddressLocality("6");
publisherVersionView.setStreetAddress("2");
publisherVersionView.setPostalCode("3");
publisherVersionView.setPostOfficeBoxNumber("4");
publisherVersionView.setAddressRegion("5");
publisherVersionView.setAddressLocality("6");
publisherVersionView.setPublisherAddressCountry(new Country());
publisherVersionView.setPublisherTelephone("7");
publisherVersionView.setPublisherEmail("8");
publisherVersionView.setPublisherURL("9");
publisherVersionView.setTelephone("7");
publisherVersionView.setEmail("8");
publisherVersionView.setuRL("9");
publisherVersionView.setPublisherHistory("10");
publisherVersionView.cancel();
assertThat(publisherVersionView.getPublisherName()).isEqualTo("A");
assertThat(publisherVersionView.getPublisherStreetAddress()).isEqualTo("B");
assertThat(publisherVersionView.getPublisherPostalCode()).isEqualTo("C");
assertThat(publisherVersionView.getPublisherPostOfficeBoxNumber()).isEqualTo("D");
assertThat(publisherVersionView.getPublisherAddressRegion()).isEqualTo("E");
assertThat(publisherVersionView.getPublisherAddressLocality()).isEqualTo("F");
assertThat(publisherVersionView.getPublisherTelephone()).isEqualTo("G");
assertThat(publisherVersionView.getPublisherEmail()).isEqualTo("H");
assertThat(publisherVersionView.getPublisherURL()).isEqualTo("I");
assertThat(publisherVersionView.getStreetAddress()).isEqualTo("B");
assertThat(publisherVersionView.getPostalCode()).isEqualTo("C");
assertThat(publisherVersionView.getPostOfficeBoxNumber()).isEqualTo("D");
assertThat(publisherVersionView.getAddressRegion()).isEqualTo("E");
assertThat(publisherVersionView.getAddressLocality()).isEqualTo("F");
assertThat(publisherVersionView.getTelephone()).isEqualTo("G");
assertThat(publisherVersionView.getEmail()).isEqualTo("H");
assertThat(publisherVersionView.getuRL()).isEqualTo("I");
assertThat(publisherVersionView.getPublisherHistory()).isEqualTo("J");
assertThat(publisherVersionView.isEditMode()).isFalse();
......@@ -157,14 +157,14 @@ public class PublisherVersionViewTest {
publisherVersionView.setPublisherVersionId(1);
publisherVersionView.loadData();
assertThat(publisherVersionView.getPublisherName()).isEqualTo("A");
assertThat(publisherVersionView.getPublisherStreetAddress()).isEqualTo("B");
assertThat(publisherVersionView.getPublisherPostalCode()).isEqualTo("C");
assertThat(publisherVersionView.getPublisherPostOfficeBoxNumber()).isEqualTo("D");
assertThat(publisherVersionView.getPublisherAddressRegion()).isEqualTo("E");
assertThat(publisherVersionView.getPublisherAddressLocality()).isEqualTo("F");
assertThat(publisherVersionView.getPublisherTelephone()).isEqualTo("G");
assertThat(publisherVersionView.getPublisherEmail()).isEqualTo("H");
assertThat(publisherVersionView.getPublisherURL()).isEqualTo("I");
assertThat(publisherVersionView.getStreetAddress()).isEqualTo("B");
assertThat(publisherVersionView.getPostalCode()).isEqualTo("C");
assertThat(publisherVersionView.getPostOfficeBoxNumber()).isEqualTo("D");
assertThat(publisherVersionView.getAddressRegion()).isEqualTo("E");
assertThat(publisherVersionView.getAddressLocality()).isEqualTo("F");
assertThat(publisherVersionView.getTelephone()).isEqualTo("G");
assertThat(publisherVersionView.getEmail()).isEqualTo("H");
assertThat(publisherVersionView.getuRL()).isEqualTo("I");
assertThat(publisherVersionView.getPublisherHistory()).isEqualTo("J");
assertThat(publisherVersionView.isNewPublisher()).isFalse();
}
......@@ -268,15 +268,15 @@ public class PublisherVersionViewTest {
publisherVersionView.setNewPublisher(false);
publisherVersionView.setPublisherName("1");
publisherVersionView.setPublisherStreetAddress("2");
publisherVersionView.setPublisherPostalCode("3");
publisherVersionView.setPublisherPostOfficeBoxNumber("4");
publisherVersionView.setPublisherAddressRegion("5");
publisherVersionView.setPublisherAddressLocality("6");
publisherVersionView.setStreetAddress("2");
publisherVersionView.setPostalCode("3");
publisherVersionView.setPostOfficeBoxNumber("4");
publisherVersionView.setAddressRegion("5");
publisherVersionView.setAddressLocality("6");
publisherVersionView.setPublisherAddressCountry(new Country());
publisherVersionView.setPublisherTelephone("7");
publisherVersionView.setPublisherEmail("8");
publisherVersionView.setPublisherURL("9");
publisherVersionView.setTelephone("7");
publisherVersionView.setEmail("8");
publisherVersionView.setuRL("9");
publisherVersionView.setPublisherHistory("10");
publisherVersionView.setPublisher(publisherMock);
}
......@@ -339,15 +339,15 @@ public class PublisherVersionViewTest {
publisherVersionView.setNewPublisher(true);
publisherVersionView.setPublisherName("A");
publisherVersionView.setPublisherStreetAddress("B");
publisherVersionView.setPublisherPostalCode("C");
publisherVersionView.setPublisherPostOfficeBoxNumber("D");
publisherVersionView.setPublisherAddressRegion("E");
publisherVersionView.setPublisherAddressLocality("F");
publisherVersionView.setStreetAddress("B");
publisherVersionView.setPostalCode("C");
publisherVersionView.setPostOfficeBoxNumber("D");
publisherVersionView.setAddressRegion("E");
publisherVersionView.setAddressLocality("F");
publisherVersionView.setPublisherAddressCountry(new Country());
publisherVersionView.setPublisherTelephone("G");
publisherVersionView.setPublisherEmail("H");
publisherVersionView.setPublisherURL("I");
publisherVersionView.setTelephone("G");
publisherVersionView.setEmail("H");
publisherVersionView.setuRL("I");
publisherVersionView.setPublisherHistory("J");
publisherVersionView.setPublisher(publisherMock);
}
......