Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…taloguePlugin into develop
  • Loading branch information
amilward committed Jul 3, 2014
2 parents 0b77a0d + 91982f9 commit ba58884
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ImportRow {
String measurementSymbol
Map metadata
Boolean imported = false
Set<RowAction> rowActions = []

static hasMany = [rowActions: RowAction]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ class PublishedElementService {
if(element instanceof DataElement) {
if (element.containedIn.size() > 0) {
element.containedIn.each { Model model ->
if (model.status != PublishedElementStatus.PENDING && model.status != PublishedElementStatus.UPDATED) {
if (model.status != PublishedElementStatus.DRAFT && model.status != PublishedElementStatus.UPDATED) {
Model archivedModel = archiveAndIncreaseVersion(model)
archivedModel.removeFromContains(element)
archivedModel.addToContains(archived)
}

if (model.status == PublishedElementStatus.PENDING) {element.status = PublishedElementStatus.PENDING}
if (model.status == PublishedElementStatus.DRAFT) {element.status = PublishedElementStatus.DRAFT}
}

element.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class DataImportService {

protected Model addModelToImport(DataImport importer, Model model) {
if (!importer.models.find{it.id == model.id}) {
if(model.status != PublishedElementStatus.UPDATED){model.status = PublishedElementStatus.PENDING}
if(model.status != PublishedElementStatus.UPDATED){model.status = PublishedElementStatus.DRAFT}
model.save()
importer.models.add(model)
}
Expand Down Expand Up @@ -351,8 +351,8 @@ class DataImportService {
dataElement.status = PublishedElementStatus.UPDATED
dataElement.save()
dataElement = updateMetadata(metadata, dataElement)
if(model.status!=PublishedElementStatus.UPDATED && model.status!=PublishedElementStatus.PENDING){
model.status = PublishedElementStatus.PENDING
if(model.status!=PublishedElementStatus.UPDATED && model.status!=PublishedElementStatus.DRAFT){
model.status = PublishedElementStatus.DRAFT
model.save()
}
}
Expand Down Expand Up @@ -389,8 +389,8 @@ class DataImportService {

}

if(model.status!=PublishedElementStatus.UPDATED && model.status!=PublishedElementStatus.PENDING){
model.status = PublishedElementStatus.PENDING
if(model.status!=PublishedElementStatus.UPDATED && model.status!=PublishedElementStatus.DRAFT){
model.status = PublishedElementStatus.DRAFT
model.save()
}
}
Expand Down
Loading

0 comments on commit ba58884

Please sign in to comment.