Skip to content

Commit

Permalink
Added mechanism to include program metadata (#3)
Browse files Browse the repository at this point in the history
Added ProgramDescriptor
  • Loading branch information
ningosi authored and ssmusoke committed Mar 16, 2017
1 parent 53278ec commit cef3271
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Expand Up @@ -35,6 +35,7 @@
import org.openmrs.module.metadatadeploy.descriptor.PatientIdentifierTypeDescriptor;
import org.openmrs.module.metadatadeploy.descriptor.PersonAttributeTypeDescriptor;
import org.openmrs.module.metadatadeploy.descriptor.PrivilegeDescriptor;
import org.openmrs.module.metadatadeploy.descriptor.ProgramDescriptor;
import org.openmrs.module.metadatadeploy.descriptor.RoleDescriptor;
import org.openmrs.module.metadatadeploy.source.ObjectSource;
import org.openmrs.module.metadatadeploy.sync.MetadataSynchronizationRunner;
Expand Down Expand Up @@ -285,4 +286,12 @@ protected void install(RoleDescriptor d) {
}
install(obj);
}

/**
* Utility method to install a program metadata in an openmrs insatnce
* @param d
*/
protected void install(ProgramDescriptor d){
install(CoreConstructors.program(d.name(), d.description(), d.conceptUuid(), d.uuid()));
}
}
@@ -0,0 +1,36 @@
/**
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/

package org.openmrs.module.metadatadeploy.descriptor;

import org.openmrs.Program;

/**
* Encapsulates the information needed to create a new Program
*/
public abstract class ProgramDescriptor extends MetadataDescriptor<Program> {

/**
* Get the concept uuid as String
*/
public abstract String conceptUuid();

/**
* @see Descriptor#getDescribedType()
*/
@Override
public Class<Program> getDescribedType() {
return Program.class;
}
}

0 comments on commit cef3271

Please sign in to comment.