...
Code Block | ||
---|---|---|
| ||
ant data-import -Ddir={path-to-directory} [-Dpattern={regexant-pattern}] |
Where path-to-directory
is a file system directory, absolute or relative, containing uPortal Import/Export XML files; and regex
pattern
is an (optional) Java Regular Expression Ant Filesystem Pattern specifying a file name pattern that candidate files must match or be ignored by the importer.
...
title | The -Dpattern Argument |
---|
...
.
Code Block | ||
---|---|---|
| ||
ant data-import -Dfile={path-to-file} |
...
Lists the data types the portal knows how to import/export/delete and can list all of the data currently in the database for a specific type. The data-list
command with no arguments lists all supported portal data types and the operations (export, delete) supported for each. By adding the -Dtype=
parameter all data that currently exists in the portal for that data type is listed
Usage
Code Block | List Data Types | List Data Types|
---|---|---|
| ||
ant data-list |
Example output:
No Format |
---|
[java] INFO Export and Delete Support by Data Type
[java] INFO Data Type | Export | Delete
[java] INFO -----------------------+--------+--------
[java] INFO entity-type | true | false
[java] INFO fragment-definition | true | false
[java] INFO fragment-layout | true | false
[java] INFO group-membership | true | false
[java] INFO layout | true | false
[java] INFO permission-owner | true | true
[java] INFO permission-set | true | false
[java] INFO portlet-definition | true | true
[java] INFO portlet-type | true | true
[java] INFO profile | true | false
[java] INFO stylesheet-descriptor | true | true
[java] INFO user | true | true |
Code Block | ||
---|---|---|
| ||
ant data-list -Dtype={entity-type} |
Where entity-type
is the name of a portal data type, these can be determined by the plain ant data-list
command.
Example Output, note that the part before the " - " is the sysid
to use with the data-export and data-delete commands.
No Format |
---|
[java] INFO All portlet-definition data
[java] INFO fragment-audit - Audit DLM Fragments
[java] INFO forgot-password - Forgot Password
[java] INFO passwordmgr - Password Management
[java] INFO ImportExportPortlet - Import Export Portlet
[java] INFO cache-manager - Cache Manager
[java] INFO popular-portlets - Most Popular Apps |
Export
Creates XML files representing the requested entities and writes them to the specified file system location.
...
Info | ||
---|---|---|
| ||
On export, XML documents will be organized into sub-directories by entity type: e.g. |
Delete
Removes the specified entities as well as dependent (orphaned) entities from the portal database.
Warning | ||
---|---|---|
| ||
The DELETE feature should be used with extreme caution and is more appropriate for DEV and TEST portals than for PROD. It is possible to make your portal unusable by deleting the wrong thing. |
Usage
Code Block |
---|
ant >ant crndata-delete -Dtype={entity-type} [-Dsysid={entity-identifier}] |
Where entity-type
is any supported entity type (see table below); and entity-identifier
is the Id
or Name
of a single entity of the specified type.
Table of Entity Types
entity-type | sysid | export | delete | notes |
---|---|---|---|---|
all | All portal entities | Combines the following sub-types:
| ||
all-layouts | All user layouts | Normal users generate | ||
all-profiles | All user profiles | May generate more than one document per user | ||
all-permissions | All permissions | A | ||
all-permission_sets | All permission_sets | A | ||
all-memberships | All local (RDBMS) memberships | A | ||
all-channels | All channels |
| ||
all-channel-types | All channel types |
| ||
all-groups | All local (RDBMS) groups | A | ||
all-group_memberships | All local (RDBMS) group_memberships | A | ||
all-users | All users |
| ||
all-themes | All themes |
| ||
all-structures | All structures |
| ||
all-entity-types | All entity types | "Entity types" here refers to the | ||
all-fragment-definitions | All fragment definitions | Requires the | ||
layout |
|
|
|
|
profile |
|
|
| May generate more than one document per user |
channel |
|
|
|
|
channel-type |
|
|
|
|
group |
|
|
| A |
group_membership |
|
|
| A |
user |
|
|
|
|
theme |
|
|
|
|
structure |
|
|
|
|
entity-type |
|
|
|
|
fragment-definition |
|
|
|
|
=not specified or not supported
Import/Export Logs
uPortal logs the outcome of Import/Export operations in UPORTAL_ROOT/target/data-import-reports
. There will be a summary report in a file with a name like data-import.txt
, and if there are errors from the process there will also be an error report file for each object that failed (e.g. layout_aa148809.layout.txt
).
Example Error Report
Code Block |
---|
FAIL: layout - aa148809.layout
--------------------------------------------------------------------------------
java.lang.IllegalArgumentException: No published channel for fname=header referenced by layout for aa148809
at org.jasig.portal.layout.dlm.RDBMDistributedLayoutStore.importLayout(RDBMDistributedLayoutStore.java:793)
at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy124.importLayout(Unknown Source)
at org.jasig.portal.io.xml.layout.LayoutImporter.importDataElement(LayoutImporter.java:44)
at org.jasig.portal.io.xml.crn.AbstractDom4jImporter.importData(AbstractDom4jImporter.java:86)
at org.jasig.portal.io.xml.crn.AbstractDom4jImporter.importData(AbstractDom4jImporter.java:53)
at org.jasig.portal.io.xml.JaxbPortalDataHandlerService.importOrUpgradeData(JaxbPortalDataHandlerService.java:567)
at org.jasig.portal.io.xml.JaxbPortalDataHandlerService.importData(JaxbPortalDataHandlerService.java:530)
at org.jasig.portal.io.xml.JaxbPortalDataHandlerService.importData(JaxbPortalDataHandlerService.java:497)
at org.jasig.portal.io.xml.JaxbPortalDataHandlerService$1.callWithoutResult(JaxbPortalDataHandlerService.java:401)
at org.jasig.portal.concurrency.CallableWithoutResult.call(CallableWithoutResult.java:32)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662) |