/** * {@inheritDoc} */ public AlfrescoModel getModel(QName modelName) { if(enabled) { ModelDefinition modelDef = dictionaryService.getModel(modelName); return (modelDef != null ? new AlfrescoModel(modelDef) : null); } else { return null; } }
/** * {@inheritDoc} */ public AlfrescoModel getModel(QName modelName) { if(enabled) { ModelDefinition modelDef = dictionaryService.getModel(modelName); return (modelDef != null ? new AlfrescoModel(modelDef) : null); } else { return null; } }
public Object execute() throws Exception { // The model should not be loaded try { // Check that the model has not yet been loaded into the dictionary DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service"); } catch (DictionaryException exception) { // We expect this exception } return null; } });
public Object execute() throws Exception { // The model should now be loaded assertNotNull(DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE)); // Set the isActive flag DictionaryModelTypeTest.this.nodeService.setProperty(modelNode, ContentModel.PROP_MODEL_ACTIVE, false); return null; } });
public Object execute() throws Exception { // The model should now be loaded assertNotNull(DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE)); // Delete the model DictionaryModelTypeTest.this.nodeService.deleteNode(modelNode); return null; } });
public Object execute() throws Exception { // The model should not yet be loaded try { // Check that the model has not yet been loaded into the dictionary DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service"); } catch (DictionaryException exception) { // We expect this exception } // Set the isActive flag DictionaryModelTypeTest.this.nodeService.setProperty(modelNode, ContentModel.PROP_MODEL_ACTIVE, true); return null; } });
public Object execute() throws Exception { // The model should not be loaded try { // Check that the model has not yet been loaded into the dictionary DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service"); } catch (DictionaryException exception) { // We expect this exception } // Set the isActive flag DictionaryModelTypeTest.this.nodeService.setProperty(modelNode, ContentModel.PROP_MODEL_ACTIVE, true); return null; } });
ModelDefinition modelDefinition2 = DictionaryModelTypeTest.this.dictionaryService.getModel(TEST_MODEL_ONE); assertNotNull(modelDefinition2); assertEquals("Test model one", modelDefinition2.getDescription(DictionaryModelTypeTest.this.dictionaryService));
public void testLabels() { QName model = QName.createQName(TEST_URL, "dictionarydaotest"); ModelDefinition modelDef = service.getModel(model); assertEquals("Model Description", modelDef.getDescription(service)); QName type = QName.createQName(TEST_URL, "base"); TypeDefinition typeDef = service.getType(type); assertEquals("Base Title", typeDef.getTitle(service)); assertEquals("Base Description", typeDef.getDescription(service)); QName prop = QName.createQName(TEST_URL, "prop1"); PropertyDefinition propDef = service.getProperty(prop); assertEquals("Prop1 Title", propDef.getTitle(service)); assertEquals("Prop1 Description", propDef.getDescription(service)); QName assoc = QName.createQName(TEST_URL, "assoc1"); AssociationDefinition assocDef = service.getAssociation(assoc); assertEquals("Assoc1 Title", assocDef.getTitle(service)); assertEquals("Assoc1 Description", assocDef.getDescription(service)); QName datatype = QName.createQName(TEST_URL, "datatype"); DataTypeDefinition datatypeDef = service.getDataType(datatype); assertEquals("alfresco/model/dataTypeAnalyzers", datatypeDef.getAnalyserResourceBundleName()); }
this.dictionaryService.getModel(TEST_MODEL_TWO); fail("This model has not yet been loaded into the dictionary service");
this.dictionaryService.getModel(TEST_MODEL_THREE); fail("This model has not yet been loaded into the dictionary service");
this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service");
this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service");
this.dictionaryService.getModel(TEST_MODEL_ONE); fail("This model has not yet been loaded into the dictionary service");