Storage Format Differences between Connect and Forge

Hi,

I am in the process of migrating a Connect Confluence macro to Forge, and was hoping to use the Minor version updates (Connect to Forge) (Preview) migration option. However, the storage formats for the Connect app and the Forge app look very different.

The forge manifest.yaml is as follows:

modules:
  macro:
    - key: visio-publisher-for-confluence
      resource: main
      resolver:
        function: resolver
      title: Visio Publisher for Confluence (VP4C)
      description: Visio Publisher for Confluence (VP4C) lets you publish your Visio
        drawinga natively to Confluence
      icon: https://crecy.com.au/img/vp4c/VP4C-small.png
      config: true

The existing Connect app configuration (https://vp4c.crecy.com.au/atlassian-connect.json) is as follows (preliminary only):

{
  "key": "visio-publisher-for-confluence",
  "baseUrl": "https://vp4c.crecy.com.au",
  "name": "Visio Publisher for Confluence",
  "description": "Allows Model Gen Visio VSTO add-in to publish natively to Confluence Cloud",
  "vendor": {
    "name": "Crecy Poitiers Agincourt Solutions",
    "url": "https://crecy.com.au"
  },

However, when I compare the storage format from Connect to Forge versions of the macro, there appear to be vast differences

CONNECT

<ac:structured-macro ac:name="excerpt" ac:schema-version="1" data-layout="full-width" ac:local-id="2bf4bdf3-cf7a-4ed7-adc3-6ad1fc0a0849" ac:macro-id="a056ed2b-b4b6-42e4-8474-bd2af5f69270">
	<ac:rich-text-body>
		<ac:structured-macro ac:name="visio-publisher-for-confluence" ac:schema-version="1" data-layout="full-width" ac:local-id="aec241b5-d1a3-4e10-a5ab-57b4529e1341" ac:macro-id="d22f62f3130f12697d53fa7f4ab1da3f75e2d3bd257b67185127ab47bd83c378">
			<ac:parameter ac:name="scrolling">no</ac:parameter>
			<ac:parameter ac:name="compressedSize">135343</ac:parameter>
			<ac:parameter ac:name="checksum">a2a214e01ea47b77da24fdd5f10cd34c24fe120fe56cd3b6b89d9f8db4bf8f54</ac:parameter>
			<ac:parameter ac:name="uncompressedSize">470568</ac:parameter>
			<ac:parameter ac:name="html">Network Security</ac:parameter>
			<ac:parameter ac:name="frameborder">show</ac:parameter>
			<ac:parameter ac:name="attachmentId">att18612288</ac:parameter>
			<ac:parameter ac:name="version">2</ac:parameter>
			<ac:parameter ac:name="height">1000</ac:parameter>
		</ac:structured-macro>
	</ac:rich-text-body>
</ac:structured-macro>

FORGE

<ac:structured-macro ac:name="excerpt" ac:schema-version="1" data-layout="default" ac:local-id="91d4cfec-5677-458c-bfb2-7c5106264918" ac:macro-id="ad605a60f3f00f65aea2b59f3cce5cb847a5439e69649202c5ef0106f5a40aa3">
	<ac:parameter ac:name="name">Periodic Table</ac:parameter>
	<ac:rich-text-body>
		<ac:adf-extension>
			<ac:adf-node type="extension">
				<ac:adf-attribute key="extension-key">99d7ade8-3d58-42f8-9c2c-0b4baf0550c9/bbb38430-a861-4517-9a6f-ecb57b8ef2c4/static/visio-publisher-for-confluence</ac:adf-attribute>
				<ac:adf-attribute key="extension-type">com.atlassian.ecosystem</ac:adf-attribute>
				<ac:adf-attribute key="parameters">
					<ac:adf-parameter key="local-id">a40a6dc5-a73d-4576-aac9-7d397a4e065d</ac:adf-parameter>
					<ac:adf-parameter key="extension-id">ari:cloud:ecosystem::extension/99d7ade8-3d58-42f8-9c2c-0b4baf0550c9/bbb38430-a861-4517-9a6f-ecb57b8ef2c4/static/visio-publisher-for-confluence</ac:adf-parameter>
					<ac:adf-parameter key="extension-title">Visio Publisher for Confluence (VP4C) (Development)</ac:adf-parameter>
					<ac:adf-parameter key="guest-params">
						<ac:adf-parameter key="attachment-id">2</ac:adf-parameter>
						<ac:adf-parameter key="html">Periodic Table</ac:adf-parameter>
						<ac:adf-parameter key="version">3</ac:adf-parameter>
						<ac:adf-parameter key="width">99%</ac:adf-parameter>
						<ac:adf-parameter key="height">1200</ac:adf-parameter>
						<ac:adf-parameter key="scrolling">no</ac:adf-parameter>
						<ac:adf-parameter key="frameborder">show</ac:adf-parameter>
						<ac:adf-parameter key="checksum" />
						<ac:adf-parameter key="compressed-size" />
						<ac:adf-parameter key="uncompressed-size" /></ac:adf-parameter>
				</ac:adf-attribute>
				<ac:adf-attribute key="text">Visio Publisher for Confluence (VP4C) (Development)</ac:adf-attribute>
				<ac:adf-attribute key="layout">default</ac:adf-attribute>
				<ac:adf-attribute key="local-id">a40a6dc5-a73d-4576-aac9-7d397a4e065d</ac:adf-attribute>
			</ac:adf-node>
			<ac:adf-fallback>
				<ac:adf-node type="extension">
					<ac:adf-attribute key="extension-key">99d7ade8-3d58-42f8-9c2c-0b4baf0550c9/bbb38430-a861-4517-9a6f-ecb57b8ef2c4/static/visio-publisher-for-confluence</ac:adf-attribute>
					<ac:adf-attribute key="extension-type">com.atlassian.ecosystem</ac:adf-attribute>
					<ac:adf-attribute key="parameters">
						<ac:adf-parameter key="local-id">a40a6dc5-a73d-4576-aac9-7d397a4e065d</ac:adf-parameter>
						<ac:adf-parameter key="extension-id">ari:cloud:ecosystem::extension/99d7ade8-3d58-42f8-9c2c-0b4baf0550c9/bbb38430-a861-4517-9a6f-ecb57b8ef2c4/static/visio-publisher-for-confluence</ac:adf-parameter>
						<ac:adf-parameter key="extension-title">Visio Publisher for Confluence (VP4C) (Development)</ac:adf-parameter>
						<ac:adf-parameter key="guest-params">
							<ac:adf-parameter key="attachment-id">2</ac:adf-parameter>
							<ac:adf-parameter key="html">Periodic Table</ac:adf-parameter>
							<ac:adf-parameter key="version">3</ac:adf-parameter>
							<ac:adf-parameter key="width">99%</ac:adf-parameter>
							<ac:adf-parameter key="height">1200</ac:adf-parameter>
							<ac:adf-parameter key="scrolling">no</ac:adf-parameter>
							<ac:adf-parameter key="frameborder">show</ac:adf-parameter>
							<ac:adf-parameter key="checksum" />
							<ac:adf-parameter key="compressed-size" />
							<ac:adf-parameter key="uncompressed-size" /></ac:adf-parameter>
					</ac:adf-attribute>
					<ac:adf-attribute key="text">Visio Publisher for Confluence (VP4C) (Development)</ac:adf-attribute>
					<ac:adf-attribute key="layout">default</ac:adf-attribute>
					<ac:adf-attribute key="local-id">a40a6dc5-a73d-4576-aac9-7d397a4e065d</ac:adf-attribute>
				</ac:adf-node>
			</ac:adf-fallback>
		</ac:adf-extension>
	</ac:rich-text-body>
</ac:structured-macro>

My macro is typically added to a new page using Confluence API i.e. not manually authored by a logged in user.

It is unclear to me how an existing Confluence page using the Connect macro will seamlessly upgrade.

Thanks and regards,
Andrew

Hi Andrew,

Post seamless upgrade, the storage format of any existing connect macro will only be migrated to the Forge storage format once a user edits the macro’s configuration as mentioned here. And all newly created macros will adopt the new Forge storage format.

Hope this helps!

2 Likes

Thanks @SerenaWang - I tested this out, and it doesn’t seem to work as the link that you shared has described. I had some space pages with the macro using the old Connect storage format and the Forge macro installed via the forge install -e production CLI.

However, when loading the page I was getting an error. It only works when I replace the old Connect macro with the new Forge macro. With the existing storage format:

<ac:structured-macro ac:name="excerpt" ac:schema-version="1" data-layout="default" ac:macro-id="a056ed2b-b4b6-42e4-8474-bd2af5f69270">
	<ac:rich-text-body>
		<ac:structured-macro ac:name="visio-publisher-for-confluence" ac:schema-version="1" data-layout="full-width" ac:macro-id="13f09d3f-45ea-45d2-a1e9-02a3188ed78b">
			<ac:parameter ac:name="scrolling">no</ac:parameter>
			<ac:parameter ac:name="compressedSize">10047</ac:parameter>
			<ac:parameter ac:name="width">100%</ac:parameter>
			<ac:parameter ac:name="checksum">06743c0babe9b9d12e70cd7688d788babd3594a97b45985f468d8804c07b4caf</ac:parameter>
			<ac:parameter ac:name="uncompressedSize">50814</ac:parameter>
			<ac:parameter ac:name="frameborder">show</ac:parameter>
			<ac:parameter ac:name="html">Push Pull Event Exchange Solution</ac:parameter>
			<ac:parameter ac:name="attachmentId">att206766170</ac:parameter>
			<ac:parameter ac:name="version">2</ac:parameter>
			<ac:parameter ac:name="height">1500</ac:parameter>
		</ac:structured-macro>
	</ac:rich-text-body>
</ac:structured-macro>

I get the following error when using the Connect storage format with the Faorge macro:

extension-handlers.tsx:70  Error rendering extension Error: Extension with type "com.atlassian.confluence.macro.core" and key "visio-publisher-for-confluence" not found!

The forge maifest.yaml has a module macro definition aligned with the Connect macro (https://vp4c.crecy.com.au/atlassian-connect.json):

modules:
  macro:
    - key: visio-publisher-for-confluence
      resource: main
      resolver:
        function: resolver
      title: Visio Publisher for Confluence (VP4C)
      description: Visio Publisher for Confluence (VP4C) lets you publish your Visio drawings natively to Confluence using the Model Gen for Visio (MG4V) Addin
      icon: https://crecy.com.au/img/vp4c/VP4C-small.png
      config: true
  function:
    - key: resolver
      handler: index.handler

Any further thoughts would be gratefully received

Thanks to @SeanBourke I have resolved this. The manifest.yaml needs to include an app.connext.key per the following partial extract:

app:
  runtime:
    name: nodejs22.x
  id: ari:cloud:ecosystem::app/<appId>
  name: <Name>
  connect:
    key: <connect key>
  licensing:
    enabled: true 
1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.