Skip to content

Commit

Permalink
Merge pull request #504 from MetadataRegistry/develop
Browse files Browse the repository at this point in the history
GEL Release 20150928
  • Loading branch information
musketyr committed Sep 29, 2015
2 parents 0676736 + 6873f11 commit b2cb223
Show file tree
Hide file tree
Showing 834 changed files with 20,649 additions and 33,013 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# FormsPlugin
/ModelCatalogueFormsPlugin
*.iml
**.iml
**/web-app/*
**/.idea/*
**/atlassian-ide-plugin.xml
Expand All @@ -15,4 +13,6 @@ ModelCatalogueCorePluginTestApp/test/integration/resources/rare_diseases_combine
out/**/*
**/target/**/*
**/target-eclipse/**/*
**/*.class
**/*.class
**/*.gen.fixture.js
**/build/**/*
23 changes: 20 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
language: groovy
cache:
directories:
- node_modules
- ModelCatalogueCorePlugin/target/work/plugins
- ModelCatalogueCorePluginTestApp/target/work/plugins
- $HOME/.m2
- $HOME/.grails/ivy-cache
- $HOME/.grails/wrapper

env:
- TEST_SUITE=core_unit
- TEST_SUITE=core_integration
- TEST_SUITE=core_integration_slow
- TEST_SUITE=app_integration
- TEST_SUITE=app_functional
- TEST_SUITE=forms_integration
- TEST_SUITE=gel_integration
jdk:
- oraclejdk7
- oraclejdk7
before_install:
- "export DISPLAY=:99.0"
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x24"
script:
- "./run-all-tests.sh"
#after_script:
# - "./update-gh-pages.sh"
after_script:
- "./update-gh-pages.sh"
96 changes: 77 additions & 19 deletions ModelCatalogueCorePlugin/ModelCatalogueCoreGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import org.modelcatalogue.core.*
import org.modelcatalogue.core.reports.ReportsRegistry
import org.modelcatalogue.core.util.CatalogueElementDynamicHelper
import org.modelcatalogue.core.util.ListWrapper
import org.modelcatalogue.core.util.builder.CatalogueBuilder
import org.modelcatalogue.core.util.builder.DefaultCatalogueBuilder
import org.modelcatalogue.core.util.marshalling.*
import org.modelcatalogue.core.util.marshalling.xlsx.XLSXListRenderer
import org.modelcatalogue.core.audit.AuditJsonMarshallingCustomizer
import org.modelcatalogue.core.util.js.FrontendConfigurationProviderRegistry
import org.modelcatalogue.core.util.js.ApiRootFrontendConfigurationProvider
import org.modelcatalogue.builder.api.ModelCatalogueTypes

