com.atlassian.confluence.setup.settings.SettingsManager Java Examples

The following examples show how to use com.atlassian.confluence.setup.settings.SettingsManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OnlyOfficeEditorServlet.java    From onlyoffice-confluence with GNU Affero General Public License v3.0 5 votes vote down vote up
@Inject
public OnlyOfficeEditorServlet(PluginSettingsFactory pluginSettingsFactory, LocaleManager localeManager,
        SettingsManager settingsManager, UrlManager urlManager, JwtManager jwtManager) {
    this.pluginSettingsFactory = pluginSettingsFactory;
    this.settingsManager = settingsManager;
    this.jwtManager = jwtManager;
    this.urlManager = urlManager;
    this.localeManager = localeManager;
}
 
Example #2
Source File: OnlyOfficeConfServlet.java    From onlyoffice-confluence with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String username = userManager.getRemoteUsername(request);
    if (username == null || !userManager.isSystemAdmin(username)) {
        SettingsManager settingsManager = (SettingsManager) ContainerManager.getComponent("settingsManager");
        String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();
        response.sendRedirect(baseUrl);
        return;
    }

    PluginSettings pluginSettings = pluginSettingsFactory.createGlobalSettings();
    String apiUrl = (String) pluginSettings.get("onlyoffice.apiUrl");
    String jwtSecret = (String) pluginSettings.get("onlyoffice.jwtSecret");
    if (apiUrl == null || apiUrl.isEmpty()) {
        apiUrl = "";
    }
    if (jwtSecret == null || jwtSecret.isEmpty()) {
        jwtSecret = "";
    }

    response.setContentType("text/html;charset=UTF-8");
    PrintWriter writer = response.getWriter();

    Map<String, Object> contextMap = MacroUtils.defaultVelocityContext();

    contextMap.put("docserviceApiUrl", apiUrl);
    contextMap.put("docserviceJwtSecret", jwtSecret);

    writer.write(getTemplate(contextMap));
}
 
Example #3
Source File: DefaultStyleSheetExtractorImpl.java    From livingdoc-confluence with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for IoC
 */
public DefaultStyleSheetExtractorImpl(BootstrapManager bootstrapManager, SettingsManager settingsManager,
    ConfluenceWebResourceManager webResourceManager) {
    this.settingsManager = settingsManager;
    this.bootstrapManager = bootstrapManager;
    this.webResourceManager = webResourceManager;
}
 
Example #4
Source File: LivingDocConfluenceManager.java    From livingdoc-confluence with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Constructor for IoC
 * 
 * Note: The qualifier for {@link PageManager} is needed because
 * there are multiple implementations.
 */
public LivingDocConfluenceManager(LivingDocPersistenceService livingDocServerService, LoginManager loginManager,
                                  ConfluenceUserManager confluenceUserManager, TransactionTemplate transactionTemplate,
                                  SettingsManager settingsManager, AtlassianBootstrapManager bootstrapManager,
                                  ContentPropertyManager contentPropertyManager, ContentPermissionManager contentPermissionManager,
                                  WikiStyleRenderer wikiStyleRenderer, PageManager pageManager,
                                  SpaceManager spaceManager, SpacePermissionManager spacePermissionManager, LabelManager labelManager,
                                  UserAccessor userAccessor, FormatSettingsManager formatSettingsManager, LocaleManager localeManager,
                                  Renderer viewRenderer) {
    this.livingDocPersistenceService = livingDocServerService;
    this.loginManager = loginManager;
    this.confluenceUserManager = confluenceUserManager;
    this.transactionTemplate = transactionTemplate;
    this.settingsManager = settingsManager;
    this.bootstrapManager = bootstrapManager;
    this.contentPropertyManager = contentPropertyManager;
    this.contentPermissionManager = contentPermissionManager;
    this.wikiStyleRenderer = wikiStyleRenderer;
    this.pageManager = pageManager;
    this.spaceManager = spaceManager;
    this.spacePermissionManager = spacePermissionManager;
    this.labelManager = labelManager;
    this.userAccessor = userAccessor;
    this.formatSettingsManager = formatSettingsManager;
    this.localeManager = localeManager;
    this.viewRenderer = viewRenderer;
}
 
Example #5
Source File: ElementRenderer.java    From adam with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Autowired
public ElementRenderer(@Nonnull WikiStyleRenderer wikiStyleRenderer, @Nonnull SettingsManager settingsManager, @Nonnull UserAccessor userAccessor) {
    _wikiStyleRenderer = wikiStyleRenderer;
    _settingsManager = settingsManager;
    _userAccessor = userAccessor;
    c_instance = this;
}
 
Example #6
Source File: UrlManager.java    From onlyoffice-confluence with GNU Affero General Public License v3.0 4 votes vote down vote up
@Inject
public UrlManager(PluginSettingsFactory pluginSettingsFactory, SettingsManager settingsManager) {
    this.pluginSettingsFactory = pluginSettingsFactory;
    this.settingsManager = settingsManager;
    pluginSettings = pluginSettingsFactory.createGlobalSettings();
}
 
Example #7
Source File: LivingDocConfluenceManager.java    From livingdoc-confluence with GNU General Public License v3.0 4 votes vote down vote up
public SettingsManager getSettingsManager() {
    return settingsManager;
}