-boost::filesystem::path
-DCP::write_pkl (Standard standard, string pkl_uuid, XMLMetadata metadata, shared_ptr<const CertificateChain> signer) const
-{
- boost::filesystem::path p = _directory;
- p /= String::compose ("pkl_%1.xml", pkl_uuid);
-
- xmlpp::Document doc;
- xmlpp::Element* pkl;
- if (standard == INTEROP) {
- pkl = doc.create_root_node("PackingList", "http://www.digicine.com/PROTO-ASDCP-PKL-20040311#");
- } else {
- pkl = doc.create_root_node("PackingList", "http://www.smpte-ra.org/schemas/429-8/2007/PKL");
- }
-
- if (signer) {
- pkl->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "dsig");
- }
-
- pkl->add_child("Id")->add_child_text ("urn:uuid:" + pkl_uuid);
-
- /* XXX: this is a bit of a hack */
- DCP_ASSERT (cpls().size() > 0);
- pkl->add_child("AnnotationText")->add_child_text (cpls().front()->annotation_text ());
-
- pkl->add_child("IssueDate")->add_child_text (metadata.issue_date);
- pkl->add_child("Issuer")->add_child_text (metadata.issuer);
- pkl->add_child("Creator")->add_child_text (metadata.creator);
-
- xmlpp::Element* asset_list = pkl->add_child("AssetList");
- BOOST_FOREACH (shared_ptr<Asset> i, assets ()) {
- i->write_to_pkl (asset_list, _directory, standard);
- }
-
- if (signer) {
- signer->sign (pkl, standard);
- }
-
- doc.write_to_file (p.string (), "UTF-8");
- return p.string ();
-}
-