Jump to contentWelcome to Vionta.net
Xesta: Repository types.

Xesta access to documents are wrapped with the repository abstraction. In order to retrieve or update a document you need to choose from one of the repository types, provide the configuration parameters, usually the path or paths.

Once the repository is configured (its path or paths are provided) you request the repository to retrieve or update the document for you.

Path Adjustment.

The repository paths (in the supported cases) can be adjusted based on the object properties. In order to configure the adjustment the property name (separated with dots between objects) must be defined inside the key { } markers.

File/Folder based repository.

The simplest possible repository type with a base path and a file path. The base path is not adjusted based on the the object properties, while the file path can be adjusted with the {} keys.

FilePathRepository repo = new FilePathRepository(CommonTest.getBasePath()+"cases/iso20022/GlobalPayment.xml");GlobalPayment globalPayment = new GlobalPayment();globalPayment = repo.load(globalPayment);

Classpath repository.

A repository that retrieves files from the application classpath. This repository does not allow to create new files, also some files may be available for reading but not accesible for writing. The file path is defined with simple file path conventions separating folders with the slash "/" operator.

ClassPathRepository repo = new ClassPathRepository().setPath("log4j.xml");LogLevelSimple log = repo.load(new LogLevelSimple());log.setLevel("DEBUG");repo.persist(log);

Mind that, depending on the running environment, the document path may or may not be accesible using the file system.

REST based repository.

A repository that retrieves and stores the files from a REST service. The file path can also be adjusted via the object data using the {} keys on the path.

** Note: service authentication not yet developed. **

Zip file based repository.

The zip file repository is similar to the file repository but acts on files that are placed inside zip files. Both the zipfile and the content file can be ajusted via the object properties. Zip file names are not required to end in ".zip". Zip repository can be used for odt, ods, wars, etc.

String zipFilePattern = CommonTest.getBasePath()+"openDocument/text/fictional-report.odt";ZipArchiveFileRepository repo =new ZipArchiveFileRepository(zipFilePattern,"content.xml");

Document1 doc1 = new Document1();doc1 = (Document1) repo.load(doc1);

Abstract repository.

An abstract implementation that supports extensibility in other cases. Still not available.

** Note: Functionality in development. **