AppSuite:Data management: Difference between revisions

From Open-Xchange
No edit summary
No edit summary
Line 67: Line 67:


<code>context default invisible data deleted</code>
<code>context default invisible data deleted</code>
== getpublication ==
{{VersionFrom|7.6.2}}
The '''<code>getpublication</code>''' command line tool can be used to list publications inside a context.
=== Usage ===
Usage: getpublication [-A <adminuser> -P <adminpass>] [ -c <contextid> [-u <publication-url>] | [-e <entity-id>] | [-i <userid> [-m <module>]]]
=== Parameters ===
{| border="1"
|-
| -h,--help
|Prints a help text for this CLT
|-
| --environment
|Shows information about environment variables
|-
| --nonl
|Removes all newlines (\n) from output
|-
| -c,--contextid &lt;contextid&gt;
|The unique identifier of the context that publications reside
|-
| -A,--adminuser &lt;adminuser&gt;
|The context's admin
|-
| -P,--adminpass &lt;adminpass&gt;
|The context's admin password
|-
| -u,--publication-url &lt;publication-url&gt;
|The publication URL
|-
| -m,--module &lt;module-name&gt;
|The module name
|-
| -e,--entity-id &lt;entity-id&gt;
|The entity's unique identifier
|-
| -i,--userid &lt;user-id&gt;
|The user's unique identifier
|}
=== Examples ===
Get information about a publication via the publication URL. There are two variations of a publication URL:
# <code>/publications/infostore/1/bar?secret=foo</code>
# <code>/publications/infostore/1/bar/123456789/current?secret=foo</code>
The first one describes a publication as a whole, and the second one a single element within a publication (Hint: 123456789 is the element's identifier)
With that in mind, information about a single publication via the URL can be retrieved with either one of those versions:
<code> $ getpublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo</code>
OR
<code> $ getpublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar/123456789/current?secret=foo</code>
<code>
publication Publication [userId=5, context=[
  id: 1
  idset: true
  readDatabaseset: false
  writeDatabaseset: false
  filestore_idset: false
  filestore_nameset: false
  average_sizeset: false
  maxQuotaset: false
  usedQuotaset: false
  maintenanceReasonset: false
  enabled: false
  enabledset: false
  nameset: false
  userAttribtuesset: false
  listrun: false
  quotas: []
], id=314, entityId=1337, module=infostore, description=Publication:, Context: 1, UserID:  5, ]
</code>
Single elements with in the publication can not be retrieved/listed (yet)
Get all publications for a single user with in the context, for all modules (or confine the output with just the desired module by using the -m <module-name> parameter).
<code> $ getpublication -A oxadmin -P secret -c 1 -i 5</code>
<code>
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 5      | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo      |
| 5      | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo    |
| 5      | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5      | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5      | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5      | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5      | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
</code>
Get all publications for all users in the context
<code> $ getpublication -A oxadmin -P secret -c 1</code>
<code>
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 4      | 1          | infostore | 32        | 490 | /publications/infostore/1/test1236?secret=bar  |
| 4      | 1          | infostore | 15        | 497 | /publications/infostore/1/bnbn?secret=bar      |
| 5      | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo      |
| 5      | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo    |
| 5      | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5      | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5      | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5      | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5      | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
| 6      | 1          | infostore | 103359    | 114 | /publications/infostore/1/share?secret=barfoo  |
| 6      | 1          | infostore | 27698    | 115 | /publications/infostore/1/fld?secret=barfoo    |
| 6      | 1          | contacts  | 25337    | 889 | /publications/contacts/1/LinkedIn?secret=abc  |
| 6      | 1          | contacts  | 25337    | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
</code>
Get all publications with the specified entity identifier
<code> $ getpublication -A oxadmin -P secret -c 1 -e 25337</code>
<code>
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 6      | 1          | contacts  | 25337    | 889 | /publications/contacts/1/LinkedIn?secret=abc  |
| 6      | 1          | contacts  | 25337    | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
</code>
== deletepublication ==
{{VersionFrom|7.6.2}}
The '''<code>deletepublication</code>''' command line tool can be used to delete publications inside a context.
=== Usage ===
Usage: deletepublication [-f] [-A <adminuser> -P <adminpass>] [ -c <contextid> [-u <publication-url>] | [-e <entity-id>] | [-i <userid> [-m <module>]]] [-v]
=== Parameters ===
{| border="1"
|-
| -h,--help
|Prints a help text for this CLT
|-
| --environment
|Shows information about environment variables
|-
| --nonl
|Removes all newlines (\n) from output
|-
| -c,--contextid &lt;contextid&gt;
|The unique identifier of the context that publications reside
|-
| -A,--adminuser &lt;adminuser&gt;
|The context's admin
|-
| -P,--adminpass &lt;adminpass&gt;
|The context's admin password
|-
| -u,--publication-url &lt;publication-url&gt;
|The publication URL
|-
| -m,--module &lt;module-name&gt;
|The module name
|-
| -e,--entity-id &lt;entity-id&gt;
|The entity's unique identifier
|-
| -i,--userid &lt;user-id&gt;
|The user's unique identifier
|-
| -f,--force
|Flag to force deletion
|-
| -v,--verbose
|Flag to enable printing verbose information about the publications that are deleted
|}
=== Examples ===
Delete a publication via the publication URL. As described in 'getpublication' there are two variations of a publication URL. Both variations can be used to delete a specific publication. Elements within the publication cannot be deleted. The extra flag '-f' must be specified in every delete operation, in order for the operation to execute. This is just a precaution, to inform the admin that the operation is irreversible and the publications subject to be removed, they will be lost completely and won't be able to restored anymore. So, the following invocation will yield:
<code> $ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo</code>
<code>No publication deleted yet. Please make sure that you want to continue with this irreversible operation. To force deletion use the '-f' flag.</code>
<code> $ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo -f</code>
<code>Publication with URL "/publications/infostore/1/bar?secret=foo" successfully deleted from context 1</code>
To retrieve more information about the publication subject to delete, use the '-v' flag:
<code> $ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo -f -v</code>
<code>
Publication with URL "/publications/infostore/1/bar?secret=foo" successfully deleted from context 1
publication Publication [userId=5, context=[
id: 1
idset: true
readDatabaseset: false
writeDatabaseset: false
filestore_idset: false
filestore_nameset: false
average_sizeset: false
maxQuotaset: false
usedQuotaset: false
maintenanceReasonset: false
enabled: false
enabledset: false
nameset: false
userAttribtuesset: false
listrun: false
quotas: []
], id=314, entityId=1337, module=infostore, description=Publication:, Context: 1, UserID:  5, ]
</code>
Delete all publications for a single user with in the context, for all modules (or confine the operation with just the desired module by using the -m <module-name> parameter).
<code> $ deletepublication -A oxadmin -P secret -c 1 -i 5 -f</code>
<code>
The following publications were deleted: 314 316 138 319 323 319 324
</code>
Delete all publications for all users in the context
<code> $ deletepublication -A oxadmin -P secret -c 1 -v -f</code>
<code>
The following publications were deleted: 490 497 314 316 138 319 323 319 324 114 115 889 890
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 4      | 1          | infostore | 32        | 490 | /publications/infostore/1/test1236?secret=bar  |
| 4      | 1          | infostore | 15        | 497 | /publications/infostore/1/bnbn?secret=bar      |
| 5      | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo      |
| 5      | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo    |
| 5      | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5      | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5      | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5      | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5      | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
| 6      | 1          | infostore | 103359    | 114 | /publications/infostore/1/share?secret=barfoo  |
| 6      | 1          | infostore | 27698    | 115 | /publications/infostore/1/fld?secret=barfoo    |
| 6      | 1          | contacts  | 25337    | 889 | /publications/contacts/1/LinkedIn?secret=abc  |
| 6      | 1          | contacts  | 25337    | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
</code>
Delete all publications with the specified entity identifier
<code> $ deletepublication -A oxadmin -P secret -c 1 -e 25337 -f -v</code>
<code>
The following publications were deleted: 889 890
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 6      | 1          | contacts  | 25337    | 889 | /publications/contacts/1/LinkedIn?secret=abc  |
| 6      | 1          | contacts  | 25337    | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
</code>





Revision as of 06:56, 22 January 2015

deleteinvisible

The deleteinvisible command line tool can be used to remove not visible data inside a context. Before calling this CLT the module access for all users in the context should be changed to the according permissions. This CLT uses the changed permissions to determine what data is not visible for the context users anymore. Changing permissions can be done by either changing the module access for every single user in the context through the CLT changeuser or by the CLT for changing the module access for an entire context.

Be careful because the deleted data is lost completely and can not be restored anymore.


Parameters

-h,--help Prints a help text for this CLT
--environment Shows information about environment variables
--nonl Removes all newlines (\n) from output
-c,--contextid <contextid> The unique identifier of the context that invisible data should be deleted.
-N,--contextname <contextname> A name that is assigned to the context.

Either the unique context identifier must be given or a name that is assigned to it.


Extra parameters

Master adminstrator user name that is defined for managing contexts.
Master adminstrator user password.

Return value

0 on success

>0 on failure

Mandatory parameters

(contextid or contextname) {adminuser adminpass}

Command output

On success:

context <contextid or contextname> invisible data deleted

On failure:

context <contextid or contextname> invisible data could not be deleted: <reason from server>


Example

root@oxhe~# /opt/open-xchange/sbin/deleteinvisible -N default

context default invisible data deleted

getpublication

This information is valid from 7.6.2 on.

The getpublication command line tool can be used to list publications inside a context.

Usage

Usage: getpublication [-A <adminuser> -P <adminpass>] [ -c <contextid> [-u <publication-url>] | [-e <entity-id>] | [-i <userid> [-m <module>]]]

Parameters

-h,--help Prints a help text for this CLT
--environment Shows information about environment variables
--nonl Removes all newlines (\n) from output
-c,--contextid <contextid> The unique identifier of the context that publications reside
-A,--adminuser <adminuser> The context's admin
-P,--adminpass <adminpass> The context's admin password
-u,--publication-url <publication-url> The publication URL
-m,--module <module-name> The module name
-e,--entity-id <entity-id> The entity's unique identifier
-i,--userid <user-id> The user's unique identifier

Examples

Get information about a publication via the publication URL. There are two variations of a publication URL:

  1. /publications/infostore/1/bar?secret=foo
  2. /publications/infostore/1/bar/123456789/current?secret=foo

The first one describes a publication as a whole, and the second one a single element within a publication (Hint: 123456789 is the element's identifier)

With that in mind, information about a single publication via the URL can be retrieved with either one of those versions:

$ getpublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo

OR

$ getpublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar/123456789/current?secret=foo

publication Publication [userId=5, context=[ 
  id: 1
  idset: true
  readDatabaseset: false
  writeDatabaseset: false
  filestore_idset: false
  filestore_nameset: false
  average_sizeset: false
  maxQuotaset: false
  usedQuotaset: false
  maintenanceReasonset: false
  enabled: false
  enabledset: false
  nameset: false
  userAttribtuesset: false
  listrun: false
  quotas: []
], id=314, entityId=1337, module=infostore, description=Publication:, Context: 1, UserID:  5, ]

Single elements with in the publication can not be retrieved/listed (yet)

Get all publications for a single user with in the context, for all modules (or confine the output with just the desired module by using the -m <module-name> parameter).

$ getpublication -A oxadmin -P secret -c 1 -i 5

+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 5       | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo       |
| 5       | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo     |
| 5       | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5       | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5       | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5       | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5       | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
+---------+------------+-----------+-----------+-----+------------------------------------------------+

Get all publications for all users in the context

$ getpublication -A oxadmin -P secret -c 1

+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 4       | 1          | infostore | 32        | 490 | /publications/infostore/1/test1236?secret=bar  |
| 4       | 1          | infostore | 15        | 497 | /publications/infostore/1/bnbn?secret=bar      |
| 5       | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo       |
| 5       | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo     |
| 5       | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5       | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5       | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5       | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5       | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
| 6       | 1          | infostore | 103359    | 114 | /publications/infostore/1/share?secret=barfoo  |
| 6       | 1          | infostore | 27698     | 115 | /publications/infostore/1/fld?secret=barfoo    |
| 6       | 1          | contacts  | 25337     | 889 | /publications/contacts/1/LinkedIn?secret=abc   |
| 6       | 1          | contacts  | 25337     | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+

Get all publications with the specified entity identifier

$ getpublication -A oxadmin -P secret -c 1 -e 25337

+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 6       | 1          | contacts  | 25337     | 889 | /publications/contacts/1/LinkedIn?secret=abc   |
| 6       | 1          | contacts  | 25337     | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+

deletepublication

This information is valid from 7.6.2 on.

The deletepublication command line tool can be used to delete publications inside a context.

Usage

Usage: deletepublication [-f] [-A <adminuser> -P <adminpass>] [ -c <contextid> [-u <publication-url>] | [-e <entity-id>] | [-i <userid> [-m <module>]]] [-v]

Parameters

-h,--help Prints a help text for this CLT
--environment Shows information about environment variables
--nonl Removes all newlines (\n) from output
-c,--contextid <contextid> The unique identifier of the context that publications reside
-A,--adminuser <adminuser> The context's admin
-P,--adminpass <adminpass> The context's admin password
-u,--publication-url <publication-url> The publication URL
-m,--module <module-name> The module name
-e,--entity-id <entity-id> The entity's unique identifier
-i,--userid <user-id> The user's unique identifier
-f,--force Flag to force deletion
-v,--verbose Flag to enable printing verbose information about the publications that are deleted

Examples

Delete a publication via the publication URL. As described in 'getpublication' there are two variations of a publication URL. Both variations can be used to delete a specific publication. Elements within the publication cannot be deleted. The extra flag '-f' must be specified in every delete operation, in order for the operation to execute. This is just a precaution, to inform the admin that the operation is irreversible and the publications subject to be removed, they will be lost completely and won't be able to restored anymore. So, the following invocation will yield:

$ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo

No publication deleted yet. Please make sure that you want to continue with this irreversible operation. To force deletion use the '-f' flag.

$ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo -f

Publication with URL "/publications/infostore/1/bar?secret=foo" successfully deleted from context 1

To retrieve more information about the publication subject to delete, use the '-v' flag:

$ deletepublication -A oxadmin -P secret -c 1 -u /publications/infostore/1/bar?secret=foo -f -v

Publication with URL "/publications/infostore/1/bar?secret=foo" successfully deleted from context 1 publication Publication [userId=5, context=[

id: 1
idset: true
readDatabaseset: false
writeDatabaseset: false
filestore_idset: false
filestore_nameset: false
average_sizeset: false
maxQuotaset: false
usedQuotaset: false
maintenanceReasonset: false
enabled: false
enabledset: false
nameset: false
userAttribtuesset: false
listrun: false
quotas: []

], id=314, entityId=1337, module=infostore, description=Publication:, Context: 1, UserID: 5, ]

Delete all publications for a single user with in the context, for all modules (or confine the operation with just the desired module by using the -m <module-name> parameter).

$ deletepublication -A oxadmin -P secret -c 1 -i 5 -f

The following publications were deleted: 314 316 138 319 323 319 324

Delete all publications for all users in the context

$ deletepublication -A oxadmin -P secret -c 1 -v -f

The following publications were deleted: 490 497 314 316 138 319 323 319 324 114 115 889 890
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 4       | 1          | infostore | 32        | 490 | /publications/infostore/1/test1236?secret=bar  |
| 4       | 1          | infostore | 15        | 497 | /publications/infostore/1/bnbn?secret=bar      |
| 5       | 1          | infostore | 1337      | 314 | /publications/infostore/1/bar?secret=foo       |
| 5       | 1          | infostore | 1338      | 316 | /publications/infostore/1/mybar?secret=foo     |
| 5       | 1          | infostore | 1339      | 318 | /publications/infostore/1/oxfolder?secret=foo  |
| 5       | 1          | infostore | 1340      | 319 | /publications/infostore/1/whatever?secret=foo  |
| 5       | 1          | infostore | 1341      | 323 | /publications/infostore/1/raboof?secret=foo    |
| 5       | 1          | contacts  | 1453      | 319 | /publications/contacts/1/blacklist?secret=foo  |
| 5       | 1          | contacts  | 1821      | 324 | /publications/contacts/1/party?secret=foo      |
| 6       | 1          | infostore | 103359    | 114 | /publications/infostore/1/share?secret=barfoo  |
| 6       | 1          | infostore | 27698     | 115 | /publications/infostore/1/fld?secret=barfoo    |
| 6       | 1          | contacts  | 25337     | 889 | /publications/contacts/1/LinkedIn?secret=abc   |
| 6       | 1          | contacts  | 25337     | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+

Delete all publications with the specified entity identifier

$ deletepublication -A oxadmin -P secret -c 1 -e 25337 -f -v

The following publications were deleted: 889 890
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| User ID | Context ID | Module    | Entity ID | ID  | URL                                            |
+---------+------------+-----------+-----------+-----+------------------------------------------------+
| 6       | 1          | contacts  | 25337     | 889 | /publications/contacts/1/LinkedIn?secret=abc   |
| 6       | 1          | contacts  | 25337     | 890 | /publications/contacts/1/LinkedIn2?secret=def  |
+---------+------------+-----------+-----------+-----+------------------------------------------------+