An issue with creating backup packages

Avatar

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
d-wnuk
Level 2

06-03-2018

Hi,

I'm trying to set the backup workflows up using the following document:
https://docs.campaign.adobe.com/doc/AC/en/technicalResources/Technotes/AdobeCampaign_How_to_export_p...

https://docs.campaign.adobe.com/doc/AC/en/technicalResources/Technotes/AdobeCampaign_How_to_export_p...

However, I have stuck on the step when I have to generate the packages from specification. First, I determined the query:

var query = xtk.queryDef.create(

  <queryDef operation="select" schema="nms:delivery">

    <select>

      <node expr="@label"/>

      <node expr="@internalName"/>

    </select>

    <where>

      <condition boolOperator="OR" expr="@id != 0"/>

    </where>

  </queryDef>

)

var res = query.ExecuteQuery()

Then, I initialize the empty array and push all @label nodes there. Ultimately I want to include all attributes in the package but as for now it would be good to start from small steps.

Finally, I try to generate package:

var specFile = xtk.specFile.create(deliveryArray)

var package = specFile.GenerateDoc()

But I get the error message that says:

'JavaScript: cannot convert the value to an XML document.

Function 'create', arugment 0: cannot convert argument to an XML document.'

I also tried a different approach with assigning package specification to a variable and then passing it to specfile.create method but the output was the same.

Thanks in advance for any advices.

Best regards,

Dominik

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile
Amit_Kumar
MVP

06-03-2018

Hi Dominik,

You are not following the instruction correctly.

  • create a package definition in your instance.
  • Add required content to this package definition in your instance.
  • write the required query as mentioned in the document to get the list of package from package definition i.e. from the specFile schema.

var query = xtk.queryDef.create(

<queryDef schema="xtk:specFile" operation="select">

<select>

<node expr="@name"/>

<node expr="@namespace"/>

<node expr="data"/>

</select>;

</queryDef>

)

var specFileXML = query.ExecuteQuery()

  • add a condition in this query to select required packages.
  • Use below script to generate xml docs to export the package.

var specFile = xtk.specFile.create(specfileXml)

var package = specFile.GenerateDoc()

  • The package XML needs to be saved to a file.
  • The file must have the <?xml> header.
  • The saveXmlFile function writes the contents to a file in XML format.

var fileName = "/tmp/myPackage.xml"

saveXmlFile(package, fileName)

Regards,

Amit

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 2
ankurm40172185
Level 2

Likes

15 likes

Total Posts

23 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
ankurm40172185
Level 2

Likes

15 likes

Total Posts

23 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
ankurm40172185
Level 2

26-04-2018

HI Amit

I have a question on this; where can i access the saved file; what would be the path? I'd like to download and ftp that.

Avatar

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
d-wnuk
Level 2

12-03-2018

Hi Amit,

Thanks for the listing all steps, the process is clear for me now!

Best regards,

Dominik

Avatar

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
d-wnuk
Level 2

Likes

3 likes

Total Posts

16 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
d-wnuk
Level 2

12-03-2018

​dsa