Search in sources :

Example 1 with InstallationConfig

use of org.apache.openmeetings.installation.InstallationConfig in project openmeetings by apache.

the class BackupExport method main.

public static void main(String[] args) throws Exception {
    List<Configuration> list = ImportInitvalues.initialCfgs(new InstallationConfig());
    Serializer ser = getConfigSerializer(list);
    ByteArrayOutputStream baos = stream(ser, "configs", list);
    File f = new File(args[0]);
    if (!f.exists() && !f.getParentFile().exists()) {
        f.getParentFile().mkdirs();
    }
    Files.write(Paths.get(args[0]), baos.toByteArray(), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
}
Also used : Configuration(org.apache.openmeetings.db.entity.basic.Configuration) ByteArrayOutputStream(java.io.ByteArrayOutputStream) InstallationConfig(org.apache.openmeetings.installation.InstallationConfig) File(java.io.File) Serializer(org.simpleframework.xml.Serializer)

Example 2 with InstallationConfig

use of org.apache.openmeetings.installation.InstallationConfig in project openmeetings by apache.

the class AbstractJUnitDefaults method makeDefaultScheme.

private static void makeDefaultScheme(ImportInitvalues importInitvalues) throws Exception {
    InstallationConfig cfg = new InstallationConfig();
    cfg.setUsername(adminUsername);
    cfg.setPassword(userpass);
    cfg.setEmail(email);
    cfg.setGroup(group);
    cfg.setTimeZone(timeZone);
    importInitvalues.loadAll(cfg, false);
    // regular user
    importInitvalues.createSystemUser(getUser(UUID.randomUUID().toString()), group, regularUsername, userpass, false);
    // group admin
    importInitvalues.createSystemUser(getUser(UUID.randomUUID().toString()), group, groupAdminUsername, userpass, true);
}
Also used : InstallationConfig(org.apache.openmeetings.installation.InstallationConfig)

Aggregations

InstallationConfig (org.apache.openmeetings.installation.InstallationConfig)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 Configuration (org.apache.openmeetings.db.entity.basic.Configuration)1 Serializer (org.simpleframework.xml.Serializer)1