Question
· Sep 29, 2017

Export macro in "Export for production"

Hi all,

Acording to the post How to Export and Import Ensemble Components and Productions we can create a unique file to implement and deploy a production, but I'm not able to export and import macro file in the process.

I've been looking for how to implement the macro file in this process but I haven't found anything.

is it possible to export and deploy the macro file in the "Export from Production"?

Best regards,

Francisco Lopez

Discussion (7)1
Log in or sign up to continue

Hi again.... I've found a solution for this issue and it works.

  • Create the deploy file from "Export from production". In this example, the file name is "Export-Common_Production.xml"
  • Export the INC file from Systems - Routines. In this example, the file name is Export.xml
  • Open the deploy file (Export-Common_Production.xml) . Look at the begin of the code
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26">
<Class name="Common.Produccion">
<Super>Ens.Production</Super>
<TimeChanged>64397,40010.817022</TimeChanged>
<TimeCreated>64329,41160.632132</TimeCreated>

<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false">
  <Description></Description>
  <ActorPoolSize>2</ActorPoolSize>
</Production>
]]></Data>
</XData>
</Class>
  • Copy the content of Export.xml, only the <Routine> node
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 12:11:54">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[

#include %occErrors
#include %ZEN.Utils

#define GetData(%x) $get(%request.Data(%x,1))
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>
</Export>
  • Paste it at the begin of Deploy file
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[

#include %occErrors
#include %ZEN.Utils

/// GetData: Recoge el valor de un parámetro de una petición Request
#define GetData(%x) $get(%request.Data(%x,1))
/// Header: REcupera el contenido de la cabecera
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
/// Lower: Convierte en minúscula el texto indicado
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>

<Class name="Common.Produccion">
<Super>Ens.Production</Super>
<TimeChanged>64397,40010.817022</TimeChanged>
<TimeCreated>64329,41160.632132</TimeCreated>

<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false">
  <Description></Description>
  <ActorPoolSize>2</ActorPoolSize>
</Production>
]]></Data>
</XData>
</Class>
  • Search down the node  <Project> and include the INC file
<Project name="EnsExportProduction_2017-09-04 08-20-12_724+2" LastModified="2017-09-29 08:24:26.599088">
  <ProjectDescription><![CDATA[Studio Project generated from Ensemble Production &apos;Common.Produccion&apos; at 2017-09-04 06:20:12.724 UTC]]></ProjectDescription>
  <Items>
    <ProjectItem name="Common.Common" type="INC"></ProjectItem>
    <ProjectItem name="Common.Utils.Encriptar" type="CLS"></ProjectItem>
    <ProjectItem name="Common.Utils.JSON" type="CLS"></ProjectItem>
    <ProjectItem name="Common.Utils.Utilidades" type="CLS"></ProjectItem>
    <ProjectItem name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD" type="PTD"></ProjectItem>
  </Items>
</Project>
  • Search down the node <Document> and add the first file the INC and reorder the numbers of item
<Document name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD"><ProjectTextDocument name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2" description="Export Notes for export EnsExportProduction_2017-09-04 08-20-12_724+2">
<![CDATA[<Deployment>
<Creation>
<Machine>MYSERVER</Machine>
<Instance>HEALTHSHARE</Instance>
<Namespace>COMMON</Namespace>
<SourceProduction>Common.Produccion</SourceProduction>
<Username>_SYSTEM</Username>
<UTC>2017-09-29 06:24:26.597</UTC>
</Creation>
<Notes>
</Notes>
<Contents>
<ExportProject>EnsExportProduction_2017-09-04 08-20-12_724+2</ExportProject>
<Item num="1">Common.Common.INC</Item>
<Item num="2">Common.Produccion.CLS</Item>
<Item num="3">Common.Utils.Encriptar.CLS</Item>
<Item num="4">Common.Utils.JSON.CLS</Item>
<Item num="5">Common.Utils.Utilidades.CLS</Item>
</Contents>
<ProductionClassInExport>Common.Produccion</ProductionClassInExport>
</Deployment>

]]></ProjectTextDocument>
</Document>

Now you can deploy the production with the INC file without problem

There is a problem with this process, if you need to re-export the production, you'll lose the INC file and you need to paste it again

I hope this solution will work for someone else.

Best regards,

Francisco Lopez