- list<KDMKey> keys = kdm.keys ();
- list<shared_ptr<CPL> > cpl = cpls ();
-
- for (list<shared_ptr<CPL> >::iterator i = cpl.begin(); i != cpl.end(); ++i) {
- for (list<KDMKey>::iterator j = keys.begin(); j != keys.end(); ++j) {
- if (j->cpl_id() == (*i)->id()) {
- (*i)->add (kdm);
- }
- }
- }
-}
-
-boost::filesystem::path
-DCP::write_pkl (Standard standard, string pkl_uuid, XMLMetadata metadata, shared_ptr<const Signer> signer) const
-{
- boost::filesystem::path p = _directory;
- stringstream s;
- s << pkl_uuid << "_pkl.xml";
- p /= s.str();
-
- 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 */
- 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");
- for (list<shared_ptr<Asset> >::const_iterator i = _assets.begin(); i != _assets.end(); ++i) {
- (*i)->write_to_pkl (asset_list);
- }