Check to see if we should show the changelog activity if there are any new changes
to the configuration file.

@param ctx           the context to launch the activity with
@param configId      the changelog configuration xml resource id
2922
public static void checkChangelogDialog(Activity ctx, @XmlRes int configId){

        // Parse configuration
        ChangeLog changeLog = Parser.parse(ctx, configId);
        if(changeLog != null){

            // Validate that there is a new version code
            if(validateVersion(ctx, changeLog)) {
                openChangelogDialog(ctx, configId);
            }

        }else{
            throw new NullPointerException("Unable to find a 'Winds' configuration @ " + configId);
        }

    }
1168246
public static void reconfigure(InputStream config, LoggerContext context) {
        if (context == null) {
            throw new NullPointerException("LoggerContext must not be null");
        }
        LoggerContext lc = context;
        JoranConfigurator jc = new JoranConfigurator();
        jc.setContext(lc);
        StatusUtil statusUtil = new StatusUtil(lc);
        List<SaxEvent> eventList = jc.recallSafeConfiguration();

        URL mainURL = ConfigurationWatchListUtil.getMainWatchURL(lc);
        lc.reset();
        long threshold = System.currentTimeMillis();
        try {
            jc.doConfigure(config);
            if (statusUtil.hasXMLParsingErrors(threshold)) {
                fallbackConfiguration(lc, eventList, mainURL);
            }
        } catch (JoranException e) {
            fallbackConfiguration(lc, eventList, mainURL);
        }
    }
603319
private void _initLogger(Map<String, ?> conf) {
        boolean logEnabled = (Boolean) RythmConfigurationKey.LOG_ENABLED.getConfiguration(conf);
        if (logEnabled) {
            ILoggerFactory factory = RythmConfigurationKey.LOG_FACTORY_IMPL.getConfiguration(conf);
            Logger.registerLoggerFactory(factory);
        } else {
            Logger.registerLoggerFactory(new NullLogger.Factory());
        }
    }
545083
public static void configure(String xmlConfig, File voltroot) {
        try {
            Class<?> loggerClz = Class.forName("org.voltcore.logging.VoltLog4jLogger");
            assert(loggerClz != null);
            Method configureMethod = loggerClz.getMethod("configure", String.class, File.class);
            configureMethod.invoke(null, xmlConfig, voltroot);
        } catch (Exception e) {}
    }
1023455
public void validateUpdateFile(Long configId, String fileName) {

        //
        // config
        //
        Config config = valideConfigExist(configId);

        //
        // value
        //
        try {

            if (!config.getName().equals(fileName)) {
                throw new Exception();
            }

        } catch (Exception e) {

            throw new FieldException("value", "conf.file.name.not.equal", e);
        }

    }
