youngmon/atlassian-qna huggingface dataset:
Get serverID inside servlet module
Asked by luis:

Hello guys, I need some help.

I'm developing a confluence server plugin and I need to get the confluence server id when the servlet url is hit. I haven't figured out yet how to do it. Is there any way to do that?

Thanks in advance,

Lu?s


Answers:
author: Thor
body: Hi there,

You could try it with the [ConfluenceInfo](https://docs.atlassian.com/ConfluenceServer/javadoc/6.8.1/com/atlassian/confluence/status/service/systeminfo/ConfluenceInfo.html) bean.

comments: author: luis
body: Thanks for your help.

I tried with no luck.

I tried this:

```
I18NBean a = null;
ConfluenceInfo ci = new ConfluenceInfo(a);
String serverID = ci.getServerId();
```

```
// serverID is null
```

However, all ci methods are returning null.

<br />

Any idea?


author: Thor
body: Hey [@luis](/t5/user/viewprofilepage/user-id/1208499),

I had the chance to unsuccessfully try this myself. But I figured out a way that works for me:

* Create a field in your class with type of *ConfluenceSidManager* :

  ```
  private ConfluenceSidManager sidManager;
  ```

* Inject the manager into your constructor or write a setter for it
* Now you can get the server id like this:

  ```
  sidManager.getSid()
  ```

Hope that works for you as well.

Kind Regards


author: luis
body: Hey [@Thor](/t5/user/viewprofilepage/user-id/568674), I've tried it but with no luck :\\

How do you inject the ConfluenceSidManager into your class constructor? Or how do you call the class constructor then?

If could share a code snippet of what you described working, that would be really amazing.

Thanks again.

Kind regards


author: Thor
body: Hey [@luis](/t5/user/viewprofilepage/user-id/1208499),

[Here](https://developer.atlassian.com/server/confluence/accessing-confluence-components-from-plugin-modules/) is a good article about dependcy injection in plugins.

To inject it into your constructor (*preferred way for v2 plugins*) do this:

```
private ConfluenceSidManager sidManager;
...
```

```
...

public MyClass(ConfluenceSidManager sidManager) {

? ? this.sidManager = sidManager;

}
```

To inject the manager via a setter (*the default way to do this for v1 plugins*) do this:

```
private ConfluenceSidManager sidManager;
...
```

```
...

public void setSidManager(ConfluenceSidManager sidManager) { 
    this.sidManager = sidManager; 
}
...
```

Then you have to call the setter (*e.g. if you are writing a macro inside the execute method*):

```

setSidManager(ComponentLocator.getComponent(ConfluenceSidManager.class));

```

From now on you should be able to use the manager.


author: luis
body: Thanks [@Thor](/t5/user/viewprofilepage/user-id/568674)! That solved the problem :)


author: Thor
body: Hey [@luis](/t5/user/viewprofilepage/user-id/1208499), you're welcome! I'm happy to hear that :-)


Tags: confluence-app

server

servlet
What is wrong with restrictions for confluence calendars?
Asked by Shahriar:

Hi,

I am trying to restrict users/group for a calendar in one of the spaces in my confluence. I don't think it is working. I have an admin and a test account as well. I have been testing by restricting the test account but I don't think it is doing what it's supposed to. The test account is still able to edit and view the calendar and events. Is anyone else having this issue with their confluence calendar? Please help :)

I am using Confluence 6.4.3

Screenshots attached

![Screen Shot 2018-04-10 at 11.15.01 AM.png](/t5/image/serverpage/image-id/19160i3FBC545070ACA8C6/image-dimensions/530x212?v=v2 "Screen Shot 2018-04-10 at 11.15.01 AM.png")![Screen Shot 2018-04-10 at 11.15.10 AM.png](/t5/image/serverpage/image-id/19159iD9596039FEF9C017/image-dimensions/534x405?v=v2 "Screen Shot 2018-04-10 at 11.15.10 AM.png")

Thanks,

Shark


Answers:
author: AnnWorley
body: Hey Shark,

In the screen shot you posted the expected behavior would be that only the Shahriar test account would be able to view or edit the calendar. Is anyone else able to edit or view it?

