Package org.modeshape.common.collection

Examples of org.modeshape.common.collection.Problems


        ModeShape.getName(); // force log message right up front
        this.config.set(configuration);
        RepositoryConfiguration config = this.config.get();

        // Validate the configuration to make sure there are no errors ...
        Problems results = configuration.validate();
        setConfigurationProblems(results);
        if (results.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName, results.errorCount(),
                                                                      results.toString());
            throw new ConfigurationException(results, msg);
        }

        this.repositoryName.set(config.getName());
        this.logger = Logger.getLogger(getClass());
View Full Code Here


            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new FileInputStream(file))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, file.getAbsolutePath());

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingNodeTypeDefinitions.text(file.getAbsolutePath(), summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingNodeTypeDefinitions;
View Full Code Here

            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new StringReader(content))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, "stream");

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingStreamOfNodeTypeDefinitions.text(summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingStreamOfNodeTypeDefinitions;
View Full Code Here

            // This is Jackrabbit XML format ...
            return registerNodeTypes(importFromXml(new InputSource(new StringReader(content))), allowUpdate);
        }
        // Assume this is CND format ...
        CndImporter importer = new CndImporter(context());
        Problems problems = new SimpleProblems();
        importer.importFrom(content, problems, url.toExternalForm());

        // Check for (and report) any problems ...
        if (problems.hasProblems()) {
            // There are errors and/or warnings, so report them ...
            String summary = messageFrom(problems);
            if (problems.hasErrors()) {
                String msg = JcrI18n.errorsParsingNodeTypeDefinitions.text(url.toExternalForm(), summary);
                throw new RepositoryException(msg);
            }
            // Otherwise, there are warnings, so log them ...
            I18n msg = JcrI18n.warningsParsingNodeTypeDefinitions;
View Full Code Here

                config.getDocument(FieldName.JOURNALING).setString(FieldName.JOURNAL_LOCATION, finalJournalLocation);
            }

            if (LOG.isDebugEnabled()) {
                LOG.debugv("ModeShape configuration for '{0}' repository: {1}", repositoryName, config);
                Problems problems = repositoryConfiguration.validate();
                if (problems.isEmpty()) {
                    LOG.debugv("Problems with configuration for '{0}' repository: {1}", repositoryName, problems);
                }
            }

            // Create a new (updated) configuration ...
View Full Code Here

        providers.add(provider);

        // Get the changes and validate them ...
        Changes changes = configEditor.getChanges();
        Problems validationResults = repositoryConfig.validate(changes);

        if (validationResults.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName,
                                                                      validationResults.errorCount(),
                                                                      validationResults.toString());
            throw new StartException(msg);
        }
        // Update the deployed repository's configuration with these changes
        try {
            engine.update(this.repositoryName, changes);
View Full Code Here

        indexes.set(definitionName, indexDefinition);

        // Get the changes and validate them ...
        Changes changes = editor.getChanges();
        Problems validationResults = repositoryConfig.validate(changes);

        if (validationResults.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName,
                                                                      validationResults.errorCount(),
                                                                      validationResults.toString());
            throw new StartException(msg);
        }
        // Update the deployed repository's configuration with these changes
        try {
            engine.update(this.repositoryName, changes);
View Full Code Here

        extractors.set(extractorName, extractor);

        // Get the changes and validate them ...
        Changes changes = configEditor.getChanges();
        Problems validationResults = repositoryConfig.validate(changes);

        if (validationResults.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName,
                                                                      validationResults.errorCount(),
                                                                      validationResults.toString());
            throw new StartException(msg);
        }
        // Update the deployed repository's configuration with these changes
        try {
            engine.update(this.repositoryName, changes);
View Full Code Here

        sequencers.set(sequencerName, seq);

        // Get the changes and validate them ...
        Changes changes = editor.getChanges();
        Problems validationResults = repositoryConfig.validate(changes);

        if (validationResults.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName,
                                                                      validationResults.errorCount(),
                                                                      validationResults.toString());
            throw new StartException(msg);
        }
        // Update the deployed repository's configuration with these changes
        try {
            engine.update(this.repositoryName, changes);
View Full Code Here

        providers.set(providerName, provider);

        // Get the changes and validate them ...
        Changes changes = editor.getChanges();
        Problems validationResults = repositoryConfig.validate(changes);

        if (validationResults.hasErrors()) {
            String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName,
                                                                      validationResults.errorCount(),
                                                                      validationResults.toString());
            throw new StartException(msg);
        }
        // Update the deployed repository's configuration with these changes
        try {
            engine.update(this.repositoryName, changes);
View Full Code Here

TOP

Related Classes of org.modeshape.common.collection.Problems

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.