*
* @see org.splat.service.PublicationService#copy(org.splat.dal.bo.som.Publication, org.splat.dal.bo.som.ProjectElement)
*/
- public Publication copy(final Publication aPublication, final ProjectElement publisher) {
+ public Publication copy(final Publication aPublication,
+ final ProjectElement publisher) {
Publication copy = new Publication();
copy.setValue(aPublication.value());
copy.setStep(aPublication.getStep()); // May not be initialized yet
return copy;
}
- /**
+ /**
* {@inheritDoc}
- * @see org.splat.service.PublicationService#versionDocument(org.splat.som.Step, org.splat.dal.bo.kernel.User, java.lang.String, long, java.lang.String, java.lang.String, org.splat.dal.bo.som.ProgressState, java.util.Date, java.lang.String[], long[])
+ *
+ * @see org.splat.service.PublicationService#versionDocument(org.splat.som.Step, org.splat.dal.bo.kernel.User, java.lang.String, long,
+ * java.lang.String, java.lang.String, org.splat.dal.bo.som.ProgressState, java.util.Date, java.lang.String[], long[])
*/
@Transactional
public void versionDocument(final Step step, final User user,
(date != null)) {
dprop.setDate(date);
}
+ if ((summary != null) && (summary.length() > 0)) {
+ dprop.setDescription(summary);
+ }
next = getStepService().versionDocument(step, current,
- dprop.setAuthor(user).setDescription(summary));
+ dprop.setAuthor(user));
updir = next.getSourceFile().asFile();
if (LOG.isInfoEnabled()) {
LOG.info("Moving \"" + upfile.getName() + "\" to \""
}
}
-/* protected Publication getPublication(int index, List<Step> steps) {
- for (Iterator<Step> i = steps.iterator(); i.hasNext();) {
- List<Publication> published = i.next().getAllDocuments();
- for (Iterator<Publication> j = published.iterator(); j.hasNext();) {
- Publication found = j.next(); // In a given study step,
- if (found.value().getIndex() == index)
- return found; // there is only one publication of a given document
- }
- }
- return null;
- }
-*/
+ /*
+ * protected Publication getPublication(int index, List<Step> steps) { for (Iterator<Step> i = steps.iterator(); i.hasNext();) { List<Publication>
+ * published = i.next().getAllDocuments(); for (Iterator<Publication> j = published.iterator(); j.hasNext();) { Publication found =
+ * j.next(); // In a given study step, if (found.value().getIndex() == index) return found; // there is only one publication of a given
+ * document } } return null; }
+ */
/**
* {@inheritDoc}
*
@Transactional
public Timestamp approve(final Publication aPublication, final Date adate) {
Timestamp res = null;
- if (!(aPublication.isOutdated() || (aPublication.value().getProgressState() != ProgressState.inCHECK))) {
+ if (!(aPublication.isOutdated() || (aPublication.value()
+ .getProgressState() != ProgressState.inCHECK))) {
DocumentType type = aPublication.value().getType();
Study owner = aPublication.getOwnerStudy();
- ValidationCycle cycle = getStudyService().getValidationCycleOf(owner,
- type);
+ ValidationCycle cycle = getStudyService().getValidationCycleOf(
+ owner, type);
User approver = cycle.getActor(ValidationStep.APPROVAL);
- Timestamp stamp = new Timestamp(ValidationStep.APPROVAL, aPublication
- .value(), approver, adate);
+ Timestamp stamp = new Timestamp(ValidationStep.APPROVAL,
+ aPublication.value(), approver, adate);
getTimestampDAO().create(stamp);
-
+
if (getDocumentService().promote(aPublication.value(), stamp)) {
res = stamp;
if (getDocumentService().isStudyResult(type)
* the format
* @return the created "Converts" relation
*/
- public ConvertsRelation attach(final Publication aPublication, final String format) {
+ public ConvertsRelation attach(final Publication aPublication,
+ final String format) {
return getDocumentService().attach(aPublication.value(), format);
}
* the description of the relation
* @return the created "Converts" relation
*/
- public ConvertsRelation attach(final Publication aPublication, final String format,
- final String description) {
+ public ConvertsRelation attach(final Publication aPublication,
+ final String format, final String description) {
return getDocumentService().attach(aPublication.value(), format,
description);
}
/**
* Get the timestampDAO.
+ *
* @return the timestampDAO
*/
public TimestampDAO getTimestampDAO() {
/**
* Set the timestampDAO.
- * @param timestampDAO the timestampDAO to set
+ *
+ * @param timestampDAO
+ * the timestampDAO to set
*/
public void setTimestampDAO(final TimestampDAO timestampDAO) {
_timestampDAO = timestampDAO;