class ModelCatalogueCoreGrailsPlugin {
// the plugin version
Expand Down Expand Up @@ -54,10 +58,25 @@ Model catalogue core plugin (metadata registry)


def doWithSpring = {
ModelCatalogueTypes.CLASSIFICATION.implementation = Classification
ModelCatalogueTypes.MODEL.implementation = Model
ModelCatalogueTypes.DATA_ELEMENT.implementation = DataElement
ModelCatalogueTypes.VALUE_DOMAIN.implementation = ValueDomain
ModelCatalogueTypes.DATA_TYPE.implementation = DataType
ModelCatalogueTypes.MEASUREMENT_UNIT.implementation = MeasurementUnit
ModelCatalogueTypes.ENUMERATED_TYPE.implementation = EnumeratedType


mergeConfig(application)

xlsxListRenderer(XLSXListRenderer)
reportsRegistry(ReportsRegistry)
jsonMarshallingCustomizerRegistry(JsonMarshallingCustomizerRegistry)
frontendConfigurationProviderRegistry(FrontendConfigurationProviderRegistry)

apiRootFrontendConfigurationProvider(ApiRootFrontendConfigurationProvider)

auditJsonMarshallingCustomizer(AuditJsonMarshallingCustomizer)

modelCatalogueCorePluginCustomObjectMarshallers(ModelCatalogueCorePluginCustomObjectMarshallers) {
marshallers = [
Expand All @@ -67,27 +86,29 @@ Model catalogue core plugin (metadata registry)
new DataTypeMarshaller(),
new ElementsMarshaller(),
new EnumeratedTypeMarshaller(),
new MeasurementUnitMarshallers(),
new MeasurementUnitMarshaller(),
new ModelMarshaller(),
new RelationshipTypeMarshaller(),
new RelationshipMarshallers(),
new RelationshipsMarshaller(),
new ValueDomainMarshaller(),
new MappingMarshallers(),
new MappingMarshaller(),
new MappingsMarshaller(),
new ListWithTotalAndTypeWrapperMarshaller(),
new BatchMarshaller(),
new ActionMarshaller(),
new CsvTransformationMarshaller(),
new UserMarshaller()
new UserMarshaller(),
new ChangeMarshaller(),

]
}

if (Environment.current == Environment.DEVELOPMENT) {
springConfig.addAlias('modelCatalogueStorageService','localFilesStorageService')
}

catalogueBuilder(CatalogueBuilder, ref('classificationService'), ref('elementService')) { bean ->
catalogueBuilder(DefaultCatalogueBuilder, ref('classificationService'), ref('elementService')) { bean ->
bean.scope = 'prototype'
}

Expand Down Expand Up @@ -225,18 +246,50 @@ Model catalogue core plugin (metadata registry)
xlsxListRenderer.registerRowWriter('NHIC') {
title "Data Elements to Excel"
append metadata
headers "Classification", "Parent Model Unique Code",
"Parent Model", "Model Unique Code", "Model",
"Data Item Unique Code", "Data Item Name", "Data Item Description",
"Measurement Unit","Measurement Unit Symbol", "Data type", "Metadata"
headers "Classification",
"Parent Model Unique Code",
"Parent Model",
"Model Unique Code",
"Model",
"Data Item Unique Code",
"Data Item Name",
"Data Item Description",
"Value Domain Classification",
"Value Domain Unique Code",
"Value Domain",
"Measurement Unit",
"Measurement Unit Symbol",
"Data Type Classification",
"Data Type Unique Code",
"Data Type",
"Metadata"

when { ListWrapper container, RenderContext context ->
container.itemType && DataElement.isAssignableFrom(container.itemType)
} then { DataElement element ->
[[getClassificationString(element), getParentModel(element)?.modelCatalogueId,
getParentModel(element)?.name, getContainingModel(element)?.modelCatalogueId, getContainingModel(element)?.name,
element.modelCatalogueId, element.name, element.description,
getUnitOfMeasure(element), getUnitOfMeasureSymbol(element) , getDataType(element), "-"]]
Model parent = getParentModel(element)
Model model = getContainingModel(element)
ValueDomain valueDomain = element.valueDomain
DataType dataType = valueDomain?.dataType
[[
getClassificationString(element),
parent?.modelCatalogueId ?: parent?.getDefaultModelCatalogueId(true),
parent?.name,
model?.modelCatalogueId ?: model?.getDefaultModelCatalogueId(true),
model?.name,
element.modelCatalogueId ?: element.getDefaultModelCatalogueId(true),
element.name,
element.description,
getClassificationString(valueDomain),
valueDomain?.modelCatalogueId ?: valueDomain?.getDefaultModelCatalogueId(true),
valueDomain?.name,
getUnitOfMeasure(element),
getUnitOfMeasureSymbol(element) ,
getClassificationString(dataType),
dataType?.modelCatalogueId ?: dataType?.getDefaultModelCatalogueId(true),
getDataType(element),
"-"
]]
}
}

Expand All @@ -263,6 +316,13 @@ Model catalogue core plugin (metadata registry)
type Classification
link controller: 'classification', action: 'gereport', id: true
}

reportsRegistry.register {
creates link
title { "GE Inventory Report Docx" }
type Classification
link controller: 'classificationReports', action: 'gereportDoc', id: true
}

reportsRegistry.register {
creates link
Expand Down Expand Up @@ -348,20 +408,18 @@ Model catalogue core plugin (metadata registry)
return ''
}
if (dataType instanceof EnumeratedType) {
return dataType.enumAsString
return dataType.enumerations.collect { key, value -> "$key:$value"}.join('\n')
}
return dataType.name
}
return null
}

