Skip to content

Developer Information

e!DAL needs a configuration and authenticated subject as basis for mounting the actual back-end implementation.

EdalConfiguration configuration = new EdalConfiguration("", "", "10.5072",
new InternetAddress("scientific_reviewer@mail.com"),
new InternetAddress("substitute_reviewer@mail.com"),
new InternetAddress("managing_reviewer@mail.com"),
new InternetAddress("root@mail.com"));
PrimaryDataDirectory rootDirectory = DataManager.getRootDirectory(
EdalHelpers.getFileSystemImplementationProvider(false, configuration),
EdalHelpers.authenticateWinOrUnixOrMacUser());
</TabItem> <TabItem label="Authentication">
e!DAL needs a Subject to authenticate a user. The EdalHelpers class provides convenient methods for several login modules.
```java
/* use Windows or Unix or MAC login module */
Subject osSubject = EdalHelpers.authenticateWinOrUnixOrMacUser();
/* use Kerberos login module with IPK realm and kdc */
Subject ipkSubject = EdalHelpers.authenticateIPKKerberosUser("username");
/* use Google+ login module */
Subject googleSubject = EdalHelpers.authenticateNewGoogleUser("httpProxyHost", httpProxyPort);
/* use ORCID login module */
Subject orcidSubject = EdalHelpers.authenticateORCIDUser("httpProxyHost", httpProxyPort);

Set the needed metadata attributes for the data entities you want to publish.

MetaData metadata = directory.getMetaData();
// creator
metadata.setElementValue(EnumDublinCoreElements.CREATOR,
new NaturalPerson("Daniel", "Arend", "Gatersleben", "06566", "Germany"));
// publisher
metadata.setElementValue(EnumDublinCoreElements.PUBLISHER,
new LegalPerson("IPK Gatersleben", "Gatersleben", "06466", "Germany"));
metadata.setElementValue(EnumDublinCoreElements.SUBJECT,
new UntypedData("roots, hordeum vulgare, protein analysis, salinity stress"));
// set the new (changed) metadata
directory.setMetaData(metadata);

The initiation of an e!DAL server instance is very similar to running a local e!DAL instance. You additionally add some RMI-related parameters.

/* construct a default EdalConfiguration */
EdalConfiguration configuration = new EdalConfiguration(
"dataCiteUserName", "dataCitePassword", "dataCitePrefix",
new InternetAddress("scientificReviewer@mail.de"),
new InternetAddress("substituteReviewer@mail.de"),
new InternetAddress("managingReviewer@mail.de"),
new InternetAddress("root@mail.de"));
/* startup server using parameter from EdalConfiguration and data/registry TCP port,
flag to clean existing mount point or re-mount, and flag to activate/deactivate RMI logger */
EdalServer.startServer(configuration,
EdalServer.REGISTRY_PORT,
EdalServer.DATA_PORT,
false,
true);