Class Package


  • @Deprecated
    public class Package
    extends Object
    Deprecated.
    since 5.2, use Filter framework instead
    Version:
    $Id: 1f9a393f21d70937888eab6336528d27958d779a $
    • Constructor Detail

      • Package

        public Package()
        Deprecated.
    • Method Detail

      • getName

        public String getName()
        Deprecated.
      • setName

        public void setName​(String name)
        Deprecated.
      • getDescription

        public String getDescription()
        Deprecated.
      • setDescription

        public void setDescription​(String description)
        Deprecated.
      • getId

        public String getId()
        Deprecated.
      • setId

        public void setId​(String id)
        Deprecated.
      • isInstallExension

        @Deprecated
        public boolean isInstallExension()
        Deprecated.
        since 6.4.5, 7.0.1, 7.1M1, use isInstallExtension() instead
        Returns:
        true if the extension packaged in the XAR should be registered as such automatically, false otherwise.
      • isInstallExtension

        public boolean isInstallExtension()
        Deprecated.
        Returns:
        true if the extension packaged in the XAR should be registered as such automatically, false otherwise.
        Since:
        6.4.5, 7.0.1, 7.1M1
      • setInstallExension

        @Deprecated
        public void setInstallExension​(boolean installExension)
        Deprecated.
        since 6.4.5, 7.0.1, 7.1M1, use setInstallExension(boolean) instead
        Parameters:
        installExension - true if the extension packaged in the XAR should be registered as such automatically, false otherwise.
      • setInstallExtension

        public void setInstallExtension​(boolean installExtension)
        Deprecated.
        Parameters:
        installExtension - true if the extension packaged in the XAR should be registered as such automatically, false otherwise.
        Since:
        6.4.5, 7.0.1, 7.1M1
      • getExtensionId

        public String getExtensionId()
        Deprecated.
      • setExtensionId

        public void setExtensionId​(String extensionId)
        Deprecated.
      • getVersion

        public String getVersion()
        Deprecated.
      • setVersion

        public void setVersion​(String version)
        Deprecated.
      • getLicence

        public String getLicence()
        Deprecated.
      • setLicence

        public void setLicence​(String licence)
        Deprecated.
      • getAuthorName

        public String getAuthorName()
        Deprecated.
      • setAuthorName

        public void setAuthorName​(String authorName)
        Deprecated.
      • isBackupPack

        public boolean isBackupPack()
        Deprecated.
        If true, the package will preserve the original author during import, rather than updating the author to the current (importing) user.
        See Also:
        isWithVersions(), isVersionPreserved()
      • setBackupPack

        public void setBackupPack​(boolean backupPack)
        Deprecated.
      • hasBackupPackImportRights

        public boolean hasBackupPackImportRights​(XWikiContext context)
        Deprecated.
      • isVersionPreserved

        public boolean isVersionPreserved()
        Deprecated.
        If true, the package will preserve the current document version during import, regardless of whether or not the document history is included.
        See Also:
        isWithVersions(), isBackupPack()
      • setPreserveVersion

        public void setPreserveVersion​(boolean preserveVersion)
        Deprecated.
      • getCustomMappingFiles

        public List<DocumentInfo> getCustomMappingFiles()
        Deprecated.
      • isWithVersions

        public boolean isWithVersions()
        Deprecated.
      • setWithVersions

        public void setWithVersions​(boolean withVersions)
        Deprecated.
        If set to true, history revisions in the archive will be imported when importing documents.
      • testInstall

        public int testInstall​(boolean isAdmin,
                               XWikiContext context)
        Deprecated.
      • getStatus

        public int getStatus​(XWikiContext context)
        Deprecated.
      • toXML

        public void toXML​(com.xpn.xwiki.internal.xml.XMLWriter wr)
                   throws IOException
        Deprecated.
        Write the package.xml file to an XMLWriter.
        Parameters:
        wr - the writer to write to
        Throws:
        IOException - when an error occurs during streaming operation
        Since:
        2.3M2
      • toXML

        public void toXML​(OutputStream out,
                          XWikiContext context)
                   throws IOException
        Deprecated.
        Write the package.xml file to an OutputStream
        Parameters:
        out - the OutputStream to write to
        context - curent XWikiContext
        Throws:
        IOException - when an error occurs during streaming operation
        Since:
        2.3M2
      • getPathFromDocument

        public String getPathFromDocument​(XWikiDocument doc,
                                          XWikiContext context)
        Deprecated.
        Generate a relative path based on provided document.
        Parameters:
        doc - the document to export.
        Returns:
        the corresponding path.
      • getFileNameFromDocument

        public String getFileNameFromDocument​(XWikiDocument doc,
                                              XWikiContext context)
        Deprecated.
        Generate a file name based on provided document.
        Parameters:
        doc - the document to export.
        Returns:
        the corresponding file name.
      • getDirectoryForDocument

        public String getDirectoryForDocument​(XWikiDocument doc)
        Deprecated.
        Generate a relative path based on provided document for the directory where the document should be stored.
        Parameters:
        doc - the document to export
        Returns:
        the corresponding path
      • addToZip

        @Deprecated
        public void addToZip​(XWikiDocument doc,
                             ZipOutputStream zos,
                             boolean withVersions,
                             XWikiContext context)
                      throws XWikiException,
                             IOException
        Deprecated.
        since 4.1M2
        Write an XML serialized XWikiDocument to a ZipOutputStream
        Parameters:
        doc - the document to serialize
        zos - the ZipOutputStream to write to
        withVersions - if true, also serialize all document versions
        context - current XWikiContext
        Throws:
        XWikiException - when an error occurs during documents access
        IOException - when an error occurs during streaming operation
      • getElementText

        protected String getElementText​(org.dom4j.Element docel,
                                        String name)
        Deprecated.
      • getElementText

        protected String getElementText​(org.dom4j.Element docel,
                                        String name,
                                        String def)
        Deprecated.
      • fromXml

        protected org.dom4j.Document fromXml​(InputStream xml)
                                      throws org.dom4j.DocumentException
        Deprecated.
        Throws:
        org.dom4j.DocumentException
      • readFromDir

        public int readFromDir​(File dir,
                               XWikiContext context,
                               org.dom4j.Document description)
                        throws IOException,
                               XWikiException
        Deprecated.
        Load document files from provided directory and sub-directories into packager.
        Parameters:
        dir - the directory from where to load documents.
        context - the XWiki context.
        description - the package descriptor.
        Returns:
        the number of loaded documents.
        Throws:
        IOException - error when loading documents.
        XWikiException - error when loading documents.
      • readFromDir

        public String readFromDir​(File dir,
                                  XWikiContext context)
                           throws IOException,
                                  XWikiException
        Deprecated.
        Load document files from provided directory and sub-directories into packager.
        Parameters:
        dir - the directory from where to load documents.
        context - the XWiki context.
        Returns:
        Throws:
        IOException - error when loading documents.
        XWikiException - error when loading documents.
      • toJSON

        public net.sf.json.JSONObject toJSON​(XWikiContext wikiContext)
        Deprecated.
        Outputs the content of this package in the JSON format
        Parameters:
        wikiContext - the XWiki context
        Returns:
        a representation of this package under the JSON format
        Since:
        2.2M1