Tabnine Logo
AdministrationService.getGlobalPropertyByUuid
Code IndexAdd Tabnine to your IDE (free)

How to use
getGlobalPropertyByUuid
method
in
org.openmrs.api.AdministrationService

Best Java code snippets using org.openmrs.api.AdministrationService.getGlobalPropertyByUuid (Showing top 8 results out of 315)

origin: openmrs/openmrs-core

@Test
public void getGlobalPropertyByUuid_shouldReturnNullIfNoObjectFoundWithGivenUuid() {
  assertNull(adminService.getGlobalPropertyByUuid("some invalid uuid"));
}

origin: openmrs/openmrs-core

@Test
public void getGlobalPropertyByUuid_shouldFindObjectGivenValidUuid() {
  String uuid = "4f55827e-26fe-102b-80cb-0017a47871b3";
  GlobalProperty prop = adminService.getGlobalPropertyByUuid(uuid);
  assertEquals("locale.allowed.list", prop.getProperty());
}

origin: openmrs/openmrs-module-webservices.rest

/**
 * Fetches a global property by uuid, if no match is found, it tries to look up one with a
 * matching name with the assumption that the passed parameter is a global property name
 * 
 * @see DelegatingCrudResource#getByUniqueId(java.lang.String)
 */
@Override
public GlobalProperty getByUniqueId(String uuid) {
  GlobalProperty gp = Context.getAdministrationService().getGlobalPropertyByUuid(uuid);
  if (gp == null) {
    //We assume the caller is fetching by name
    gp = Context.getAdministrationService().getGlobalPropertyObject(uuid);
  }
  
  return gp;
}

origin: openmrs/openmrs-module-webservices.rest

@Override
public GlobalProperty newObject() {
  return Context.getAdministrationService().getGlobalPropertyByUuid(getUuidProperty());
}

origin: openmrs/openmrs-module-webservices.rest

  @Test
  public void shouldDeleteASystemSetting() throws Exception {
    assertNotNull(service.getGlobalPropertyByUuid(getUuid()));
    MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid());
    handle(req);
    assertNull(service.getGlobalPropertyByUuid(getUuid()));
  }
}
origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldPurgeASystemSetting() throws Exception {
  assertNotNull(service.getGlobalPropertyByUuid(getUuid()));
  MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid());
  req.addParameter("purge", "true");
  handle(req);
  assertNull(service.getGlobalPropertyByUuid(getUuid()));
}

origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldEditASystemSetting() throws Exception {
  final String newValue = "Adding description by editing property";
  GlobalProperty expectedProperty = service.getGlobalPropertyByUuid(getUuid());
  assertNull(expectedProperty.getDescription());
  String json = "{ \"description\":\"" + newValue + "\" }";
  
  SimpleObject updatedProperty = deserialize(handle(newPostRequest(getURI() + "/" + getUuid(), json)));
  assertTrue(newValue.equals(PropertyUtils.getProperty(updatedProperty, "description")));
}

origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldFindASystemSettingWithUUID() throws Exception {
  SimpleObject property = deserialize(handle(newGetRequest(getURI() + "/" + getUuid())));
  
  GlobalProperty expectedProperty = service.getGlobalPropertyByUuid(getUuid());
  assertNotNull(property);
  assertEquals(expectedProperty.getUuid(), PropertyUtils.getProperty(property, "uuid"));
  assertEquals(expectedProperty.getProperty(), PropertyUtils.getProperty(property, "property"));
  assertEquals(expectedProperty.getValue(), PropertyUtils.getProperty(property, "value"));
}

org.openmrs.apiAdministrationServicegetGlobalPropertyByUuid

Javadoc

Get a global property by its uuid. There should be only one of these in the database (well, in the world actually). If multiple are found, an error is thrown.

Popular methods of AdministrationService

  • saveGlobalProperty
    Save the given global property to the database
  • getGlobalProperty
  • getGlobalPropertyObject
    Gets the global property that has the given propertyName
  • getAllGlobalProperties
    Get a list of all global properties in the system
  • getAllowedLocales
    Gets the list of locales which the administrator has allowed for use on the system. This is specifie
  • executeSQL
    Runs the sql on the database. If selectOnly is flagged then any non-select sql statements will be re
  • getGlobalPropertiesByPrefix
    Gets all global properties that begin with prefix.
  • getGlobalPropertyValue
    Returns a global property according to the type specified
  • purgeGlobalProperty
    Completely remove the given global property from the database
  • addGlobalPropertyListener
    Allows code to be notified when a global property is created/edited/deleted.
  • getSearchLocales
    Returns a list of locales used by the user when searching.
  • getSystemVariables
    Get a listing or important variables used in openmrs
  • getSearchLocales,
  • getSystemVariables,
  • setGlobalProperty,
  • setImplementationId,
  • validate,
  • getGlobalPropertiesBySuffix,
  • getImplementationId,
  • getMaximumPropertyLength,
  • getPresentationLocales

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now