Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 4.96 KB

File metadata and controls

76 lines (53 loc) · 4.96 KB

Mizu build process

About

These @ernestkoe and @pgcorn's development notes for packing a custom theme as an FileMaker add-on package and then cleaning up the extraneous XML that's in them. This should be scripted eventually.

When FileMaker does a 'save as an add-on', it will generate a folder with XML files that tells FileMaker how to import and create the add-on. The primary file of interest is the template.xml file. Other things like data, language-specific labels are kept separately. The template.xml contains structure AND literal content (CDATA) which makes the file tricky to parse or collapse.

⚠️ Don't mess with the CDATA sections. It's a pain because it breaks folding but it's better to avoid inadvertently breaking the file.

Steps to build an add-on theme file

  1. Update the theme preview image
  2. Update the mizu_theme::__versionString calculation field in the theme file on foundations-dev
  3. Update the FMAddonTemplate_Version field on the __FMdAddonTemplate_Metadata layout
  4. Click the "Generate Add-on" button on the __FMdAddonTemplate_Metadata layout to save out the files in your FileMaker application Extensions/AddonModules folder, e.g. `/Users/ernestkoe/Library/Application Support/FileMaker/Extensions/AddonModules' folder (MacOS)
  5. Save the previous template.xml file in the previous folder for later
  6. Copy the generated proof_mizu_theme folder to the mizu project folder, and use a text editor to remove extraneous objects generated by FileMaker
  7. Run the build script when done.
  8. Test the add-on

Update the theme preview image

FileMaker saves an image of the layout that you were last on every time you save the saves to the theme globally.

Remove extraneous objects

Fix Portals layout

I use the compare feature in VSCode to detect and remove sections that are different.

There are two extra buttons in the Portal element, UUID: 47F1ED16-AADE-4EAA-9D1E-E47CDBED8664

UUIDs of the two extra button:

  1. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[11]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[1]/Portal[1]/ObjectList[1]/LayoutObject[7]
    1. Object UUID: 9CC3817A-1A42-4D53-ADF3-40F3F5E07A34
  2. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[11]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[1]/Portal[1]/ObjectList[1]/LayoutObject[6]
    1. Object UUID: B2B9D275-B032-411D-A8F6-C4E658BD6ABB

Change membercount attribute of Portal object to '5'

Fix Tabs layout

Locate the first SlidePanel panel, UUID: B2C37ECE-46F7-4805-84F3-00F525D45B36. This is SlidePanel should have 14 member elements. Instead, we have 17. The last three created are actual duplicates of the button bar buttons. We want to remove them.

  1. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[17]
    1. Object UUID: D778260F-FA1F-4269-93D0-622D64BA64B5
  2. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[16]
    1. Object UUID: 13C82E09-F6C7-4378-B3F2-74C04F6A0637
  3. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[10]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/SlideControl[1]/ObjectList[1]/LayoutObject[1]/SlidePanel[1]/ObjectList[1]/LayoutObject[14]
    1. Object UUID: 56F2A576-C993-423D-B68D-0C7D28D69D82

Set the membercount attribute of the B2C37ECE-46F7-4805-84F3-00F525D45B36 SlidePanel to 14

This should object and it's enclosing children buttons should all be sitting happily within a SlidePanel object. Do not delete these.

Fix List layout

  1. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[12]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/Portal[1]/ObjectList[1]/LayoutObject[4]
    1. Object UUID: 299056F3-2D15-46C5-AEC6-D2029846EE14
  2. XPath: /FMAdd_on/Structure[1]/AddAction[1]/LayoutCatalog[1]/Layout[12]/PartsList[1]/Part[1]/ObjectList[1]/LayoutObject[3]/Portal[1]/ObjectList[1]/LayoutObject[3]
    1. Object UUID: 786F6D8B-0F87-4F89-97B4-4C9046698698

Change portal membercount attribute from 5 to 3

Run the build script

This creates the xar .fmaddon archive with the contents of the proof_mizu_theme folder. From within the top level of the mizu project folder, do:

> source build.sh

Testing the build

  1. uninstall any existing instances of the mizu add-on
  2. delete the .fmaddon file and the proof_mizu_theme folder from the FileMaker/Extensions/AddonModules directory
  3. Install the new addon by double clicking the file
  4. Make a new FileMaker file and try adding the installed add-on to it
  5. Check to make sure there are no duplicated buttons on the Portal, List, or Tabs layouts.