1305841
public static boolean fixLogging(ConfigServerImpl cs, ConfigImpl config, Document doc) {

	// if version is bigger than 4.2 there is nothing to do
	Element luceeConfiguration = doc.getDocumentElement();
	String strVersion = luceeConfiguration.getAttribute("version");
	double version = Caster.toDoubleValue(strVersion, 1.0d);
	config.setVersion(version);

	if (version >= 4.3D) return false;

	// datasource
	Element src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "datasource");
	fixLogging(cs, doc, src, "datasource", false, "{lucee-config}/logs/datasource.log");

	setVersion(doc, ConfigWebUtil.getEngine(config).getInfo().getVersion());

	if (version >= 4.2D) return true;

	// mapping
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "mappings");
	fixLogging(cs, doc, src, "mapping", false, "{lucee-config}/logs/mapping.log");

	// rest
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "rest");
	fixLogging(cs, doc, src, "rest", false, "{lucee-config}/logs/rest.log");

	// gateway
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "gateways");
	fixLogging(cs, doc, src, "gateway", false, "{lucee-config}/logs/gateway.log");

	// remote clients
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "remote-clients");
	fixLogging(cs, doc, src, "remoteclient", false, "{lucee-config}/logs/remoteclient.log");

	// orm
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "orm");
	fixLogging(cs, doc, src, "orm", false, "{lucee-config}/logs/orm.log");

	// mail
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "mail");
	fixLogging(cs, doc, src, "mail", false, "{lucee-config}/logs/mail.log");

	// search
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "search");
	fixLogging(cs, doc, src, "search", false, "{lucee-config}/logs/search.log");

	// scheduler
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "scheduler");
	fixLogging(cs, doc, src, "scheduler", false, "{lucee-config}/logs/scheduler.log");

	// scope
	src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "scope");
	fixLogging(cs, doc, src, "scope", false, "{lucee-config}/logs/scope.log");

	// application
	Element app = src = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "application");
	fixLogging(cs, doc, src, "application", "application-log", "application-log-level", false, "{lucee-config}/logs/application.log");

	// exception
	fixLogging(cs, doc, app, "exception", "exception-log", "exception-log-level", false, "{lucee-config}/logs/exception.log");

	// trace
	fixLogging(cs, doc, app, "trace", "trace-log", "trace-log-level", false, "{lucee-config}/logs/trace.log");

	// thread
	fixLogging(cs, doc, app, "thread", "thread-log", "thread-log-level", false, "{lucee-config}/logs/thread.log");

	// deploy
	fixLogging(cs, doc, app, "deploy", "deploy-log", "deploy-log-level", false, "{lucee-config}/logs/deploy.log");

	// requesttimeout
	fixLogging(cs, doc, app, "requesttimeout", "requesttimeout-log", "requesttimeout-log-level", false, "{lucee-config}/logs/requesttimeout.log");

	setVersion(doc, ConfigWebUtil.getEngine(config).getInfo().getVersion());

	return true;
    }
173849
public function changelogAction()
    {
        $this->_showText(sprintf($this->_('Changelog %s'), $this->escort->project->name), APPLICATION_PATH . '/changelog.txt');
    }
67144
public void addConfiguration(I_CmsXmlConfiguration configuration) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_CONFIG_1, configuration));
        }
        m_configurations.add(configuration);
        cacheDtdSystemId(configuration);
    }
