<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Eliot,</p>
    <p>So we have the API:</p>
    <p>
      <blockquote type="cite">PluginWorkspaceProvider.getPluginWorkspace().importGlobalOptions(optionsFile);</blockquote>
      You could call it twice, once with the location of the plugin's
      options.xml and once maybe with another location of an options.xml
      containing code templates.</p>
    <p>Maybe load a project specific XML options file every time a new
      project is opened:</p>
    <p>
      <blockquote type="cite">    @Override<br>
            public void applicationStarted(StandalonePluginWorkspace
        pluginWorkspaceAccess) {<br>
             
        pluginWorkspaceAccess.getProjectManager().addProjectChangeListener(new
        ProjectChangeListener() {<br>
                <br>
                @Override<br>
                public void projectChanged(URL oldProjectURL, URL
        newProjectURL) {<br>
                  File projectSpecificOptions = new File(new
        URL(newProjectURL, "options/options.xml").toURI());<br>
                  if(projectSpecificOptions != null) {<br>
                   
        pluginWorkspaceAccess.importGlobalOptions(projectSpecificOptions);<br>
                  }<br>
                }<br>
              });<br>
            }</blockquote>
      <br>
    </p>
    <p>Regards,</p>
    <p>Radu</p>
    <pre class="moz-signature" cols="72">Radu Coravu
