Package fr.soleil.salsa.entity.impl

Examples of fr.soleil.salsa.entity.impl.DirectoryImpl


            startOperation();

            if (stmt != null) {
                ResultSet rs = stmt.executeQuery(query);

                DirectoryImpl directory = null;
                int positionInDirectory = 0;
                while (rs.next()) {
                    directory = new DirectoryImpl();
                    directory.setId(rs.getInt("directoryid"));
                    directory.setName(rs.getString("name"));
                    // directory.setPositionInDirectory(rs.getInt("positionInDirectory"));
                    directory.setPositionInDirectory(positionInDirectory++);
                    directory.setTimestamp(rs.getTimestamp("timestamp"));

                    int parentDirectoryId = rs.getInt("directory");

                    if (!rs.wasNull()) {
                        IDirectory parent = new DirectoryImpl();
                        parent.setId(parentDirectoryId);
                        directory.setDirectory(parent);
                        // directory.setParentDirectoryId(parentDirectoryId);
                    }
                    directoryList.add(directory);
                }
View Full Code Here


        return result;
    }

    private IDirectory findDirectory(IDirectory root, List<String> path) {

        DirectoryImpl dummy = new DirectoryImpl();
        List<IDirectory> dummySubs = new ArrayList<IDirectory>();
        dummySubs.add(root);
        dummy.setSubDirectoriesList(dummySubs);

        IDirectory result = dummy;
        while (path.size() != 0) {
            String name = path.get(0);
            IDirectory d = findSubDirectory(result, name);
View Full Code Here

     * @param treeNode
     */
    private void refreshDirectory(IDirectory oldDirectoryModel, IDirectory loadRootDirectory) {

        if (loadRootDirectory == null) {
            loadRootDirectory = new DirectoryImpl();
            loadRootDirectory.setName(DEFAULT_ROOT_FOLDER_NAME);
            try {
                ConfigApi.saveDirectory(loadRootDirectory);
            }
            catch (PersistenceException e) {
View Full Code Here

            configuration.setTimestamp(rs.getTimestamp("timestamp"));

            int parentId = rs.getInt("directoryid");

            if (!rs.wasNull()) {
                DirectoryImpl parent = new DirectoryImpl();
                parent.setId(parentId);
                configuration.setDirectoryId(parentId);
                configuration.setDirectory(parent);
                // configuration.setDirectory(getDirectoryById(dir));
            }
        }
View Full Code Here

     * @param directoryId : the identifier of the directory
     * @return Directory
     */
    public IDirectory getDirectoryById(Integer directoryId, boolean recursive) {

        DirectoryImpl directory = null;
        String query = "SELECT * FROM directory where directoryid=" + directoryId;

        try {
            startOperation();
            ResultSet rs = stmt.executeQuery(query);

            while (rs.next()) {

                directory = new DirectoryImpl();

                directory.setId(rs.getInt("directoryid"));
                directory.setName(rs.getString("name"));
                directory.setPositionInDirectory(rs.getInt("positionInDirectory"));
                directory.setTimestamp(rs.getTimestamp("timestamp"));
                Integer dir = rs.getInt("directory");

                if ((dir != null) && (!rs.wasNull())) {
                    DirectoryImpl parent = new DirectoryImpl();
                    parent.setId(dir);
                    directory.setDirectory(parent);
                    // directory.setParentDirectory(getDirectoryById(dir));
                }
            }
            rs.close();
View Full Code Here

        try {
            startOperation();

            ResultSet rs = stmt.executeQuery(query);

            DirectoryImpl directory = null;
            while (rs.next()) {
                directory = new DirectoryImpl();
                directory.setId(rs.getInt("directoryid"));
                directory.setName(rs.getString("name"));
                directory.setPositionInDirectory(rs.getInt("positionInDirectory"));
                directory.setTimestamp(rs.getTimestamp("timestamp"));

                int parentDirectoryId = rs.getInt("directory");

                if (!rs.wasNull()) {
                    IDirectory parent = new DirectoryImpl();
                    parent.setId(parentDirectoryId);
                    directory.setDirectory(parent);
                    // directory.setParentDirectoryId(parentDirectoryId);
                }
                directoryList.add(directory);
            }
View Full Code Here

            result.setLoaded(true);
            result.setId(id);
            result.setTimestamp(c.getTimestamp());
            if (c.getDirectoryId() != null) {
                IDirectory parent = new DirectoryImpl();
                parent.setId(c.getDirectoryId());
                result.setDirectory(parent);
            }
            if (c.getType().equals("Config1DImpl")) {
                result.setType(IConfig.ScanType.SCAN_1D);
            }
View Full Code Here

        return result;
    }

    private IDirectory findDirectory(IDirectory root, List<String> path) {

        DirectoryImpl dummy = new DirectoryImpl();
        List<IDirectory> dummySubs = new ArrayList<IDirectory>();
        dummySubs.add(root);
        dummy.setSubDirectoriesList(dummySubs);

        IDirectory result = dummy;
        while (path.size() != 0) {
            String name = path.get(0);
            IDirectory d = findSubDirectory(result, name);
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.impl.DirectoryImpl

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.