@Deprecated public class Package extends Object
Modifier and Type | Field and 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 and Description |
---|
Package()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String docFullName,
int DefaultAction,
XWikiContext context)
Deprecated.
|
boolean |
add(String docFullName,
String language,
int DefaultAction,
XWikiContext context)
Deprecated.
|
boolean |
add(String docFullName,
String language,
XWikiContext context)
Deprecated.
|
boolean |
add(String docFullName,
XWikiContext context)
Deprecated.
|
boolean |
add(XWikiDocument doc,
int defaultAction,
XWikiContext context)
Deprecated.
|
boolean |
add(XWikiDocument doc,
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.1M2
|
void |
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, use
isInstallExtension() instead |
boolean |
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, use
setInstallExension(boolean) instead |
void |
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 format
|
void |
toXML(OutputStream out,
XWikiContext context)
Deprecated.
Write the package.xml file to an OutputStream
|
void |
toXML(com.xpn.xwiki.internal.xml.XMLWriter wr)
Deprecated.
Write the package.xml file to an
XMLWriter . |
String |
toXml(XWikiContext context)
Deprecated.
You should prefer
toXML(com.xpn.xwiki.internal.xml.XMLWriter) . |
boolean |
updateDoc(String docFullName,
int action,
XWikiContext context)
Deprecated.
|
public static final int OK
public static final int Right
public static final String DEFAULT_FILEEXT
public static final String XAR_FILENAME_ENCODING
public static final String DefaultPackageFileName
public static final String DefaultPluginName
public String getName()
public void setName(String name)
public String getDescription()
public void setDescription(String description)
public String getId()
public void setId(String id)
@Deprecated public boolean isInstallExension()
isInstallExtension()
insteadtrue
if the extension packaged in the XAR should be registered as such automatically,
false
otherwise.public boolean isInstallExtension()
true
if the extension packaged in the XAR should be registered as such automatically,
false
otherwise.@Deprecated public void setInstallExension(boolean installExension)
setInstallExension(boolean)
insteadinstallExension
- true
if the extension packaged in the XAR should be registered as such
automatically, false
otherwise.public void setInstallExtension(boolean installExtension)
installExtension
- true
if the extension packaged in the XAR should be registered as such
automatically, false
otherwise.public String getExtensionId()
public void setExtensionId(String extensionId)
public String getVersion()
public void setVersion(String version)
public String getLicence()
public void setLicence(String licence)
public String getAuthorName()
public void setAuthorName(String authorName)
public boolean isBackupPack()
isWithVersions()
,
isVersionPreserved()
public void setBackupPack(boolean backupPack)
public boolean hasBackupPackImportRights(XWikiContext context)
public boolean isVersionPreserved()
isWithVersions()
,
isBackupPack()
public void setPreserveVersion(boolean preserveVersion)
public List<DocumentInfo> getFiles()
public List<DocumentInfo> getCustomMappingFiles()
public boolean isWithVersions()
public void setWithVersions(boolean withVersions)
public void addDocumentFilter(Object filter) throws PackageException
PackageException
public boolean add(XWikiDocument doc, int defaultAction, XWikiContext context) throws XWikiException
XWikiException
public boolean add(XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiException
public boolean updateDoc(String docFullName, int action, XWikiContext context) throws XWikiException
XWikiException
public boolean add(String docFullName, int DefaultAction, XWikiContext context) throws XWikiException
XWikiException
public boolean add(String docFullName, String language, int DefaultAction, XWikiContext context) throws XWikiException
XWikiException
public boolean add(String docFullName, XWikiContext context) throws XWikiException
XWikiException
public boolean add(String docFullName, String language, XWikiContext context) throws XWikiException
XWikiException
public void filter(XWikiDocument doc, XWikiContext context) throws ExcludeDocumentException
ExcludeDocumentException
public String export(OutputStream os, XWikiContext context) throws IOException, XWikiException
IOException
XWikiException
public String exportToDir(File dir, XWikiContext context) throws IOException, XWikiException
IOException
XWikiException
public String Import(byte[] file, XWikiContext context) throws IOException, XWikiException
install(XWikiContext)
.
Your should prefer Import(InputStream, XWikiContext)
which may avoid loading the package twice in
memory.file
- a byte array containing the content of a zipped package filecontext
- current XWikiContextIOException
- while reading the ZipFileXWikiException
- when package content is brokenpublic String Import(InputStream file, XWikiContext context) throws IOException, XWikiException
install(XWikiContext)
.file
- an InputStream of a zipped package filecontext
- current XWikiContextIOException
- while reading the ZipFileXWikiException
- when package content is brokenpublic int testInstall(boolean isAdmin, XWikiContext context)
public int install(XWikiContext context) throws XWikiException
XWikiException
public List<String> getErrors(XWikiContext context)
public List<String> getSkipped(XWikiContext context)
public List<String> getInstalled(XWikiContext context)
public int getStatus(XWikiContext context)
public String toXml(XWikiContext context)
toXML(com.xpn.xwiki.internal.xml.XMLWriter)
. If an error occurs, a stacktrace is dump
to logs, and an empty String is returned.public void toXML(com.xpn.xwiki.internal.xml.XMLWriter wr) throws IOException
XMLWriter
.wr
- the writer to write toIOException
- when an error occurs during streaming operationpublic void toXML(OutputStream out, XWikiContext context) throws IOException
out
- the OutputStream to write tocontext
- curent XWikiContextIOException
- when an error occurs during streaming operationpublic String getPathFromDocument(XWikiDocument doc, XWikiContext context)
doc
- the document to export.public String getFileNameFromDocument(XWikiDocument doc, XWikiContext context)
doc
- the document to export.public String getDirectoryForDocument(XWikiDocument doc)
doc
- the document to export@Deprecated public void addToZip(XWikiDocument doc, ZipOutputStream zos, boolean withVersions, XWikiContext context) throws XWikiException, IOException
doc
- the document to serializezos
- the ZipOutputStream to write towithVersions
- if true, also serialize all document versionscontext
- current XWikiContextXWikiException
- when an error occurs during documents accessIOException
- when an error occurs during streaming operationpublic void addToDir(XWikiDocument doc, File dir, boolean withVersions, XWikiContext context) throws XWikiException
XWikiException
protected String getElementText(org.dom4j.Element docel, String name, String def)
protected org.dom4j.Document fromXml(InputStream xml) throws org.dom4j.DocumentException
org.dom4j.DocumentException
public void addAllWikiDocuments(XWikiContext context) throws XWikiException
XWikiException
public void deleteAllWikiDocuments(XWikiContext context) throws XWikiException
XWikiException
public int readFromDir(File dir, XWikiContext context, org.dom4j.Document description) throws IOException, XWikiException
dir
- the directory from where to load documents.context
- the XWiki context.description
- the package descriptor.IOException
- error when loading documents.XWikiException
- error when loading documents.public String readFromDir(File dir, XWikiContext context) throws IOException, XWikiException
dir
- the directory from where to load documents.context
- the XWiki context.IOException
- error when loading documents.XWikiException
- error when loading documents.public net.sf.json.JSONObject toJSON(XWikiContext wikiContext)
wikiContext
- the XWiki contextCopyright © 2004–2021 XWiki. All rights reserved.