515480
private void dialogChanged() {
		
		// TODO: Needs to be cleaned up, this design is tied to a two page design and can't handle a third page, e.g. used for some other component type...

		if (componentType.value == UTILITY_COMPONENT.ordinal()) {
			updateStatus("Utility components are not yet supported");
			return;
		}

		String artifactId = getArtifactId();
		if (artifactId == null) {
			updateStatus("Missing artifact id");
			return;
		}

		if (artifactId.toLowerCase().startsWith("test")) {
			updateStatus("Artifact id should not start with \"test\" since it will confuse JUnit to think that non unit-test classes are unit-test classes");
			return;
		}

		// If creating an integration component then force viewing page #2 otherwise mark it as completed
		ComponentEnum compEnum = ComponentEnum.get(componentType.value);
		CreateIntegrationComponentPage p = ((CreateComponentWizard)getWizard()).getCreateIntegrationComponentPage();
		p.setMustBeDisplayed(compEnum == INTEGRATION_COMPONENT);
		getContainer().updateButtons();

		// If creating an schema description integration component then force viewing page #2 otherwise mark it as completed
		CreateServiceDescriptionComponentPage p2 = ((CreateComponentWizard)getWizard()).getCreateServiceDescriptionComponentPage();
		p2.setMustBeDisplayed(compEnum == SD_SCHEMA_COMPONENT);
		getContainer().updateButtons();
		
		String rootFolderName = getRootFolder();

		if (rootFolderName.length() == 0) {
			updateStatus("The root folder must be specified");
			return;
		}

		File rootFolder = new File(rootFolderName);
		if (!rootFolder.isDirectory()) {
			updateStatus("The root folder must be an existing folder");
			return;
		}
		
		String projectFolderName = getComponentProjectName(componentType.value, getGroupId(), getArtifactId());
		
		System.err.println("comp-type: " + componentType + ", proj-namn: " + projectFolderName);
		if (projectFolderName != null) {
			File projectFolder = new File(rootFolderName + "/" + projectFolderName);
			if (projectFolder.exists()) {
				updateStatus("Project folder [" + projectFolderName + "] already exists in root folder [" + rootFolderName + "], select a name of a non-existing folder");
				return;
			}
		}
		
		// TODO: Also assert that a project with the selected name doesn't already exist in the workspace

		File mvnHome = new File(getMavenHome());
		if (!mvnHome.isDirectory()) {
			updateStatus("The maven home folder must be an existing folder, update in the soi-toolkit preferences page");
			return;
		}
		
		File mvn = new File(getMavenHome() + "/bin/mvn" + (SwtUtil.isWindows() ? ".bat" : ""));
		if (!mvn.isFile()) {
			updateStatus("The maven executable can't be found at: " + mvn.getAbsolutePath() + ", update in the soi-toolkit preferences page");
			return;
		}
		
		// Validate custom model by setting it on the model-factory-class
		String groovyClass = getCustomGroovyModelImpl();
		if (groovyClass == null || groovyClass.trim().length() == 0) {
			System.err.println("### Empty groovy-classname, reset model");
			ModelFactory.resetModelClass();
		} else {
			try {
				System.err.println("### Setting groovy-classname: " + groovyClass);
				ModelFactory.setModelGroovyClass(new URL(groovyClass));
			} catch (Throwable ex) {
				ModelFactory.resetModelClass();
				updateStatus("Invalid Groovy class for a custom model (update in the soi-toolkit preferences page), error: " + ex);
				return;
			}
		}

		updateStatus(null);
	}
354335
function(changelogOptions) {
        var self = this;
        return this._generateChangeLog(changelogOptions)
          .then(function(changelog) {
            return {
              deployMetaData: {
                changelog: changelog,
                summary: self.readConfig('summary'),
                deployer: self.readConfig('deployer')
              }
            };
          });
      }
383723
@Handler(dynamic = true)
    public void onConfigurationUpdate(ConfigurationUpdate event)
            throws BackingStoreException {
        if (event instanceof InitialPreferences) {
            return;
        }
        for (String path : event.paths()) {
            Optional<Map<String, String>> prefs = event.values(path);
            path = path.substring(1); // Remove leading slash
            if (!prefs.isPresent()) {
                preferences.node(path).removeNode();
                continue;
            }
            for (Map.Entry<String, String> e : prefs.get().entrySet()) {
                preferences.node(path).put(e.getKey(), e.getValue());
            }
        }
        preferences.flush();
    }
304371
@Override
    public void dispatchConfigurationChanged(Configuration newConfig) {
        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchConfigurationChanged] newConfig: " + newConfig);

        if (aActionBar != null) {
            aActionBar.onConfigurationChanged(newConfig);
        }
    }
101339
void changeLoggerLevel(LoggerLevel clickedLevel, Set<Logger> clickedLogger) {

        for (Logger logger : clickedLogger) {
            @SuppressWarnings("resource")
            LoggerContext context = logger.getContext();
            Configuration config = context.getConfiguration();
            LoggerConfig loggerConfig = config.getLoggerConfig(logger.getName());
            LoggerConfig specificConfig = loggerConfig;
            if (!loggerConfig.getName().equals(logger.getName())) {
                specificConfig = new LoggerConfig(logger.getName(), clickedLevel.getLevel(), true);
                specificConfig.setParent(loggerConfig);
                config.addLogger(logger.getName(), specificConfig);
            }
            specificConfig.setLevel(clickedLevel.getLevel());
            context.updateLoggers();
        }
        updateLevel();
    }
