Package atg.repository

Examples of atg.repository.RepositoryException


                            )
                    );
                }

            } catch ( Exception e ) {
                throw new RepositoryException(
                        "Exception caught importing files into repository.", e
                );
            }
        }
    }
View Full Code Here


        // if file list is not null, convert it and return the array
        try {
            return TestUtils.convertFileArray(files, ",");
        } catch ( Exception e ) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

        // if file list is not null, convert it and return the array
        try {
            return TestUtils.convertFileArray(files, ",");
        } catch ( Exception e ) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

            Iterator<?> cmds = null;
            if ( isLoggingInfo() ) {
                logInfo("Executing SQL file: " + file);
            }
            if ( !new File(file).exists() ) {
                throw new RepositoryException("SQL file " + file + " does not exist.");
            }

            // parse the file to get commands...
            try {
                Collection<?> c = parser.parseSQLFile(file);
                if ( isLoggingDebug() ) {
                    logDebug("Parsed " + c.size() + " SQL command(s) from file.");
                }
                cmds = c.iterator();
            } catch ( Exception e ) {
                // an error parsing the file indicates something very wrong, so bail
                throw new RepositoryException(
                        "Error encountered parsing SQL file " + file, e
                );
            }

            // then execute the commands...
            while ( cmds.hasNext() ) {
                cmd = (String) cmds.next();
                if ( isLoggingDebug() || isLoggingCreateTables() ) {
                    logDebug("Executing SQL cmd [" + cmd + "]");
                }
                try {
                    sp.executeSQL(cmd);
                } catch ( Exception e ) {
                    if ( pStopAtError ) {
                        throw new RepositoryException(
                                "Error received executing command ["
                                + cmd
                                + "] from SQL file "
                                + file, e
                        );
View Full Code Here

        Class<?>[] types = desc.getIdTypes();
        String[] idSpaceNames = desc.getIdSpaceNames();
        Object[] newId = new Object[types.length];

        if ( idSpaceNames.length != types.length ) {
            throw new RepositoryException("No ID SPACES ! " + desc.getItemDescriptorName());
        }

        // generate an id in our id space and return it
        try {
            for ( int i = 0; i < types.length; i++ ) {
                if ( types[i] == String.class ) {
                    if ( i > 0 ) {
                        newId[i] = "dummyIdPart";
                    } else {
                        newId[i] = gen.generateStringId(idSpaceNames[i]);
                    }
                } else {
                    long val = gen.generateLongId(idSpaceNames[i]);
                    if ( types[i] == Long.class ) {
                        newId[i] = val;
                    } else if ( types[i] == Float.class ) {
                        newId[i] = (float) val;
                    } else if ( types[i] == Double.class ) {
                        newId[i] = (double) val;
                    } else if ( types[i] == java.sql.Timestamp.class ) {
                        newId[i] = new java.sql.Timestamp(val);
                    } else if ( types[i] == java.util.Date.class ) {
                        newId[i] = new java.util.Date(val);
                    } else {
                        newId[i] = (int) val;
                    }
                }
            }
        } catch ( IdGeneratorException ie ) {
            throw new RepositoryException(ie);
        }

        return desc.generateGSAId(newId);
    }
View Full Code Here

                }
                if (schemaGenerator != null) {
                    schemaGenerator.dropSchema(true);
                }
            } catch (DatabaseOperationException e) {
                throw new RepositoryException(e);
            }
        }
        else {
            List<String> statements = getCreateStatements(null, null);
            SQLProcessorEngine processor = getSQLProcessor();
View Full Code Here

                schemaGenerator = new GSARepositorySchemaGenerator(this);
                try {
                    schemaGenerator.createSchema(true, isDropTablesIfExist());
                    createdTables = true;
                } catch (DatabaseOperationException e) {
                    throw new RepositoryException(e);
                }
            }
        }
        else {
            // Use GSA Generated SQL
View Full Code Here

            try {
                TemplateParser.importFiles(
                        this, loadFiles, ps, isImportWithTransaction()
                );
            } catch (Exception e) {
                throw new RepositoryException(
                        "Exception caught importing files into repository.", e
                );
            }
        }
    }
View Full Code Here

        // if file list is not null, convert it and return the array
        try {
            return TestUtils.convertFileArray(files, ":");
        } catch (Exception e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

        // if file list is not null, convert it and return the array
        try {
            return TestUtils.convertFileArray(files, ":");
        } catch (Exception e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

TOP

Related Classes of atg.repository.RepositoryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.