Code macro formates everything (header) in Fixed-width font and there's no frame around the code

lenawener November 16, 2017

If I use the code macro the frame around it does not show up and everything is formatted in Fixed-width font. It has nothig to do with the expanding text. If it is expandes it is still like this. I have mor than one code makro on the page and the first one is formatted properly. 

(Confluence 5.6.6)

This is how is looks like:

code.PNG

This is how it should look like:

code2.PNG

 

 

2 answers

0 votes
lenawener November 20, 2017

Thank you. I have edited all the macros in the same way with the editor. 


This is the code and the last one of it does not work:

 

<ac:layout>
<ac:layout-section ac:type="two_right_sidebar">
<ac:layout-cell>
<p>
<strong style="color: rgb(0,0,0);">Ziel</strong>
</p>
<p>
<span style="color: rgb(0,0,0);">mediacockpit ist für die Verwendung mit den Datenbanksystemen Oracle 10g (oder höher), MSSQL 2005 (oder höher) und MySQL 5.x freigegeben. Um die Verbindung zur Datenbank herzustellen, müssen einige Parameter in der im Verzeichnis <em>[mediacockpit-Installationsverzeichnis]/&lt;Mandaten-Verzeichnis/server/jboss-eap-6.0.1/standalone/deployments</em> zu findenden Datei <em>mc-ds.xml</em> definiert werden. Hier werden die Details zur Datenbankverbindung definiert. Folgende Parameter müssen mindestens für eine erfolgreiche Verbindung angegeben werden:</span>
</p>
<p>
<span style="color: rgb(0,0,0);">
<br/>
</span>
</p>
<ac:structured-macro ac:name="expand">
<ac:parameter ac:name="title">Oracle</ac:parameter>
<ac:rich-text-body>
<p>Hier sehen Sie eine beispielhafte mc-ds.xml für eine Verbindung zu einer Oracle-Datenbank mit anschließender Erläuterung der entscheidenden Parameter:</p>
<ac:structured-macro ac:name="code">
<ac:plain-text-body><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">

<datasource jndi-name="java:/mcDS" pool-name="ORACLE">
<connection-url>jdbc:oracle:thin:@//localhost:1521/mc_db</connection-url>
<driver>ojdbc</driver>
<security>
<user-name>mc</user-name>
<password>mc</password>
</security>
<pool>
<!-- default is 0 -->
<min-pool-size>5</min-pool-size>
<!-- default is 20 -->
<max-pool-size>50</max-pool-size>
</pool>
<validation>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker" />
<stale-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker" />
<exception-sorter
class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter" />
</validation>
</datasource>

</datasources>]]></ac:plain-text-body>
</ac:structured-macro>
<p>Folgende der im Beispiel genannten Parameter sind zwingend auf Ihre Systemumgebung anzupassen: </p>
<p>
<strong>connection-url</strong>: Geben Sie hier die exakte JDBC-URL der gewünschten Datenbank an. <br/>
<strong>user-name</strong>: Geben Sie den Datenbankuser an, mit dem mediacockpit auf die Datenbank zugreifen soll. Sorgen Sie bitte dafür, dass dieser User Lese- und Schreibrechte für die Datenbank hat. <br/>
<strong>password</strong>: Geben Sie hier das Password des mediacockpit-Datenbankusers an.</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:name="expand">
<ac:parameter ac:name="title">MSSQL</ac:parameter>
<ac:rich-text-body>
<p> Hier sehen Sie eine beispielhafte <em>mc-ds.xml</em> für eine Verbindung zu einer MSSQL-Datenbank mit folgender Erläuterung der einzelnen Parameter:</p>
<ac:structured-macro ac:name="code">
<ac:plain-text-body><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">

<datasource jndi-name="java:/mcDS" pool-name="MSSQL">
<connection-url>jdbc:jtds:sqlserver://localhost:1433/mc_db;charset=UTF-8</connection-url>
<driver>jtds</driver>
<security>
<user-name>mc</user-name>
<password>mc</password>
</security>
<pool>
<!-- default is 0 -->
<min-pool-size>5</min-pool-size>
<!-- default is 20 -->
<max-pool-size>50</max-pool-size>
</pool>
<validation>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker" />
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>true</background-validation>
<background-validation-millis>10000</background-validation-millis>
</validation>
</datasource>

</datasources>]]></ac:plain-text-body>
</ac:structured-macro>
<p>Es sind die gleichen Parameter wie für die oben beschriebene Oracle-Verbindung anzupassen. Beachten Sie, dass nach der Connection-URL noch der weitere Parameter <em>charset=UTF-8</em>, per Semikolon separiert, anzufügen ist.</p>
<p>Der Parameter <code>prepareSQL</code>=0 von JTDS darf nur in Kombination mit bestimmten Locales auf dem MS-SQL-Server genutzt werden. Bei Verwendung vieler Locales werden Tage mit Monaten bei Datumswerten vertauscht. Siehe hierzu: <a class="external-link" href="http://sourceforge.net/p/jtds/bugs/532/" rel="nofollow">http://sourceforge.net/p/jtds/bugs/532/</a>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<div>
<div class="syntaxhighlighter nogutter html">
<ac:structured-macro ac:name="expand">
<ac:parameter ac:name="title">MySQL</ac:parameter>
<ac:rich-text-body>
<p>Hier sehen Sie eine beispielhafte mc-ds.xml für eine Verbindung zu einer MySQL-Datenbank:</p>
<ac:structured-macro ac:name="code">
<ac:plain-text-body><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">

<datasource jndi-name="java:/mcDS" pool-name="MYSQL">
<connection-url>jdbc:mysql://localhost:3306/mc_db?characterEncoding=utf8</connection-url>
<driver>mysql</driver>
<security>
<user-name>mc</user-name>
<password>mc</password>
</security>
<pool>
<!-- default is 0 -->
<min-pool-size>5</min-pool-size>
<!-- default is 20 -->
<max-pool-size>50</max-pool-size>
</pool>
<validation>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.novendor.JDBC4ValidConnectionChecker" />
<exception-sorter
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter" />
</validation>
</datasource>

</datasources>]]></ac:plain-text-body>
</ac:structured-macro>
<p>
<span>Änderungen an der Datenbank-Konfiguration werden erst nach einem Neustart von mediacockpit übernommen.</span>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p> </p>
<p> </p>
</div>
</div>
</ac:layout-cell>
<ac:layout-cell>
<ac:structured-macro ac:name="panel">
<ac:parameter ac:name="titleBGColor">#343D46</ac:parameter>
<ac:parameter ac:name="title">siehe auch</ac:parameter>
<ac:parameter ac:name="borderStyle">solid</ac:parameter>
<ac:parameter ac:name="borderColor">#343D46</ac:parameter>
<ac:parameter ac:name="titleColor">white</ac:parameter>
<ac:rich-text-body>
<p>
<ac:placeholder ac:type="jira">Verlinkungen zu verwandten Themen </ac:placeholder>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:layout-cell>
</ac:layout-section>
</ac:layout>

0 votes
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 17, 2017

I understand you have more than one code macro on a page, and some are not displaying as expected.

Please let me know:

  • Were the macros that work added in the same way as the ones that don't? (Were they all added by using the Confluence editor and inserting the macro or were some pasted from elsewhere or added by another method?)

Unless there is something confidential on the page, please post the storage format into a code block on this thread. The storage format is on the page tools menu under View Storage Format.

Using the Confluence Source Editor, I can use the storage format to reproduce your page on a test instance, and possibly see what the difference is between the macros that work and those that don't.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events