785012
@Override
    public synchronized void update(LogProviderConfig config) {
        // Get the configured log location, and derive the ffdc location from it
        File location = config.getLogDirectory();
        if (location == null) {
            location = new File(".");
        }
        location = new File(location, FFDCConfigurator.FFDC_DIR);

        ffdcLogDirectory = location;

        int maxFiles = config.getMaxFiles();

        // Creation and rolling of files should be done as the server
        Object token = ThreadIdentityManager.runAsServer();
        try {
            summaryLogSet.update(location,
                                 FFDCConfigurator.FFDC_SUMMARY_FILE_NAME,
                                 FFDCConfigurator.FFDC_EXTENSION,
                                 maxFiles);
            synchronized (ffdcLogSet) {
                ffdcLogSet.update(location,
                                  FFDCConfigurator.FFDC_FILE_NAME,
                                  FFDCConfigurator.FFDC_EXTENSION,
                                  0 /* unlimited */);
            }
        } finally {
            ThreadIdentityManager.reset(token);
        }
    }
723585
public static ChangeLog parse(Context ctx, @XmlRes int license){
        ChangeLog clog = new ChangeLog();

        // Get the XMLParser
        XmlPullParser parser = ctx.getResources().getXml(license);

        // Begin parsing
        try {
            parser.next();
            parser.require(XmlPullParser.START_DOCUMENT, null, null);
            parser.nextTag();
            parser.require(XmlPullParser.START_TAG, null, DOCUMENT_TAG);
            while(parser.next() != XmlPullParser.END_TAG){
                if (parser.getEventType() != XmlPullParser.START_TAG) {
                    continue;
                }

                String name = parser.getName();
                if(name.equals(TAG_VERSION)){
                    clog.addVersion(readVersion(parser));
                }else{
                    skip(parser);
                }
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return clog;
    }
929669
public static void reconfigure(InputStream config) {
        if (CONTEXT == null) {
            log.warn("当前日志上下文不是logback，不能使用该配置器重新配置");
            return;
        }
        reconfigure(config, CONTEXT);
    }
52482
@RequestMapping(value = "changelog/export", method = RequestMethod.GET)
    public ResponseEntity<String> changeLog(IssueChangeLogExportRequest request) {
        // Gets the change log
        GitChangeLog changeLog = gitService.changeLog(request);
        // Gets the associated project
        Project project = changeLog.getProject();
        // Gets the configuration for the project
        GitConfiguration gitConfiguration = gitService.getProjectConfiguration(project);
        if (gitConfiguration == null) {
            throw new GitProjectNotConfiguredException(project.getId());
        }
        // Gets the issue service
        Optional<ConfiguredIssueService> optConfiguredIssueService = gitConfiguration.getConfiguredIssueService();
        if (!optConfiguredIssueService.isPresent()) {
            return new ResponseEntity<>(
                    "The branch is not configured for issues",
                    HttpStatus.NO_CONTENT
            );
        }
        ConfiguredIssueService configuredIssueService = optConfiguredIssueService.get();
        // Gets the issue change log
        GitChangeLogIssues changeLogIssues = gitService.getChangeLogIssues(changeLog);
        // List of issues
        List<Issue> issues = changeLogIssues.getList().stream()
                .map(SCMChangeLogIssue::getIssue)
                .collect(Collectors.toList());
        // Exports the change log using the given format
        ExportedIssues exportedChangeLogIssues = configuredIssueService.getIssueServiceExtension()
                .exportIssues(
                        configuredIssueService.getIssueServiceConfiguration(),
                        issues,
                        request
                );
        // Content type
        HttpHeaders responseHeaders = new HttpHeaders();
        responseHeaders.set("Content-Type", exportedChangeLogIssues.getFormat() + "; charset=utf-8");
        // Body and headers
        return new ResponseEntity<>(exportedChangeLogIssues.getContent(), responseHeaders, HttpStatus.OK);
    }