Search in sources :

Example 6 with MidpointConfiguration

use of com.evolveum.midpoint.common.configuration.api.MidpointConfiguration in project midpoint by Evolveum.

the class TaskManagerConfiguration method checkAllowedKeys.

void checkAllowedKeys(MidpointConfiguration masterConfig) throws TaskManagerConfigurationException {
    Configuration c = masterConfig.getConfiguration(TASK_MANAGER_CONFIG_SECTION);
    checkAllowedKeys(c, KNOWN_KEYS);
}
Also used : MidpointConfiguration(com.evolveum.midpoint.common.configuration.api.MidpointConfiguration) Configuration(org.apache.commons.configuration.Configuration) SqlRepositoryConfiguration(com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration)

Example 7 with MidpointConfiguration

use of com.evolveum.midpoint.common.configuration.api.MidpointConfiguration in project midpoint by Evolveum.

the class PageAccounts method downloadPerformed.

private void downloadPerformed(AjaxRequestTarget target, String fileName, AjaxDownloadBehaviorFromFile downloadBehavior) {
    MidpointConfiguration config = getMidpointConfiguration();
    downloadFile = new File(config.getMidpointHome() + "/export/" + fileName);
    downloadBehavior.initiate(target);
}
Also used : MidpointConfiguration(com.evolveum.midpoint.common.configuration.api.MidpointConfiguration) AjaxDownloadBehaviorFromFile(com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile) File(org.apache.wicket.util.file.File)

Example 8 with MidpointConfiguration

use of com.evolveum.midpoint.common.configuration.api.MidpointConfiguration in project midpoint by Evolveum.

the class PageAccounts method createFilesModel.

private LoadableModel<List<String>> createFilesModel() {
    return new LoadableModel<List<String>>(false) {

        @Override
        protected List<String> load() {
            String[] filesArray;
            try {
                MidpointConfiguration config = getMidpointConfiguration();
                File exportFolder = new File(config.getMidpointHome() + "/export");
                filesArray = exportFolder.list(new FilenameFilter() {

                    @Override
                    public boolean accept(java.io.File dir, String name) {
                        return name.endsWith("xml");
                    }
                });
            } catch (Exception ex) {
                LoggingUtils.logUnexpectedException(LOGGER, "Couldn't list files", ex);
                getSession().error("Couldn't list files, reason: " + ex.getMessage());
                throw new RestartResponseException(PageDashboard.class);
            }
            if (filesArray == null) {
                return new ArrayList<>();
            }
            List<String> list = Arrays.asList(filesArray);
            Collections.sort(list);
            return list;
        }
    };
}
Also used : FilenameFilter(java.io.FilenameFilter) RestartResponseException(org.apache.wicket.RestartResponseException) MidpointConfiguration(com.evolveum.midpoint.common.configuration.api.MidpointConfiguration) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) ArrayList(java.util.ArrayList) PageDashboard(com.evolveum.midpoint.web.page.admin.home.PageDashboard) AjaxDownloadBehaviorFromFile(com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile) File(org.apache.wicket.util.file.File) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) RestartResponseException(org.apache.wicket.RestartResponseException) IOException(java.io.IOException) CommonException(com.evolveum.midpoint.util.exception.CommonException) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException)

Aggregations

MidpointConfiguration (com.evolveum.midpoint.common.configuration.api.MidpointConfiguration)8 SqlRepositoryConfiguration (com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration)4 AjaxDownloadBehaviorFromFile (com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile)4 File (org.apache.wicket.util.file.File)4 CommonException (com.evolveum.midpoint.util.exception.CommonException)3 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 IOException (java.io.IOException)3 Configuration (org.apache.commons.configuration.Configuration)3 RestartResponseException (org.apache.wicket.RestartResponseException)3 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 RepositoryServiceFactoryException (com.evolveum.midpoint.repo.api.RepositoryServiceFactoryException)1 SqlRepositoryFactory (com.evolveum.midpoint.repo.sql.SqlRepositoryFactory)1 TaskManagerConfigurationException (com.evolveum.midpoint.task.api.TaskManagerConfigurationException)1 PageDashboard (com.evolveum.midpoint.web.page.admin.home.PageDashboard)1 FileOutputStream (java.io.FileOutputStream)1 FilenameFilter (java.io.FilenameFilter)1 OutputStreamWriter (java.io.OutputStreamWriter)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1