Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Setting UserInformation via SOAP, how to format ?

AIS Team May 21, 2015

Hello,

I want to set the UserInformation via SOAP, using setUserInformation together with an RemoteUserInformation Object. The text is posted, but the newlines ({{\n}}) are converted to &lt;br/&gt; and all is surrounded by &lt;p&gt;. That's why the htmltags are shown in the browser. I tried several ways of posting, including escaping the \n or writing htmltags for breaklines. But nothing helped. And I still wonder why there is an additional <p> around the text (I noticed it's been added when manually editing the UserInformation).

I've found some infos about a html macro but though it might be a solution for this problem, it must not be enabled for the whole wiki.

I am sure I am just missing any trick to solve my problem, but what is the trick ?

Thanks for any help!

Greetings,

Daniela

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Deleted user May 22, 2015

The SOAP API is deprecated. Atlassian suggests we use their REST API. See https://developer.atlassian.com/confdev/confluence-rest-api

Deprecated since Confluence 5.5. This means that we will not add new features or fix bugs related to the XML-RPC and SOAP API for Confluence 5.5 or later

If their REST API doesn't provide a service to update the user info, then I would create my own REST service and use the JAVA API to update the user info.

 

AIS Team May 25, 2015

I do know that SOAP is deprecated but I do have to use it at the moment. If my problem is a bug, then I do understand that it will not be fixed. But is it a bug ? The new REST API does not support any user options at the moment as far as I can see. So I know there will be a problem in future. What do you mean with using JAVA API ? Doing changes on confluences DB directly or hooking into the code of confluence ? Or something else ? Thanks in advance for clarifying.

0 votes
AIS Team May 25, 2015

This code:

String template = "Automatically updated:\n"                            
+ "Name: " +  user.name + "\n"
+ "Mail: " + user.mail + "\n"
+ "Phone:" + user.phone

should be:

Automatically updated:
Name: Smith
Mail: smith@nomail.tld
Phone: 000 / 00000

but it is:

<p>Automatically updated:<br/>
 Name: Smith<br/>
 Mail: smith@nomail.tld<br/>
 Phone:000 / 00000</p>

 and in sourcecode of HTML

<p>&lt;p&gt;Automatically updated:&lt;br/&gt;<br/>
Name: Smith&lt;br/&gt;<br/>
Mail: smith@nomail.tld&lt;br/&gt;<br/>
Phone:000 / 00000&lt;/p&gt;</p>

 

I tried several variations in {{String template = ... }} including using HTML-Tags but no luck so far.

Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2015

I may be misunderstanding what you are doing, but it looks to me like you should be using a structure not a string for the user information object. See https://developer.atlassian.com/confdev/confluence-rest-api/confluence-xml-rpc-and-soap-apis/remote-confluence-data-objects#RemoteConfluenceDataObjects-userinformationUserInformation .

AIS Team May 26, 2015

No, it's a string build up in Java. The "\n" are new lines which should be put into. The {{user}} is an object which holds the userdata but e.g. {{user.mail}} gives back strings also. All written in one line would look like: {{String template = "Automatically updated:\n Name: " + user.name + "\n Mail: " + user.mail + "\n Phone:" + user.phone}}

0 votes
Jonathan Simonoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2015

Can you share your code?  I'm having trouble understanding where ({{\n}}) would come in with a user information object.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events