Tuesday, September 4, 2012

Functions of startSQLRepository: ATG


startSQLRepository Functions:


startSQLRepository, reads a repository definition from an XML file or DOM and


1. Verifies your XML is correctly formed and compliant with the DTD.

2. Parses and processes optional operation tags like <add-item>, <remove-item>, and <query-  
    items>. These tags provide a means for adding, removing, updating items in your SQL  \
    repository.

3. Generates SQL statements required to create appropriate table structure in database when you
    use the –outputSQL flag.

4. Returns results of <query-items> and <print-item> requests in the form of <add-item> tags.
    This allows you to easily copy and paste the results into another XML template, so you can add
    the items to another repository.

5. Imports and exports items and item descriptors


Using the startSQLRepository Script


Use one of the startSQLRepository scripts included in the <ATGdir>/home/bin directory:

If your template contains <table> tags, you must also make sure that:


1. the database accessed by your repository is running

2. the database contains the appropriate tables

3. you have appropriate database access authorization to perform any import or create database
    operations

you need to make sure that repository IDs in the source repository do not collide with repository IDs in the target repository. Make sure that both the source database and target database already contain IdSpaces. The IdSpaces in the source database and target database must have the same names. Furthermore, the name of the IdSpaces used by each item descriptor should be the same in the source repository for the export and the target repository for the import. If you do this, then the import operation reserves all the IDs it encounters for repository items it creates in the target database.

ID Generators should be happen and it will create idspaces.xml,


The startSQLRepository scripts use the following syntax:


startSQLRepository <arguments> [file name.xml]


For example, to load an XML template whose CONFIGPATH name is /atg/test.xml in a repository with a Nucleus address of /atg/userprofiling/ProfileAdapterRepository:

startSQLRepository -m DPS
   –repository /atg/userprofiling/ProfileAdapterRepository /atg/test.xml

Note that the repository template file name you provide is a reference to a CONFIGPATH location, and not a pathname in your file system. For example, you can put a file in your localconfig directory and refer to it as /<your-file>. You can also use a file with the same name as your repository’s existing definition file and then omit the file name argument from the startSQLRepository command. The startSQLRepository script uses XML file combination to combine all files with the same name into a single repository definition

if you include the following file at <ATGdir>/home/localconfig/atg/userprofiling/userProfile.xml and run the startSQLRepository script, it will print all profiles in your Profile Repository:

<gsa-template>
  <print-item item-descriptor="user"/>
</gsa-template>

You can use the startSQLRepository script together with the test operation tags described earlier in this chapter to quickly test a query, or add, update, remove, or print an item.

No comments:

Popular Posts