Please see: [Restrict a Calendar](https://confluence.atlassian.com/teamcal/restrict-a-calendar-660737259.html) for details.

If other users are able to see and edit the calendar, please check whether those users are members of the super-user group "confluence-administrators".[Comparing the confluence-administrators group with the administrator permissions](https://confluence.atlassian.com/doc/global-permissions-overview-138709.html#GlobalPermissionsOverview-supergroup):
> The default confluence-administrators group is a special, 'super-user' group that gets permissions above and beyond the Confluence administrator and system administrator global permissions. Members of this group can perform site-wide administration functions, and also see the content of all pages and spaces in the Confluence site, regardless of space permissions or page restrictions.

I look forward to any follow up.

Thanks,

Ann

comments: author: Shahriar
body: Hi Ann,

I guess I misread the restriction statement in confluence. I understood it the other way lol. Thank you so much!

Thanks,

Shark


author: AnnWorley
body: My pleasure, thanks for circling back!


Tags: team-calendars-for-confluence
Has anyone used OKTA for user Authentication and AD for group Authorization for on-prem Confluence?
Asked by Joe Birney:

Folks

our company traditionally has been using LDAP to authenticate the users and have their group information stored in AD. The idea was they can use AD to self-manage their own groups across all of the Atlassian tools. Life has been good.

However, at the direction of the security team, we now want to switch to use OKTA to provide the SSO authentication most of all our apps. We have been able to setup Confluence to authentication the users. But so far we have not found a way to pull in the user's group info from AD in such a setup (we are on Confluence 6.2).

Does anyone know if this is possible (we would like to stay away from Crowd for now)


Answers:
author: Joe Birney
body: Hi Amy

thanks for your feedback. That is what we tried to set up but apparently, it's not working just yet.


author: AnnWorley
body: I cannot speak from personal experience but it is possible that the aggregating group memberships across user directories feature that was introduced with Confluence 5.7 may come in handy. The login would be controlled by the Okta directory but LDAP groups could still be used for Confluence permissions. This strategy is worth testing in your staging environment if possible.

Please review:

[Managing Multiple Directories](https://confluence.atlassian.com/doc/managing-multiple-directories-229838494.html)
> **Login**   
> The directory order is significant during the authentication of the user, in cases where the same user exists in multiple directories. When a user attempts to log in, the application will search the directories in the order specified, and will use the credentials (password) of the first occurrence of the user to validate the login attempt.
>
> **Permissions**   
> *Aggregating membership (default)*   
> The directory order is not significant when granting the user permissions based on group membership as Confluence uses an aggregating membership scheme by default. If the same username exists in more than one directory, the application will aggregate (combine) group membership from all directories where the username appears.
>
> **Example:**
>
> You have connected two directories: The Customers directory and the Partners directory.  
> The Customers directory is first in the directory order.  
> A username jsmith exists in both the Customers directory and the Partners directory.  
> The user jsmith is a member of group G1 in the Customers directory and group G2 in the Partners directory.  
> The user jsmith will have permissions based on membership of both G1 and G2 regardless of the directory order.


Tags: okta
Table of contents isn't displayed
Asked by Martin Rosset:

Hello,

I'm trying to add a Table of contents on a page and when I do it, it seems to work. In edition mode, the little square corresponding to the table appears but when page is updated, the table of content doesn't show up ...

Any ideas ?

Thanks


Answers:
author: Suren Raj
body: Hi, Martin.

Are there any headings on the current Confluence page where the macro was added? Do you mind providing a screenshot of the page?

The Table of Contents macro scans the headings on the current Confluence page to create a table of contents based on those headings.
Task Managment in Conflunce Mobile
Asked by Marcel Ke?ler:

Hello everybody,

to clean up our workflow we created a own space for each project group and use confluence task lists to distribute needed work.

I know that confluence mobile is not a "full" replacement of the desktop site itself. But the tasks are not a third-party feature and somehow i am unsure if this is a bug or not simply not implanted.

* I can continue a task list, but don't create one. Also not when i try to type \`\[\]\` manually.
* I am not able to mention users in text. But i can mention them in comments (even a \`@\`-button is provided. So this feature is working, but not in the text itself?).

Hope you can help me out and tell me if i should open a bug report or maybe we simply have to wait.

Greetings


Answers:
author: Suren Raj
body: Hi, Guido.

<br />

Creating task and mention user feature are still not available for Confluence Mobile. We have an existing feature request regarding this:

* <https://jira.atlassian.com/browse/CONFCLOUD-58749>

Please feel free to add a comment or engage in the conversation. Product managers and our developer staff are constantly watching these feature requests; please help them understand the impact of this feature on your daily workflow. Keep in mind that this is where other customers will see your feedback as well; overall this will be a much more visible and productive place to communicate when compared to this private support ticket.

If you'd like to understand a bit more about our approach in handling these type of requests, you may find the following article: <https://confluence.atlassian.com/jira/new-features-policy-206865186.html>
HTML and CSS used to design Home Page
Asked by abhi kanojia:

I have made a home page using HTML and CSS. This is a static home and its not any website as such. How can i include this page as my home page in confluence with the same look and feel.

I have the HTML add on from atlassian.

Please Help


Answers:
author: Shannon S
body: Abhi,

You can either put the HTML and CSS you used on a page using the HTML macro as you mentioned, or you can include it in an iFrame.

* [How to put an iFrame into Confluence](https://confluence.atlassian.com/confkb/how-to-put-an-iframe-into-confluence-598837531.html)

You can only set a Confluence page to be a homepage so you will want to use one of those two options.

Shannon

comments: author: abhi kanojia
body: Firstly [@Shannon S](/t5/user/viewprofilepage/user-id/510046) Thank you for the quick reply.

I have 2 separate files : one is **abc.HTML** and other is **abc.CSS.**How do i import these files in confluence and use them to set up my home page?


author: Shannon S
body: Abhi,

You cannot import them. You need to add the code directly into the HTML macro.

Have a look at this article for guidance:

* [HTML Macro](https://confluence.atlassian.com/doc/html-macro-38273085.html)

You *may* be able to reference the CSS hosted externally in your HTML but I haven't personally tested that myself.

Let us know if you have any questions.

Regards,

Shannon


author: abhi kanojia
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) It worked!!! Thanks a Lot.

Just One thing, The images i have added are not visible in confluence, what can i do for viewing images


author: Shannon S
body: Abhi,

How are you referencing those broken images in HTML? Are you using a full path? If you're using a local path and Confluence isn't in the same location as you are referencing, then it won't work.

In addition, if you're referring to an image on another server, you want to make sure Confluence has permission to access that image.

Shannon


author: abhi kanojia
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046)Thanks!!! I added the images sharepoint and used them it worked for me...

But now it created one more issue. The image i am using i also getting set at the top of the page, i dont know the reason behind this.

I have attached an image for reference![2018-04-10_21-10-05.png](https://community.atlassian.com/t5/image/serverpage/image-id/19145i1A5C08C770DE1C86/image-size/large?v=v2&px=999 "2018-04-10_21-10-05.png")


author: Shannon S
body: Abhi,

That's probably an issue with your code.

I would recommend making a new question and include the code your using and the community could help determine the reason it's looking like that.

Regards,

Shannon
How to use confluence Active Objects
Asked by Sushanth Kumar Jayanthi:

**1)How to use custom sequence with custom primary key**

How can we use the existing sequence ("SEARCHACTIVITYIDSEQ") and custom primary key("SEARCHACTIVITYID") when we create AO objects.

public interface SearchActivityEntity extends Entity{

@PrimaryKey("SEARCHACTIVITYID")

public long getSEARCHACTIVITYID();

}

**2)How to access the existing tables using AO**

We have a Table "SEARCHACTIVITY", before we used the hibernating to access this table, Now we want to use AO to access these tables, is there any way to access these existing tables with AO?

AO creates the new table ("AO_707237_SEARCHACTIVITY" even if we specify the existing table name

@Table("SEARCHACTIVITY")

public interface SearchActivityEntity extends Entity{

...

}


Answers:
author: KC Integrations
body: Hi [@Sushanth Kumar Jayanthi](/t5/user/viewprofilepage/user-id/862602) ,

Did you ever get a resolution to this, I want to do the same thing with the RECENTLY_VIEWED AO table.


author: Shannon S
body: Sushanth,

Can you let us know exactly what you're trying to do? It seems like you might be trying to develop an add-on for Confluence?

Shannon

comments: author: Sushanth Kumar Jayanthi
body: Yes we are developing a confluence-plugin, where we have to access the existing custom tables in the confluence schema (which we have added during our old confluence V5.8.13) now we are upgrading to V6.6.2, We were using hibernate ORM before and we are trying to change our ORM to AO in this upgrade.


author: Shannon S
body: Thank you for confirming, Sushanth.

I am personally not familiar with developing add-ons for Confluence, but you may be able to find what you need from our [Developer site](https://developer.atlassian.com/server/framework/atlassian-sdk/active-objects/). Have a look at the page I linked and see if that helps you any.

In addition, there is a [Community there](https://community.developer.atlassian.com/) as well that's much more focused on Developing add-ons than this one. You may find the resources you need there.

Regards,

Shannon


Tags: atl-dev

confluence-app

confluence-development

developer

questions-for-confluence
How can I extract the page version via metadata?
Asked by Caroline Busse:

Hi,

for reporting purpose I would like to extract the page version of all pages e.g. with the label = status and display them in one report on another page.

Unfortuenately the value "Version" referrs to the version of an attachment and not of the page itself.

How can I extract the current page version e.g. from the Page History?

Thanks. :)


Answers:
author: Lauretha Rura
body: Hey [@Caroline Busse](/t5/user/viewprofilepage/user-id/1201915),

[Adaptavist's Page Info for ScriptRunner Confluence plugin](https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.pageinfo/server/overview?_ga=2.155593403.184699952.1523230258-879243970.1517363357) might be able to help in this case :)

For reference on how the plugin works, you may also refer to the documentation below:

- <https://www.adaptavist.com/doco/pages/viewpage.action?pageId=6062460>

comments: author: Caroline Busse
body: Thanks!


Tags: atl-adm
Is it possible to restrict page versioning?
Asked by Caroline Busse:

Hi,

my problem with the versioning in Confluence is, that every time I change even minor things like a missing dot on my page or don't even change anything at all but just press save, a new version is created. So that I have way too many versions in the end.

Is it possible to restrict this? My ideas are:

- only create a new version if something is really changed or

- as I work with Comala Workflows, is there a possibility to edit the version via my workflow? E.g. if I approve my document in the last workflow state, is there a feature that allows the approver to select it's version?

Thanks. :)


Answers:
author: Nic Brough -Adaptavist-
body: The problem here is the definition of "something is really changed". When authoring things, a missing dot might actually fundamentally change the way content reads, so it is "something is really changed", no matter how minor you might think it is. (I've worked with Confluence in a legal firm - they were delighted that it would consider a minor punctuation change a full "version")

So, confluence does the right thing and versions everything in full.

But it does not have a good numbering system for these versions. Scroll Versions and Comala workflows are both good ways to improve the system, such that minor revisions are still versioned but only main versions are released / authorised / published.

comments: author: Caroline Busse
body: Thanks!

But is it possible to manually type in the version numbers via workflow?


author: Nic Brough -Adaptavist-
body: No, the versions remain the full sequential versions. Comala allows you to only "publish" certain versions. Scroll Versions layers a version scheme over the top, so you can say "use Confluence version 2 for Doc version 1, Confluence 45 for Doc 1.1, Confluence 68 for Doc 1.2, Confluence 97 for Doc 2.0" and so on. I'd guess that's closest to what you're looking for


author: Caroline Busse
body: Ok thanks :)
Can not edit a site, editor error
Asked by tgrahammer:

after a server remove we have this problems

we can create a new site but not edit a site.

Error-Message1:  
Diese Seite braucht l?nger als gew?hnlich, um zu laden. Geben Sie ihr ein paar Momente, dann versuchen Sie zu aktualisieren. Sie haben immer noch Probleme? Kontaktieren Sie Ihren Confluence-Admin.

Error-Message2 (after 1 Minute):  

**Der Editor wurde diesmal nicht geladen**

Zeit?berschreitung der Verbindung. Falls das erneut passiert, sprechen Sie mit Ihrem Confluence-Admin. Sie verwenden eventuell einen Proxy-Server, der WebSocket-Verbindungen verhindert.

Thanks for help


Answers:
author: tgrahammer
body: Hi @Niklas Becker

Confluence Version 6.8.0

The collaborative Editing have resolved the problem

Thanks


author: Sloan
body: Hi [@tgrahammer](/t5/user/viewprofilepage/user-id/66285)

* What version of Confluence do you use?
* What do you understand under a "server remove"? What changes did you make to Confluence?
* Can you check the [Confluence Application Logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html) for recent errors?
* Have a Look at your [Instance Health](https://confluence.atlassian.com/support/instance-health-790796828.html).
* Check the Status of [Collaborative Editing](https://confluence.atlassian.com/doc/administering-collaborative-editing-858772086.html). Administration -\> Collaborative Editing
  * You can try disabling Collaborative Editing and check if you are able to work on pages again afterwards. Note that you may lose drafts.

From the symptoms I assume there is something wrong with Collaborative Editing / Synchrony. If this is the case: Either you are using a (reverse)proxy and the settings on side of the proxy or Confluence are not correct or WebSockets are disabled on your webserver.

Cheers  
Niklas
Notification for search term in restricted spaces/pages
Asked by Arndt Fuchs:

Hi everyone,

is there a possibility in Confluence wiki to receive a notification if a search term was found in a page to which you have no access? The space name and a person to talk to for example.


Answers:
author: Suren Raj
body: Hi, Arndt.

<br />

I'm afraid confluence does not have a default feature that meets your request. You may consider the information at the below link:

* <https://www.atlassian.com/blog/archives/new-in-confluence-request-access-to-view-restricted-pages>

Cheers

comments: author: Arndt Fuchs
body: Thanks for your answer,

but with the way mentioned you still need somebody sharing knowledge with you. For me, it's more about finding knowledge by yourself and contacting the pages admin if no access is given.

Is this maybe possible with a tool or is it totally impossible with the Confluence system?


author: Nic Brough -Adaptavist-
body: It's rightly impossible, without code.

If a page is restricted from view, there's usually a good reason. If you could search hidden pages, you could extract potentially sensitive information from them surprisingly easily (this is effectively how the allies won the second world war - by searching Enigma encoded pages for things they suspected were in them, despite not being able to see them)
Excerpts and Table Filters
Asked by Shashank Jasra:

I am not able to see Table filter macro in my confluence.Please help.


Answers:
author: Alana Fernando
body: [@Shashank Jasra](/t5/user/viewprofilepage/user-id/1208243) ,

I suspect you confluence admins has disabled this plugin. contact your confluence admins and ask them whether they have disabled the macro.

If you are a confluence admin,

then click **cog wheel \> add-on \>search for table filter** and check whether the plugin is available in add-ons list.


author: Alana Fernando
body: hi [@Shashank Jasra](/t5/user/viewprofilepage/user-id/1208243), May I know below information?

1. can you see table filter macro in **+ \> Other macro \> table filter**?

![screenshot-confluence.millenniumit.com-2018.04.10-13-34-23.png](https://community.atlassian.com/t5/image/serverpage/image-id/19098i7A08A779655C4AEE/image-size/large?v=v2&px=999 "screenshot-confluence.millenniumit.com-2018.04.10-13-34-23.png")

if not you may want to contact your confluence admin regarding this. probably the plugin has been disabled or uninstalled.


author: Alana Fernando
body: You may ask your peers [@Shashank Jasra](/t5/user/viewprofilepage/user-id/1208243), your confluence admins are working in your office. sorry it is not possible to assist you on that.

comments: author: Shashank Jasra
body: Thanks :)


author: Shashank Jasra
body: How to contact confluence admins?


author: Shashank Jasra
body: No that is the problem I cant see this
How can i add more fields (assignee, due date) to jira highlight action in confluence
Asked by Mark Oliver Utz:

create Jira Issue in Confluence is great, but could get much greater for us with three more fields for the create issue sceen in confluence.

Does anyone know how to add jira system fields to that screen?

regards

Mark

![grafik.png](/t5/image/serverpage/image-id/19095iE8633487BFD4E572/image-size/large?v=v2&px=999 "grafik.png")![grafik.png](/t5/image/serverpage/image-id/19096iB1597E95AD8626D5/image-size/large?v=v2&px=999 "grafik.png")


Answers:
author: Suren Raj
body: Hi, Mark.

I understand that you would like to have more fields available while creating a JIRA ticket with highlighted text in Confluence.  

In regards to your request, we would like to inform you that there is a limitation with the features. We do have [suggestion request](https://jira.atlassian.com/browse/CONFSERVER-31867]) created for this feature and we've internally referenced this ticket in the suggestion ticket as well for the development team to review it.

We would strongly recommend you to vote and add yourself as a watcher of the suggestion ticket to receive updates. You may also feel free to add a comment in the suggestion ticket as well to provide your feedback. Please note that the suggestion ticket will be reviewed by our product master and decided to implement according to our[Implementation of New Features Policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

We hope the information provided help to clear your doubts.


Tags: jira