Oxygen XML Editor</pre>
    <div class="moz-cite-prefix">On 12/8/21 17:08, Eliot Kimber wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:SN4PR0801MB77576C129EC637BEFE90DD52F16F9@SN4PR0801MB7757.namprd08.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}div.WordSection1
        {page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal">I may have a ready solution in that we have
          a add-on that serves to set options and that add-on is of
          course run on start up. Rather than having the code templates
          baked into the add-on’s options.xml I think it should be
          possible to import code templates from another location—I’ll
          dig into the API docs but if somebody has the necessary
          invocation at hand that would be helpful.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Eliot<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <div>
              <p class="MsoNormal" style="margin-bottom:7.5pt"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#6D6D6D">_____________________________________________</span><span
                  style="color:black"><o:p></o:p></span></p>
              <p class="MsoNormal"><b><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#474747">Eliot
                    Kimber</span></b><span style="color:black"><o:p></o:p></span></p>
              <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">Sr
                  Staff Content Engineer</span><span style="color:black"><o:p></o:p></span></p>
              <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">O:
                  512 554 9368</span><span style="color:black"><o:p></o:p></span></p>
              <p class="MsoNormal" style="margin-bottom:3.0pt"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">M:
                  512 554 9368</span><span style="color:black"><o:p></o:p></span></p>
              <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F"><a
                    href="https://www.servicenow.com"
                    title="https://www.servicenow.com/"
                    moz-do-not-send="true"><span style="color:#7F7F7F">servicenow.com</span></a></span><span
                  style="color:black"><o:p></o:p></span></p>
            </div>
          </div>
        </div>
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F"><a
              href="https://www.linkedin.com/company/servicenow"
              title="https://www.linkedin.com/company/servicenow"
              moz-do-not-send="true"><span style="color:#7F7F7F">LinkedIn</span></a> | <a
              href="https://twitter.com/servicenow"
              title="https://twitter.com/servicenow"
              moz-do-not-send="true"><span style="color:#7F7F7F">Twitter</span></a> | <a
              href="https://www.youtube.com/user/servicenowinc"
              title="https://www.youtube.com/user/servicenowinc"
              moz-do-not-send="true"><span style="color:#7F7F7F">YouTube</span></a> | <a
              href="https://www.facebook.com/servicenow"
              title="https://www.facebook.com/servicenow"
              moz-do-not-send="true"><span style="color:#7F7F7F">Facebook</span></a></span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                style="font-size:12.0pt;color:black">From:
              </span></b><span style="font-size:12.0pt;color:black">oXygen-user
              <a class="moz-txt-link-rfc2396E" href="mailto:oxygen-user-bounces@oxygenxml.com"><oxygen-user-bounces@oxygenxml.com></a> on behalf of
              Oxygen XML Editor Support (Radu Coravu)
              <a class="moz-txt-link-rfc2396E" href="mailto:support@oxygenxml.com"><support@oxygenxml.com></a><br>
              <b>Date: </b>Tuesday, December 7, 2021 at 11:32 PM<br>
              <b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:oxygen-user@oxygenxml.com">oxygen-user@oxygenxml.com</a>
              <a class="moz-txt-link-rfc2396E" href="mailto:oxygen-user@oxygenxml.com"><oxygen-user@oxygenxml.com></a><br>
              <b>Subject: </b>Re: [oXygen-user] Possible to Put Code
              Templates in a Framework?<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"
            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span
                style="font-size:14.0pt;color:black;background:yellow">[External
                Email]</span></b><o:p></o:p></p>
          <p class="MsoNormal"
            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span
                style="font-size:13.0pt"> </span></b><o:p></o:p></p>
        </div>
        <div>
          <p>Hi Eliot,<o:p></o:p></p>
          <p>For now you cannot save code templates at framework level.
            We have an internal issue registered for this and I added
            your contact details to it, adding the issue ID below for
            future reference:<o:p></o:p></p>
          <p>    EXM-36264 Code templates at framework level<o:p></o:p></p>
          <p>In the meantime maybe you can create custom Author actions
            but they will work only in the Author visual editing mode.<o:p></o:p></p>
          <p>Or maybe you can store the code templates at project level
            and have a project.xpr saved in the Git project that
            everybody needs to open in Oxygen before editing.<o:p></o:p></p>
          <p>Regards,<o:p></o:p></p>
          <p>Radu<o:p></o:p></p>
          <pre>Radu Coravu<o:p></o:p></pre>
          <pre>Oxygen XML Editor<o:p></o:p></pre>
          <div>
            <p class="MsoNormal">On 12/8/21 00:38, Eliot Kimber wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">We maintain a set of code templates
              that currently get bake into options.xml that is then
              distributed via an add-on that sets global options (and
              nothing else).<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">We maintain our frameworks in git and
              all authors clone that repo and pull regularly to keep it
              up to date, making deployment and update easier for
              writers (avoids having to update add-ons and then restart
              Oxygen).<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Reviewing the docs I see that code
              templates are stored in either the global options or in
              project options but I didn’t see anything about putting
              them in frameworks.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Is there a way to have code templates
              in frameworks so that we can deploy new ones without
              having to update our add-on?<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Thanks,<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">E.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <div>
              <div>
                <p class="MsoNormal" style="margin-bottom:7.5pt"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#6D6D6D">_____________________________________________</span><o:p></o:p></p>
                <p class="MsoNormal"><b><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#474747">Eliot
                      Kimber</span></b><o:p></o:p></p>
                <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">Sr
                    Staff Content Engineer</span><o:p></o:p></p>
                <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">O:
                    512 554 9368</span><o:p></o:p></p>
                <p class="MsoNormal" style="margin-bottom:3.0pt"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">M:
                    512 554 9368</span><o:p></o:p></p>
                <p class="MsoNormal"><a
                    href="https://www.servicenow.com"
                    title="https://www.servicenow.com/"
                    moz-do-not-send="true"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">servicenow.com</span></a><o:p></o:p></p>
              </div>
            </div>
            <p class="MsoNormal"><a
href="https://urldefense.com/v3/__https:/www.linkedin.com/company/servicenow__;!!N4vogdjhuJM!TwGoo-UgX_UOAI6BVcwwLYM9_MsaRyuT6Qx1ohw4LJLspJ8XuQM4EvFhB2SQwPvkQonkug$"
                title="https://www.linkedin.com/company/servicenow"
                moz-do-not-send="true"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">LinkedIn</span></a><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F"> | </span><a
href="https://urldefense.com/v3/__https:/twitter.com/servicenow__;!!N4vogdjhuJM!TwGoo-UgX_UOAI6BVcwwLYM9_MsaRyuT6Qx1ohw4LJLspJ8XuQM4EvFhB2SQwPtaz6Gvxg$"
                title="https://twitter.com/servicenow"
                moz-do-not-send="true"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">Twitter</span></a><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F"> | </span><a
href="https://urldefense.com/v3/__https:/www.youtube.com/user/servicenowinc__;!!N4vogdjhuJM!TwGoo-UgX_UOAI6BVcwwLYM9_MsaRyuT6Qx1ohw4LJLspJ8XuQM4EvFhB2SQwPvTtDoB5A$"
                title="https://www.youtube.com/user/servicenowinc"
                moz-do-not-send="true"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">YouTube</span></a><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F"> | </span><a
href="https://urldefense.com/v3/__https:/www.facebook.com/servicenow__;!!N4vogdjhuJM!TwGoo-UgX_UOAI6BVcwwLYM9_MsaRyuT6Qx1ohw4LJLspJ8XuQM4EvFhB2SQwPs8BMYr3Q$"
                title="https://www.facebook.com/servicenow"
                moz-do-not-send="true"><span
style="font-size:9.0pt;font-family:"Arial",sans-serif;color:#7F7F7F">Facebook</span></a><o:p></o:p></p>
            <p class="MsoNormal"><br>
              <br>
              <o:p></o:p></p>
            <pre>_______________________________________________<o:p></o:p></pre>
            <pre>oXygen-user mailing list<o:p></o:p></pre>
            <pre><a href="mailto:oXygen-user@oxygenxml.com" moz-do-not-send="true" class="moz-txt-link-freetext">oXygen-user@oxygenxml.com</a><o:p></o:p></pre>
            <pre><a href="https://urldefense.com/v3/__https:/www.oxygenxml.com/mailman/listinfo/oxygen-user__;!!N4vogdjhuJM!TwGoo-UgX_UOAI6BVcwwLYM9_MsaRyuT6Qx1ohw4LJLspJ8XuQM4EvFhB2SQwPv87ymuCw$" moz-do-not-send="true">https://www.oxygenxml.com/mailman/listinfo/oxygen-user</a><o:p></o:p></pre>
          </blockquote>
          <pre><o:p> </o:p></pre>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
oXygen-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a>
<a class="moz-txt-link-freetext" href="https://www.oxygenxml.com/mailman/listinfo/oxygen-user">https://www.oxygenxml.com/mailman/listinfo/oxygen-user</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>