Package com.xpn.xwiki.plugin.packaging
Class Package
- java.lang.Object
-
- com.xpn.xwiki.plugin.packaging.Package
-
@Deprecated public class Package extends Object
Deprecated.since 5.2, use Filter framework instead- Version:
- $Id: 1f9a393f21d70937888eab6336528d27958d779a $
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_FILEEXTDeprecated.static StringDefaultPackageFileNameDeprecated.static StringDefaultPluginNameDeprecated.static intOKDeprecated.static intRightDeprecated.static StringXAR_FILENAME_ENCODINGDeprecated.
-
Constructor Summary
Constructors Constructor Description Package()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(XWikiDocument doc, int defaultAction, XWikiContext context)Deprecated.booleanadd(XWikiDocument doc, XWikiContext context)Deprecated.booleanadd(String docFullName, int DefaultAction, XWikiContext context)Deprecated.booleanadd(String docFullName, XWikiContext context)Deprecated.booleanadd(String docFullName, String language, int DefaultAction, XWikiContext context)Deprecated.booleanadd(String docFullName, String language, XWikiContext context)Deprecated.voidaddAllWikiDocuments(XWikiContext context)Deprecated.voidaddDocumentFilter(Object filter)Deprecated.voidaddToDir(XWikiDocument doc, File dir, boolean withVersions, XWikiContext context)Deprecated.voidaddToZip(XWikiDocument doc, ZipOutputStream zos, boolean withVersions, XWikiContext context)Deprecated.since 4.1M2voiddeleteAllWikiDocuments(XWikiContext context)Deprecated.Stringexport(OutputStream os, XWikiContext context)Deprecated.StringexportToDir(File dir, XWikiContext context)Deprecated.voidfilter(XWikiDocument doc, XWikiContext context)Deprecated.protected org.dom4j.DocumentfromXml(InputStream xml)Deprecated.StringgetAuthorName()Deprecated.List<DocumentInfo>getCustomMappingFiles()Deprecated.StringgetDescription()Deprecated.StringgetDirectoryForDocument(XWikiDocument doc)Deprecated.Generate a relative path based on provided document for the directory where the document should be stored.protected StringgetElementText(org.dom4j.Element docel, String name)Deprecated.protected StringgetElementText(org.dom4j.Element docel, String name, String def)Deprecated.List<String>getErrors(XWikiContext context)Deprecated.StringgetExtensionId()Deprecated.StringgetFileNameFromDocument(XWikiDocument doc, XWikiContext context)Deprecated.Generate a file name based on provided document.List<DocumentInfo>getFiles()Deprecated.StringgetId()Deprecated.List<String>getInstalled(XWikiContext context)Deprecated.StringgetLicence()Deprecated.StringgetName()Deprecated.StringgetPathFromDocument(XWikiDocument doc, XWikiContext context)Deprecated.Generate a relative path based on provided document.List<String>getSkipped(XWikiContext context)Deprecated.intgetStatus(XWikiContext context)Deprecated.StringgetVersion()Deprecated.booleanhasBackupPackImportRights(XWikiContext context)Deprecated.StringImport(byte[] file, XWikiContext context)Deprecated.Load this package in memory from a byte array.StringImport(InputStream file, XWikiContext context)Deprecated.Load this package in memory from an InputStream.intinstall(XWikiContext context)Deprecated.booleanisBackupPack()Deprecated.If true, the package will preserve the original author during import, rather than updating the author to the current (importing) user.booleanisInstallExension()Deprecated.since 6.4.5, 7.0.1, 7.1M1, useisInstallExtension()insteadbooleanisInstallExtension()Deprecated.booleanisVersionPreserved()Deprecated.If true, the package will preserve the current document version during import, regardless of whether or not the document history is included.booleanisWithVersions()Deprecated.StringreadFromDir(File dir, XWikiContext context)Deprecated.Load document files from provided directory and sub-directories into packager.intreadFromDir(File dir, XWikiContext context, org.dom4j.Document description)Deprecated.Load document files from provided directory and sub-directories into packager.voidsetAuthorName(String authorName)Deprecated.voidsetBackupPack(boolean backupPack)Deprecated.voidsetDescription(String description)Deprecated.voidsetExtensionId(String extensionId)Deprecated.voidsetId(String id)Deprecated.voidsetInstallExension(boolean installExension)Deprecated.since 6.4.5, 7.0.1, 7.1M1, usesetInstallExension(boolean)insteadvoidsetInstallExtension(boolean installExtension)Deprecated.voidsetLicence(String licence)Deprecated.voidsetName(String name)Deprecated.voidsetPreserveVersion(boolean preserveVersion)Deprecated.voidsetVersion(String version)Deprecated.voidsetWithVersions(boolean withVersions)Deprecated.If set to true, history revisions in the archive will be imported when importing documents.inttestInstall(boolean isAdmin, XWikiContext context)Deprecated.net.sf.json.JSONObjecttoJSON(XWikiContext wikiContext)Deprecated.Outputs the content of this package in the JSON formatStringtoXml(XWikiContext context)Deprecated.You should prefertoXML(com.xpn.xwiki.internal.xml.XMLWriter).voidtoXML(com.xpn.xwiki.internal.xml.XMLWriter wr)Deprecated.Write the package.xml file to anXMLWriter.voidtoXML(OutputStream out, XWikiContext context)Deprecated.Write the package.xml file to an OutputStreambooleanupdateDoc(String docFullName, int action, XWikiContext context)Deprecated.
-
-
-
Field Detail
-
OK
public static final int OK
Deprecated.- See Also:
- Constant Field Values
-
Right
public static final int Right
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_FILEEXT
public static final String DEFAULT_FILEEXT
Deprecated.- See Also:
- Constant Field Values
-
XAR_FILENAME_ENCODING
public static final String XAR_FILENAME_ENCODING
Deprecated.- See Also:
- Constant Field Values
-
DefaultPackageFileName
public static final String DefaultPackageFileName
Deprecated.- See Also:
- Constant Field Values
-
DefaultPluginName
public static final String DefaultPluginName
Deprecated.- See Also:
- Constant Field Values
-
-
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, useisInstallExtension()instead- Returns:
trueif the extension packaged in the XAR should be registered as such automatically,falseotherwise.
-
isInstallExtension
public boolean isInstallExtension()
Deprecated.- Returns:
trueif the extension packaged in the XAR should be registered as such automatically,falseotherwise.- 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, usesetInstallExension(boolean)instead- Parameters:
installExension-trueif the extension packaged in the XAR should be registered as such automatically,falseotherwise.
-
setInstallExtension
public void setInstallExtension(boolean installExtension)
Deprecated.- Parameters:
installExtension-trueif the extension packaged in the XAR should be registered as such automatically,falseotherwise.- 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.
-
getFiles
public List<DocumentInfo> getFiles()
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.
-
addDocumentFilter
public void addDocumentFilter(Object filter) throws PackageException
Deprecated.- Throws:
PackageException
-
add
public boolean add(XWikiDocument doc, int defaultAction, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
add
public boolean add(XWikiDocument doc, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
updateDoc
public boolean updateDoc(String docFullName, int action, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
add
public boolean add(String docFullName, int DefaultAction, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
add
public boolean add(String docFullName, String language, int DefaultAction, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
add
public boolean add(String docFullName, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
add
public boolean add(String docFullName, String language, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
filter
public void filter(XWikiDocument doc, XWikiContext context) throws ExcludeDocumentException
Deprecated.- Throws:
ExcludeDocumentException
-
export
public String export(OutputStream os, XWikiContext context) throws IOException, XWikiException
Deprecated.- Throws:
IOExceptionXWikiException
-
exportToDir
public String exportToDir(File dir, XWikiContext context) throws IOException, XWikiException
Deprecated.- Throws:
IOExceptionXWikiException
-
Import
public String Import(byte[] file, XWikiContext context) throws IOException, XWikiException
Deprecated.Load this package in memory from a byte array. It may be installed later usinginstall(XWikiContext). Your should preferImport(InputStream, XWikiContext)which may avoid loading the package twice in memory.- Parameters:
file- a byte array containing the content of a zipped package filecontext- current XWikiContext- Returns:
- an empty string, useless.
- Throws:
IOException- while reading the ZipFileXWikiException- when package content is broken
-
Import
public String Import(InputStream file, XWikiContext context) throws IOException, XWikiException
Deprecated.Load this package in memory from an InputStream. It may be installed later usinginstall(XWikiContext).- Parameters:
file- an InputStream of a zipped package filecontext- current XWikiContext- Returns:
- an empty string, useless.
- Throws:
IOException- while reading the ZipFileXWikiException- when package content is broken- Since:
- 2.3M2
-
testInstall
public int testInstall(boolean isAdmin, XWikiContext context)Deprecated.
-
install
public int install(XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
getErrors
public List<String> getErrors(XWikiContext context)
Deprecated.
-
getSkipped
public List<String> getSkipped(XWikiContext context)
Deprecated.
-
getInstalled
public List<String> getInstalled(XWikiContext context)
Deprecated.
-
getStatus
public int getStatus(XWikiContext context)
Deprecated.
-
toXml
public String toXml(XWikiContext context)
Deprecated.You should prefertoXML(com.xpn.xwiki.internal.xml.XMLWriter). If an error occurs, a stacktrace is dump to logs, and an empty String is returned.- Returns:
- a package.xml file for the this package
-
toXML
public void toXML(com.xpn.xwiki.internal.xml.XMLWriter wr) throws IOExceptionDeprecated.Write the package.xml file to anXMLWriter.- 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 tocontext- 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.1M2Write an XML serialized XWikiDocument to a ZipOutputStream- Parameters:
doc- the document to serializezos- the ZipOutputStream to write towithVersions- if true, also serialize all document versionscontext- current XWikiContext- Throws:
XWikiException- when an error occurs during documents accessIOException- when an error occurs during streaming operation
-
addToDir
public void addToDir(XWikiDocument doc, File dir, boolean withVersions, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
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
-
addAllWikiDocuments
public void addAllWikiDocuments(XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
deleteAllWikiDocuments
public void deleteAllWikiDocuments(XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
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
-
-