Adds the xml file node which define the package meta-data.
325633
def build_wxsfile_header_section(root, spec):
    
    # Create the needed DOM nodes and add them at the correct position in the tree.
    factory = Document()
    Product = factory.createElement( 'Product' )
    Package = factory.createElement( 'Package' )

    root.childNodes.append( Product )
    Product.childNodes.append( Package )

    # set "mandatory" default values
    if 'X_MSI_LANGUAGE' not in spec:
        spec['X_MSI_LANGUAGE'] = '1033' # select english

    # mandatory sections, will throw a KeyError if the tag is not available
    Product.attributes['Name']         = escape( spec['NAME'] )
    Product.attributes['Version']      = escape( spec['VERSION'] )
    Product.attributes['Manufacturer'] = escape( spec['VENDOR'] )
    Product.attributes['Language']     = escape( spec['X_MSI_LANGUAGE'] )
    Package.attributes['Description']  = escape( spec['SUMMARY'] )

    # now the optional tags, for which we avoid the KeyErrror exception
    if 'DESCRIPTION' in spec:
        Package.attributes['Comments'] = escape( spec['DESCRIPTION'] )

    if 'X_MSI_UPGRADE_CODE' in spec:
        Package.attributes['X_MSI_UPGRADE_CODE'] = escape( spec['X_MSI_UPGRADE_CODE'] )

    # We hardcode the media tag as our current model cannot handle it.
    Media = factory.createElement('Media')
    Media.attributes['Id']       = '1'
    Media.attributes['Cabinet']  = 'default.cab'
    Media.attributes['EmbedCab'] = 'yes'
    root.getElementsByTagName('Product')[0].childNodes.append(Media)
443342
public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
        PackageDoc[] packages = configuration.profilePackages.get(profile.name);
        for (int i = 0; i < packages.length; i++) {
            this.pkg = packages[i];
            Content packageSummaryContentTree = profileWriter.getPackageSummaryHeader(this.pkg);
            buildChildren(node, packageSummaryContentTree);
            summaryContentTree.addContent(profileWriter.getPackageSummaryTree(
                    packageSummaryContentTree));
        }
    }
54750
protected void addDescription(PackageElement pkg, Content dlTree, SearchIndexItem si) {
        Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
        if (configuration.showModules) {
            si.setContainingModule(utils.getFullyQualifiedName(utils.containingModule(pkg)));
        }
        si.setLabel(utils.getPackageName(pkg));
        si.setCategory(resources.getText("doclet.Packages"));
        Content dt = HtmlTree.DT(link);
        dt.addContent(" - ");
        dt.addContent(contents.package_);
        dt.addContent(" " + utils.getPackageName(pkg));
        dlTree.addContent(dt);
        Content dd = new HtmlTree(HtmlTag.DD);
        addSummaryComment(pkg, dd);
        dlTree.addContent(dd);
    }
838463
public void addNode(int n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    this.addElement(n);
  }
1362217
private void addZealotXmlInContext() {
        for (String xmlPath: xmlPaths) {
            String nameSpace = XmlNodeHelper.getZealotXmlNameSpace(xmlPath);
            if (StringHelper.isNotBlank(nameSpace)) {
                XmlContext.INSTANCE.add(nameSpace, xmlPath);
            }
        }
    }
1047993
public T addMetaTag(String key, String value) {
    checkValidKey(key);
    checkNotEmpty(value, "value must not be empty");
    meta_tags.add("-metadata");
    meta_tags.add(key + "=" + value);
    return getThis();
  }
458763
protected void addPackageList(Content contentTree) throws IOException {
        Content caption = getTableCaption(configuration.getResource(
                "doclet.ClassUse_Packages.that.use.0",
                getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc))));
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        Iterator<PackageDoc> it = pkgSet.iterator();
        for (int i = 0; it.hasNext(); i++) {
            PackageDoc pkg = it.next();
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
            if (i % 2 == 0) {
                tr.addStyle(HtmlStyle.altColor);
            } else {
                tr.addStyle(HtmlStyle.rowColor);
            }
            addPackageUse(pkg, tr);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
        contentTree.addContent(li);
    }
1282723
def add_node(namespace_inc_global, body, opts = {})
      data, _status_code, _headers = add_node_with_http_info(namespace_inc_global, body, opts)
      return data
    end
1119799
public void add(String name, TiffObject value, String path, String schema) {
    if (!metadata.containsKey(name)) {
      metadata.put(name, new MetadataObject());
    }
    metadata.get(name).getObjectList().add(value);
    metadata.get(name).setPath(path);
    metadata.get(name).setSchema(schema);
  }
1314514
@Override
    public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException {
        if(notNull(baseURI)) {
            getClient().sendAdd(file, baseURI, dataFormat, contexts);
        }else{
            getClient().sendAdd(file, file.toURI().toString(), dataFormat, contexts);
        }
    }
