NAME

WWW::SFDC::Manifest - Utility functions for Salesforce Metadata API interactions.

VERSION

version 0.36

SYNOPSIS

This module is used to read SFDC manifests from disk, add files to them, and get a structure suitable for passing into WWW::SFDC::Metadata functions.

    my $SFDC = WWW::SFDC->new(...);
    my $Manifest = WWW::SFDC::Manifest
        ->new(constants => $SFDC->Constants)
        ->readFromFile("filename")
        ->addList()
        ->add({Document => ["bar/foo.png"]});

    my $HashRef = $Manifest->manifest();
    my $XMLString = $Manifest->getXML();

ATTRIBUTES

apiVersion

This apiVersion will be written to the manifest .xml file - defaults to 34. Beware that the API version specified in a manifest file overrides the API version specified in the endpoint URL.

constants

A WWW::SFDC::Constants object. If you're working with a session, you'll need to pass in the constants from the session. If you're trying to work offline, you'll need to create a new Constants object explicitly.

isDeletions

If set, the manifest will be constructed slightly differently: when you add a file inside a folder, such as src/email/myfolder/mytemplate.email, normally the manifest will include both the folder and the template. However, when deleting, the folder will not be included unless the -meta file is explicitly specified, i.e. src/email/myfolder-meta.xml. This is because deleting the folder will delete all members of that folder, and that's not normally the desired effect.

manifest

The underlying hash for the Manifest object. This hashref can be passed into a call to retrieve(), and a WWW::SFDC::Manifest can also be created with this prepopulated, if you already know what it should contain.

This hashref will look like

  {
    classes => [
      'myclass',
      ...
    ],
    email => [
      'myfolder',
      'myfolder/mytemplate',
      ...
    ]
    ...
  }

METHODS

getFileList(@list)

Returns a list of files needed to deploy this manifest. Use this to construct a .zip file.

add($manifest)

Adds an existing manifest object or hash to this one.

addList($isDeletion, @list)

Adds a list of components or file paths to the manifest file.

readFromFile $location

Reads a salesforce package manifest and adds it to the current object, then returns it.

writeToFile $location

Writes the manifest's XML representation to the given file and returns the manifest object.

getXML($mapref)

Returns the XML representation for this manifest.

BUGS

Please report any bugs or feature requests at https://github.com/sophos/WWW-SFDC/issues.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::SFDC::Manifest

You can also look for information at https://github.com/sophos/WWW-SFDC

AUTHOR

Alexander Brett <alexander.brett@sophos.com> http://alexander-brett.co.uk

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Sophos Limited https://www.sophos.com/.

This is free software, licensed under:

  The MIT (X11) License

The full text of the license can be found in the LICENSE file included with this distribution.