Jean-Francois Leveque

https://tree.taiga.io/project/jr-utily-grog-v3/us/72 Mise en place de logs TRACE…

… sur mise à jour données
......@@ -6,6 +6,8 @@ import org.legrog.entities.PublisherRepository;
import org.legrog.entities.PublisherVersion;
import org.legrog.entities.PublisherVersionRepository;
import org.legrog.web.xyz.SharedService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.Stateless;
import javax.inject.Inject;
......@@ -21,6 +23,8 @@ import java.util.Set;
@Stateless
public class PublisherServiceSpring implements PublisherService {
Logger logger = LoggerFactory.getLogger(getClass());
@Inject
PublisherRepository publisherRepository;
......@@ -42,6 +46,7 @@ public class PublisherServiceSpring implements PublisherService {
}
public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) {
logger.trace("debut addVersionToPublisher, publisherVersion = {}", publisherVersion);
Set<PublisherVersion> publisherVersionSet = publisher.getVersions();
publisherVersionSet.add(publisherVersion);
publisher.setVersions(publisherVersionSet);
......@@ -50,6 +55,7 @@ public class PublisherServiceSpring implements PublisherService {
publisherVersion.setPublisherVersionDatetime(new Timestamp(new Date().getTime()));
this.savePublisherVersion(publisherVersion);
this.savePublisher(publisher);
logger.trace("fin addVersionToPublisher, publisherVersion = {}", publisherVersion);
}
public void validatePublisherVersion(Publisher publisher, Integer publisherVersionId) {
......
......@@ -119,9 +119,15 @@ public class PublisherVersionView implements Serializable {
}
public void update() {
logger.trace("debut update, attributs locaux, publisherActive = {} publisherAddressCountry = {} publisherAddressLocality = {} publisherAddressRegion = {} publisherEmail = {} publisherHistory = {} publisherName = {} publisherPostalCode = {} publisherPostOfficeBoxNumber = {} publisherStreetAddress = {} publisherTelephone {} publisherURL {}",
publisherActive, publisherAddressCountry, publisherAddressLocality, publisherAddressRegion,
publisherEmail, publisherHistory, publisherName, publisherPostalCode, publisherPostOfficeBoxNumber,
publisherStreetAddress, publisherTelephone, publisherURL);
PublisherVersion publisherVersion = new PublisherVersion();
setValues(publisherVersion);
logger.trace("milieu update, avant enregistrement, publisherVersion = {}", publisherVersion);
publisherService.addVersionToPublisher(publisher, publisherVersion);
publisherVersionId = publisherVersion.getPublisherVersionId();
......@@ -129,6 +135,7 @@ public class PublisherVersionView implements Serializable {
getImmutableValues();
editMode = false;
logger.trace("fin update, après récupération, publisherVersion = {}", publisherVersion);
}
public void loadData() {
......
......@@ -8,6 +8,7 @@
</appender>
<logger name="org.legrog" level="DEBUG"/>
<logger name="org.legrog.web.publisher" level="TRACE"/>
<root level="warn">
<appender-ref ref="STDOUT" />
......