/** * @param repname * @return Repository configuration */ private RepositoryType getRepositoryType(String repname) { RepositoryType[] repositories = AppConfig.getsConfig().getConfigDocument().getConfig().getRepositoryArray(); for (RepositoryType rep : repositories) { if (rep.getName().equals(repname)) { return rep; } } return null; } /**
props = rootConfig.getConfig().getProperties(); if (props==null) props = rootConfig.getConfig().addNewProperties();
public Collection<Message> doUpgrade() throws Exception { final SecurityType sec = AppConfig.getsConfig().getConfig().getSecurity(); // Let's just be anal if (sec.isSetCrowd()) { final CrowdAuthConfigType crowdAuth = sec.getCrowd(); final Properties props = PropertiesUtil.loadFromString(crowdAuth.getCrowdProperties()); final String crowdUrl = props.getProperty(PROPERTIES_FILE_SECURITY_SERVER_URL); if (crowdUrl.startsWith("https")) { props.setProperty(PROPERTIES_FILE_SECURITY_SERVER_URL, crowdUrl.replaceFirst("https", "http")); crowdAuth.setCrowdProperties(PropertiesUtil.saveToString(props)); sec.setCrowd(crowdAuth); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().getUserManager().reload(AppConfig.getsConfig().getConfig()); } } return null; }
if (this.cfg.getSecurity().isSetCrowd()) CrowdAuthConfigType crowdCfg = this.cfg.getSecurity().getCrowd(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_CROWD_USER_MANAGEMENT); if (this.cfg.getSecurity().isSetBuiltIn()) userMgmtProps.setValue(FISHEYE_BUILTIN_SIGNUP_ENABLED, String.valueOf(this.cfg.getSecurity().getBuiltIn().getSignup().getEnabled())); if (this.cfg.getSecurity().isSetLdap()) LdapConfigType ldapCfg = this.cfg.getSecurity().getLdap(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_LDAP_USER_MANAGEMENT); userMgmtProps.setValue(LDAP_URL, ldapCfg.getUrl()); if (this.cfg.getSecurity().isSetCustom() && this.cfg.getSecurity().getCustom() != null) CustomSecurityConfigType customCfg = this.cfg.getSecurity().getCustom(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_CUSTOM_USER_MANAGEMENT); userMgmtProps.setValue(CUSTOM_SECURITY_CLASS, customCfg.getClassname()); if (this.cfg.getSecurity().isSetAjp() && this.cfg.getSecurity().getCustom() != null) CustomSecurityConfigType ajpCfg = this.cfg.getSecurity().getCustom(); userMgmtProps.setValue(AUTO_ADD_USERS, String.valueOf(ajpCfg.getAutoAdd())); userMgmtProps.setValue(CACHE_TTL, ajpCfg.getPositiveCacheTtl()); if (this.cfg.getSecurity().isSetHostAuth() && this.cfg.getSecurity().getHostAuth() != null)
if (this.cfg.getWebServer() != null) if (this.cfg.getWebServer().isSetSiteUrl()) appProps.setValue(SITE_URL, this.cfg.getWebServer().getSiteUrl()); if (this.cfg.getWebServer().isSetContext()) appProps.setValue(SITE_CONTEXT, this.cfg.getWebServer().getContext()); if (this.cfg.getWebServer().isSetHttp()) if (this.cfg.getWebServer().getHttp().isSetContext()) appProps.setValue(HTTP_CONTEXT, this.cfg.getWebServer().getHttp().getContext()); appProps.setValue(HTTP_BIND, this.cfg.getWebServer().getHttp().getBind()); if (this.cfg.getWebServer().getHttp().isSetProxyHost()) appProps.setValue(SITE_PROXY_HOST, String.valueOf(this.cfg.getWebServer().getHttp().getProxyHost())); if (this.cfg.getWebServer().getHttp().isSetProxyPort()) appProps.setValue(SITE_PROXY_PORT, String.valueOf(this.cfg.getWebServer().getHttp().getProxyPort())); if (this.cfg.getWebServer().getHttp().isSetProxyScheme()) appProps.setValue(SITE_PROXY_SCHEME, this.cfg.getWebServer().getHttp().getProxyScheme());
props = rootConfig.getConfig().getProperties(); if (props==null) props = rootConfig.getConfig().addNewProperties();
private void addSourceControlProperties(PropertyStore store) { PropertyStore sourceProps = store.addCategory(SOURCE_CONTROL); if (this.cfg.isSetSvnConfig()) { SvnConfigType svnCfg = this.cfg.getSvnConfig(); if (svnCfg.isSetJar()) { sourceProps.setValue(SVN_CLIENT_JAR, svnCfg.getJar()); } if (svnCfg.isSetJnilib()) { sourceProps.setValue(SVN_CLIENT_LIB, svnCfg.getJnilib()); } } if (this.cfg.isSetP4Config()) { sourceProps.setValue(P4_CLIENT, this.cfg.getP4Config().getP4Location()); } }
public Collection<Message> doUpgrade() throws Exception { final SecurityType sec = AppConfig.getsConfig().getConfig().getSecurity(); // Let's just be anal if (sec.isSetCrowd()) { final CrowdAuthConfigType crowdAuth = sec.getCrowd(); final Properties props = PropertiesUtil.loadFromString(crowdAuth.getCrowdProperties()); final String crowdTokenKey = props.getProperty(PROPERTIES_FILE_CROWD_TOKEN_KEY); // If it's already something else, maybe we shouldn't change it? if (crowdTokenKey == null) { props.setProperty(PROPERTIES_FILE_CROWD_TOKEN_KEY, CROWD_TOKEN_KEY); crowdAuth.setCrowdProperties(PropertiesUtil.saveToString(props)); sec.setCrowd(crowdAuth); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().getUserManager().reload(AppConfig.getsConfig().getConfig()); } } return null; }
public void setLicense(final String license) throws FisheyeAccessorException { final RootConfig rootConfig = AppConfig.getsConfig(); final LicenseType licenses = AppConfig.getsConfig().getConfig().getLicense(); licenses.setCrucible(license); licenses.setFisheye(license); try { rootConfig.saveConfig(); rootConfig.refreshLicenses(); } catch (final IOException ioe) { throw new FisheyeAccessorException("Error saving configuration while reloading license", ioe); } catch (final LicenseException le) { throw new FisheyeAccessorException("Error loading license", le); } }
@Override protected String getBaseUrl() { String siteURL = super.getBaseUrl(); if (siteURL == null) { // there is no baseUrl set. Lets read confluence one from Applinks Configuration // TODO look at JST-460 and remove following code that reads the base url from Crucible ApplicationInstance primaryCrucible = getApplicationsInstancesInternal(Application.CRUCIBLE).getPrimary(); if (primaryCrucible!=null) { siteURL = primaryCrucible.getUrl(); AppConfig.getsConfig().getConfig().getWebServer().setSiteUrl(siteURL); log.warn("FishEye base url empty. Setting to " +siteURL); siteURL = removeTrailingSlash(siteURL); } } return siteURL; }
/** * @param repname * @return Repository configuration */ private RepositoryType getRepositoryType(final String repname) { final RepositoryType[] repositories = AppConfig.getsConfig().getConfigDocument().getConfig().getRepositoryArray(); for (final RepositoryType rep : repositories) { if (rep.getName().equals(repname)) { return rep; } } return null; }
/** * Set the base URL of this application */ @Override protected void setBaseUrl(final String url) throws Exception { // Only update the site url if it is actually set final WebServerType ws = AppConfig.getsConfig().getConfig().getWebServer(); if (ws.isSetSiteUrl()) { ws.setSiteUrl(url); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().reload(); } }
private RepositoryType getRepositoryType(final String repositoryName) { final RepositoryType[] repositories = AppConfig.getsConfig().getConfigDocument().getConfig().getRepositoryArray(); for (final RepositoryType repository : repositories) { if (repository.getName().equals(repositoryName)) { return repository; } } return null; }
private int getRepositoryId(final String repositoryName) { final RepositoryType[] repositoryArray = AppConfig.getsConfig().getConfig().getRepositoryArray(); for (int i = 0; i < repositoryArray.length; i++) { final RepositoryType repositoryType = repositoryArray[i]; if (repositoryName.equals(repositoryType.getName())) { return i; } } return -1; }
public String getBaseUrl() { RootConfig getsConfig = AppConfig.getsConfig(); String siteURL = getsConfig.getSiteURL(); WebServerType ws = getsConfig.getConfig().getWebServer(); return removeTrailingSlash(siteURL); }