222328
protected void addAdditionalFilesToBook(final BuildData buildData) throws BuildProcessingException {
        final FileProvider fileProvider = providerFactory.getProvider(FileProvider.class);
        final ContentSpec contentSpec = buildData.getContentSpec();

        if (contentSpec.getFiles() != null) {
            log.info("\tDownloading Additional Files");

            for (final org.jboss.pressgang.ccms.contentspec.File file : contentSpec.getFiles()) {
                try {
                    final FileWrapper fileEntity = fileProvider.getFile(file.getId(), file.getRevision());

                    // Find the file that matches this locale. If the locale isn't found then use the default locale
                    LanguageFileWrapper languageFileFile = null;
                    if (fileEntity.getLanguageFiles() != null && fileEntity.getLanguageFiles().getItems() != null) {
                        final List<LanguageFileWrapper> languageFiles = fileEntity.getLanguageFiles().getItems();
                        for (final LanguageFileWrapper languageFile : languageFiles) {
                            if (languageFile.getLocale().getValue().equals(buildData.getBuildLocale())) {
                                languageFileFile = languageFile;
                            } else if (languageFile.getLocale().getValue().equals(buildData.getDefaultLocale()) && languageFileFile == null) {
                                languageFileFile = languageFile;
                            }
                        }
                    }

                    if (languageFileFile != null && languageFileFile.getFileData() != null) {
                        // Determine the file path
                        final String filePath;
                        if (!isNullOrEmpty(fileEntity.getFilePath())) {
                            if (fileEntity.getFilePath().endsWith("/") || fileEntity.getFilePath().endsWith("\\")) {
                                filePath = fileEntity.getFilePath();
                            } else {
                                filePath = fileEntity.getFilePath() + "/";
                            }
                        } else {
                            filePath = "";
                        }

                        // Explode the ZIP archive if requested
                        if (fileEntity.isExplodeArchive()) {
                            try {
                                final Map<String, byte[]> files = ZipUtilities.unzipFile(languageFileFile.getFileData(), false);
                                for (final Entry<String, byte[]> entry : files.entrySet()) {
                                    addToZip(buildData.getBookFilesFolder() + filePath + entry.getKey(), entry.getValue(), buildData);
                                }
                            } catch (IOException e) {
                                throw new BuildProcessingException(e);
                            }
                        } else {
                            addToZip(buildData.getBookFilesFolder() + filePath + fileEntity.getFilename(), languageFileFile.getFileData(),
                                    buildData);
                        }
                    } else {
                        throw new BuildProcessingException("File ID " + fileEntity.getId() + " has no language files!");
                    }
                } catch (NotFoundException e) {
                    throw new BuildProcessingException("File ID " + file.getId() + " could not be found!");
                }
            }
        }
    }
160407
public void append(SimpleTypeInformation<?> meta, Object data) {
    this.meta.add(meta);
    this.contents.add(data);
  }
213582
<T extends INode> T addNode(String path, T newNode) throws FileNotFoundException {
    return addNode(path, newNode, false);
  }
779642
public void addMetadata(Metadata meta) {
    for (String k : meta.keySet()) {
      for (TiffObject to : meta.getList(k)) {
        add(k, to, meta.getMetadataObject(k).isDublinCore(), meta.getMetadataObject(k).getPath());
      }
    }
  }
984867
protected void addPackageTreeLinks(Content contentTree) {
        //Do nothing if only unnamed package is used
        if (isUnnamedPackage()) {
            return;
        }
        if (!classesOnly) {
            Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
                    contents.packageHierarchies);
            contentTree.addContent(span);
            HtmlTree ul = new HtmlTree(HtmlTag.UL);
            ul.addStyle(HtmlStyle.horizontal);
            int i = 0;
            for (PackageElement pkg : packages) {
                // If the package name length is 0 or if -nodeprecated option
                // is set and the package is marked as deprecated, do not include
                // the page in the list of package hierarchies.
                if (pkg.isUnnamed() ||
                        (configuration.nodeprecated && utils.isDeprecated(pkg))) {
                    i++;
                    continue;
                }
                DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
                Content li = HtmlTree.LI(getHyperLink(link,
                        new StringContent(utils.getPackageName(pkg))));
                if (i < packages.size() - 1) {
                    li.addContent(", ");
                }
                ul.addContent(li);
                i++;
            }
            contentTree.addContent(ul);
        }
    }
1329998
private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception
    {
        getLog().info(String.format("Generating package.xml descriptor at [%s]", packageFile.getPath()));

        OutputFormat outputFormat = new OutputFormat("", true);
        outputFormat.setEncoding(this.encoding);
        OutputStream out = new FileOutputStream(packageFile);
        XMLWriter writer = new XMLWriter(out, outputFormat);
        writer.write(toXML(files));
        writer.close();
        out.close();
    }
797052
public function add_metadata_file(cc_i_metadata_file $met, $identifier, $filename) {

        if (empty($met) || empty($identifier) || empty($filename)) {
            throw new Exception('Try to add a metadata file with nulls values given!');
        }

        $metanode = $this->node("//imscc:resource".
            "[@identifier='".
            $identifier.
            "']/imscc:file".
            "[@href='".
            $filename.
            "']");

        $nspaces = $this->activemanifest->get_cc_namespaces();
        $dnode   = $this->doc->createElementNS($nspaces['imscc'], "metadata");

        $metanode->appendChild($dnode);

        $this->activemanifest->create_metadata_file_node($met, $this->doc, $dnode);
    }