Skip to content

Annotopia and Persistence

paolociccarese edited this page Oct 31, 2014 · 1 revision

Until now I’ve implemented the Annotopia staff in DomeoClient as separate packages so that I could preserve the old code.

If you consider the persistence feature, in the Domeo.java code we have a method selectPersistenceManager() that presented the following code.

/* Domeo.java line 762 */
public IPersistenceManager selectPersistenceManager() {
	if(isStandaloneMode()) {
		return new StandalonePersistenceManager(this, null);
	} else {
		if (isHostedMode()) {
			if(annotopia) {
				return new AnnotopiaPersistenceManager(this, null, null);
			} else if(isJsonFormat()) {
				return new JsonPersistenceManager(this, null);
			} else {
				return new GwtPersistenceManager(this, null);
			}
		} else {
			// Real service
			if(ApplicationUtils.getIsAnnotopiaEnabled().equals("true")) {
				return new AnnotopiaPersistenceManager(this, ApplicationUtils.getAnnotopiaLocation(), null);
			} else return new JsonPersistenceManager(this, null);
			//throw new RuntimeException("PersistenceManager not implemented for a real situation");
		}
	}
}

Therefore if the Annotopia 'annotopia' variable is true the AnnotopiaPersistenceManager gets injected.