/** Gets or creates a Concept with a given UUID and name. */ public static Concept getConcept(String name, String uuid, String typeUuid) { ConceptService conceptService = Context.getConceptService(); Concept concept = conceptService.getConceptByUuid(uuid); if (concept == null) { concept = new Concept(); concept.setUuid(uuid); concept.setShortName(new ConceptName(name, new Locale("en"))); concept.setDatatype(conceptService.getConceptDatatypeByUuid(typeUuid)); concept.setConceptClass(conceptService.getConceptClassByUuid(ConceptClass.MISC_UUID)); conceptService.saveConcept(concept); } return concept; }
@Override public ContentModel getContentModel(String modelKey) throws IOException { String[] args = modelKey.split(":"); // ToDo: this is not yet properly supported - needs to be tested with Tag fortress - which is // logical if (args.length == 2) { Company company = securityHelper.getCompany(); Fortress fortress = fortressService.getFortress(company, args[0]); DocumentType docType = conceptService.findDocumentType(fortress, args[1]); try { return contentModelService.get(company, fortress, docType); } catch (FlockException e) { throw new IOException("Problem locating content model [" + modelKey + "]"); } } return null; }