public class PackageAPI extends Api
Constructor and Description |
---|
PackageAPI(Package plugin,
XWikiContext context)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String docFullName)
Deprecated.
|
boolean |
add(String docFullName,
int DefaultAction)
Deprecated.
|
void |
addDocumentFilter(Object filter)
Deprecated.
|
void |
backupWiki()
Deprecated.
|
String |
export()
Deprecated.
|
String |
getAuthorName()
Deprecated.
|
String |
getDescription()
Deprecated.
|
List<String> |
getErrors()
Deprecated.
|
List<DocumentInfoAPI> |
getFiles()
Deprecated.
|
List<String> |
getInstalled()
Deprecated.
|
String |
getLicence()
Deprecated.
|
String |
getName()
Deprecated.
|
Package |
getPackage()
Deprecated.
|
List<String> |
getSkipped()
Deprecated.
|
int |
getStatus()
Deprecated.
|
String |
getVersion()
Deprecated.
|
boolean |
hasBackupPackImportRights()
Deprecated.
Indicate if the current user has the right to import a package as a backup pack.
|
String |
Import(byte[] file)
Deprecated.
Load a package in memory from a byte array.
|
String |
Import(InputStream file)
Deprecated.
Load a package in memory from an InputStream.
|
boolean |
importPackageFromByteArray(byte[] data)
Deprecated.
Similar to
Import(byte[]) , except expected errors are catch. |
int |
install()
Deprecated.
|
boolean |
isBackupPack()
Deprecated.
|
boolean |
isVersionPreserved()
Deprecated.
|
boolean |
isWithVersions()
Deprecated.
|
void |
setAuthorName(String authorName)
Deprecated.
|
void |
setBackupPack(boolean backupPack)
Deprecated.
|
void |
setDescription(String description)
Deprecated.
|
void |
setDocumentAction(String docFullName,
int action)
Deprecated.
|
void |
setDocumentAction(String docFullName,
String language,
int action)
Deprecated.
|
void |
setLicence(String licence)
Deprecated.
|
void |
setName(String name)
Deprecated.
|
void |
setPreserveVersion(boolean preserveVersion)
Deprecated.
Sets the flag for the packager to preserve or not existing versions of documents when installing with
install() . |
void |
setVersion(String version)
Deprecated.
|
void |
setWithVersions(boolean withVersions)
Deprecated.
Sets the flag for the packager to import or not history revisions included in the archive when installing with
install() . |
int |
testInstall()
Deprecated.
|
int |
testInstall(boolean isAdmin)
Deprecated.
|
net.sf.json.JSONObject |
toJSON()
Deprecated.
|
String |
toXml()
Deprecated.
|
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public PackageAPI(Package plugin, XWikiContext context) throws PackageException
PackageException
public String getName()
public void setName(String name)
public Package getPackage()
public String getDescription()
public void setDescription(String description)
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()
public void setBackupPack(boolean backupPack)
public boolean hasBackupPackImportRights()
public boolean isVersionPreserved()
public void setPreserveVersion(boolean preserveVersion)
install()
. If set to true, the existing history revisions of documents will be preserve, if not, the
history will be overridden.preserveVersion
- public boolean isWithVersions()
public void setWithVersions(boolean withVersions)
install()
. This flag will be ignored if isWithVersions()
flag is set to true. This means it's
not possible to import with versions, preserving the existing document history. The behavior of the packager in
this case fall backs on just adding a new version to the exsting history (ignoring the history from the package).withVersions
- should the versions contained in the archive (if any) be imported when installing.public void addDocumentFilter(Object filter) throws PackageException
PackageException
public List<DocumentInfoAPI> getFiles()
public boolean add(String docFullName, int DefaultAction) throws XWikiException
XWikiException
public boolean add(String docFullName) throws XWikiException
XWikiException
public void setDocumentAction(String docFullName, int action)
public void setDocumentAction(String docFullName, String language, int action)
public String export() throws IOException, XWikiException
IOException
XWikiException
public boolean importPackageFromByteArray(byte[] data)
Import(byte[])
, except expected errors are catch. This version should be privileged when
using the packager API from velocity scripts since it will not display stack-trace in case of error (for example
if the passed file is not a valid package).data
- the file to create the package from, as a byte array.import_error
key,public String Import(byte[] file) throws IOException, XWikiException
install()
. Your should
prefer Import(InputStream)
which may avoid loading the package twice in memory.file
- an byte array containing a zipped package fileIOException
- while reading the ZipFileXWikiException
- when package content is brokenpublic String Import(InputStream file) throws IOException, XWikiException
install()
.file
- is an InputStream of a zipped package fileIOException
- while reading the ZipFileXWikiException
- when package content is brokenpublic int testInstall()
public int testInstall(boolean isAdmin)
public void backupWiki() throws XWikiException, IOException
XWikiException
IOException
public String toXml()
public net.sf.json.JSONObject toJSON()
public int install() throws XWikiException
XWikiException
public int getStatus()
Copyright © 2004–2021 XWiki. All rights reserved.