def static getClassificationString(CatalogueElement dataElement) {
String classifications = ""
dataElement.classifications.eachWithIndex{ def classification, Integer i ->
if (classifications != "") classifications += (stringSeparator + classification.name)
else classifications = classification.name
if (!dataElement?.classifications) {
return ""
}
return classifications
dataElement.classifications.first().name
}

def static getValueDomainString(DataType dataType){
Expand Down
4 changes: 2 additions & 2 deletions ModelCatalogueCorePlugin/fixtures/assets/A_file.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file(Asset, name:"file", description: "random file", status: ElementStatus.FINALIZED)
Expand Down
2 changes: 1 addition & 1 deletion ModelCatalogueCorePlugin/fixtures/assets/A_file1.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file1(Asset, name:"file1", description: "some random file 1", status: ElementStatus.FINALIZED)
Expand Down
4 changes: 2 additions & 2 deletions ModelCatalogueCorePlugin/fixtures/assets/A_file2.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file2(Asset, name:"ASSET", description: "some random file 2", status: ElementStatus.FINALIZED)
Expand Down
2 changes: 1 addition & 1 deletion ModelCatalogueCorePlugin/fixtures/assets/A_file3.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file3(Asset, name:"A_file3", description: "the random name 3", status: ElementStatus.FINALIZED)
Expand Down
2 changes: 1 addition & 1 deletion ModelCatalogueCorePlugin/fixtures/assets/A_file4.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file4(Asset, name:"A_file4", description: "some random file 4", status: ElementStatus.FINALIZED)
Expand Down
4 changes: 2 additions & 2 deletions ModelCatalogueCorePlugin/fixtures/assets/A_file5.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file5(Asset, name:"A_file5", description: "random file 5", status: ElementStatus.FINALIZED)
Expand Down
2 changes: 1 addition & 1 deletion ModelCatalogueCorePlugin/fixtures/assets/A_file6.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Asset
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
A_file6(Asset, name:"A_file6", description: "random file 6", status: ElementStatus.FINALIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet1(Classification, name: "data set 1", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet10(Classification, name: "data set 10", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet11(Classification, name: "data set 11", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet12(Classification, name: "data set 12", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet2(Classification, name: "data set 2", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet3(Classification, name: "data set 3", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet4(Classification, name: "data set 4", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet5(Classification, name: "data set 5", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet6(Classification, name: "data set 6", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet7(Classification, name: "data set 7", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet8(Classification, name: "data set 8", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.Classification
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture {
CL_dataSet9(Classification, name: "data set 9", status: ElementStatus.FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.DataElement
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
DE_author(DataElement, name:"DE_author", description: "the DE_author of the book", status: ElementStatus.FINALIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.modelcatalogue.core.DataElement
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
DE_author1(DataElement, name:"DE_author1", description: "the DE_author of the book", status: ElementStatus.FINALIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.modelcatalogue.core.DataElement
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
DE_author2(DataElement, name:"AUTHOR", description: "the DE_author of the book", status: ElementStatus.FINALIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import org.modelcatalogue.core.DataElement
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
DE_author3(DataElement, name:"auth", description: "the DE_author of the book", status: ElementStatus.FINALIZED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.modelcatalogue.core.DataElement
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.ElementStatus
import org.modelcatalogue.core.api.ElementStatus
import org.modelcatalogue.core.api.ElementStatus

fixture{
DE_author4(DataElement, name:"auth4", description: "the DE_author of the book", status: ElementStatus.FINALIZED)
Expand Down
Loading

0 comments on commit b2cb223

Please sign in to comment.