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 String
DEFAULT_FILEEXT
Deprecated.static String
DefaultPackageFileName
Deprecated.static String
DefaultPluginName
Deprecated.static int
OK
Deprecated.static int
Right
Deprecated.static String
XAR_FILENAME_ENCODING
Deprecated.
-
Constructor Summary
Constructors Constructor Description Package()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
add(XWikiDocument doc, int defaultAction, XWikiContext context)
Deprecated.boolean
add(XWikiDocument doc, XWikiContext context)
Deprecated.boolean
add(String docFullName, int DefaultAction, XWikiContext context)
Deprecated.boolean
add(String docFullName, XWikiContext context)
Deprecated.boolean
add(String docFullName, String language, int DefaultAction, XWikiContext context)
Deprecated.boolean
add(String docFullName, String language, XWikiContext context)
Deprecated.void
addAllWikiDocuments(XWikiContext context)
Deprecated.void
addDocumentFilter(Object filter)
Deprecated.void
addToDir(XWikiDocument doc, File dir, boolean withVersions, XWikiContext context)
Deprecated.void
addToZip(XWikiDocument doc, ZipOutputStream zos, boolean withVersions, XWikiContext context)
Deprecated.since 4.1M2void
deleteAllWikiDocuments(XWikiContext context)
Deprecated.String
export(OutputStream os, XWikiContext context)
Deprecated.String
exportToDir(File dir, XWikiContext context)
Deprecated.void
filter(XWikiDocument doc, XWikiContext context)
Deprecated.protected org.dom4j.Document
fromXml(InputStream xml)
Deprecated.String
getAuthorName()
Deprecated.List<DocumentInfo>
getCustomMappingFiles()
Deprecated.String
getDescription()
Deprecated.String
getDirectoryForDocument(XWikiDocument doc)
Deprecated.Generate a relative path based on provided document for the directory where the document should be stored.protected String
getElementText(org.dom4j.Element docel, String name)
Deprecated.protected String
getElementText(org.dom4j.Element docel, String name, String def)
Deprecated.List<String>
getErrors(XWikiContext context)
Deprecated.String
getExtensionId()
Deprecated.String
getFileNameFromDocument(XWikiDocument doc, XWikiContext context)
Deprecated.Generate a file name based on provided document.List<DocumentInfo>
getFiles()
Deprecated.String
getId()
Deprecated.List<String>
getInstalled(XWikiContext context)
Deprecated.String
getLicence()
Deprecated.String
getName()
Deprecated.String
getPathFromDocument(XWikiDocument doc, XWikiContext context)
Deprecated.Generate a relative path based on provided document.List<String>
getSkipped(XWikiContext context)
Deprecated.int
getStatus(XWikiContext context)
Deprecated.String
getVersion()
Deprecated.boolean
hasBackupPackImportRights(XWikiContext context)
Deprecated.String
Import(byte[] file, XWikiContext context)
Deprecated.Load this package in memory from a byte array.String
Import(InputStream file, XWikiContext context)
Deprecated.Load this package in memory from an InputStream.int
install(XWikiContext context)
Deprecated.boolean
isBackupPack()
Deprecated.If true, the package will preserve the original author during import, rather than updating the author to the current (importing) user.boolean
isInstallExension()
Deprecated.since 6.4.5, 7.0.1, 7.1M1, useisInstallExtension()
insteadboolean
isInstallExtension()
Deprecated.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.boolean
isWithVersions()
Deprecated.String
readFromDir(File dir, XWikiContext context)
Deprecated.Load document files from provided directory and sub-directories into packager.int
readFromDir(File dir, XWikiContext context, org.dom4j.Document description)
Deprecated.Load document files from provided directory and sub-directories into packager.void
setAuthorName(String authorName)
Deprecated.void
setBackupPack(boolean backupPack)
Deprecated.void
setDescription(String description)
Deprecated.void
setExtensionId(String extensionId)
Deprecated.void
setId(String id)
Deprecated.void
setInstallExension(boolean installExension)
Deprecated.since 6.4.5, 7.0.1, 7.1M1, usesetInstallExension(boolean)
insteadvoid
setInstallExtension(boolean installExtension)
Deprecated.void
setLicence(String licence)
Deprecated.void
setName(String name)
Deprecated.void
setPreserveVersion(boolean preserveVersion)
Deprecated.void
setVersion(String version)
Deprecated.void
setWithVersions(boolean withVersions)
Deprecated.If set to true, history revisions in the archive will be imported when importing documents.int
testInstall(boolean isAdmin, XWikiContext context)
Deprecated.net.sf.json.JSONObject
toJSON(XWikiContext wikiContext)
Deprecated.Outputs the content of this package in the JSON formatString
toXml(XWikiContext context)
Deprecated.You should prefertoXML(com.xpn.xwiki.internal.xml.XMLWriter)
.void
toXML(com.xpn.xwiki.internal.xml.XMLWriter wr)
Deprecated.Write the package.xml file to anXMLWriter
.void
toXML(OutputStream out, XWikiContext context)
Deprecated.Write the package.xml file to an OutputStreamboolean
updateDoc(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:
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, usesetInstallExension(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.
-
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:
IOException
XWikiException
-
exportToDir
public String exportToDir(File dir, XWikiContext context) throws IOException, XWikiException
Deprecated.- Throws:
IOException
XWikiException
-
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 IOException
Deprecated.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
-
-