Package com.starbase.starteam

Examples of com.starbase.starteam.View


        OLEDate lastBuildDate = new OLEDate(lastBuild.getTime());

        Server server = null;
        try {
            // Set up two view snapshots, one at lastbuild time, one now
            View view = StarTeamFinder.openView(userName + ":" + password + "@" + url);
            server = view.getServer();

            View snapshotAtNow = new View(view, ViewConfiguration.createFromTime(nowDate));
            View snapshotAtLastBuild =
                new View(view, ViewConfiguration.createFromTime(lastBuildDate));

            Map nowFiles = new HashMap();
            Map lastBuildFiles = new HashMap();

            Folder nowRoot = StarTeamFinder.findFolder(snapshotAtNow.getRootFolder(), folder);

            PropertyNames stPropertyNames = server.getPropertyNames();
            // properties to fetch immediately and cache
            final String[] propertiesToCache =
                new String[] {
                    stPropertyNames.FILE_CONTENT_REVISION,
                    stPropertyNames.MODIFIED_TIME,
                    stPropertyNames.FILE_FILE_TIME_AT_CHECKIN,
                    stPropertyNames.COMMENT,
                    stPropertyNames.MODIFIED_USER_ID,
                    stPropertyNames.FILE_NAME };

            if (preloadFileInformation) {
                // cache information for now
                nowRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
            }

            // Visit all files in the snapshots and add to Maps
            addFolderModsToList(nowFiles, nowRoot);

            try {
                Folder lastBuildRoot =
                    StarTeamFinder.findFolder(snapshotAtLastBuild.getRootFolder(), folder);

                if (preloadFileInformation) {
                    // cache information for last build
                    lastBuildRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
                }

                addFolderModsToList(lastBuildFiles, lastBuildRoot);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred visiting last build view: ", se);
            }

            compareFileLists(nowFiles, lastBuildFiles);

            // Discard cached items so memory is not eaten up
            snapshotAtNow.getRootFolder().discardItems(server.getTypeNames().FILE, -1);

            try {
                snapshotAtLastBuild.getRootFolder().discardItems(server.getTypeNames().FILE, -1);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred discarding last build file cache: ", se);
            }

            LOG.info(modifications.size() + " modifications in " + folder);
View Full Code Here


     */
    protected void runProject(Server s, com.starbase.starteam.Project p) {
        View[] views = p.getViews();

        for (int i = 0; i < views.length; i++) {
            View v = views[i];

            if (v.getName().equals(getViewName())) {
                if (getVerbose()) {
                    log("Found " + getProjectName() + delim + getViewName() + delim);
                }
                runType(s, p, v, s.typeForName(s.getTypeNames().FILE));
                break;
View Full Code Here

            throw new BuildException("'revisionlabel' and 'buildlabel' "
                + "both specified.  A revision label cannot be a build label.");
        }

        try {
            View snapshot = openView();

            // Create the new label and update the repository

            if (this.revisionlabel) {
                new Label(snapshot, this.labelName, this.description).update();
View Full Code Here

        int labelID = getLabelID(raw);

        // if a label has been supplied and it is a view label, use it
        // to configure the view
        if (this.isUsingViewLabel()) {
            return new View(raw, ViewConfiguration.createFromLabel(labelID));
        }
        // if a label has been supplied and it is a revision label, use the raw
        // the view as the snapshot
        else if (this.isUsingRevisionLabel()) {
            return raw;
        }
        // if a date has been supplied use a view configured to the date.
        View view = getViewConfiguredByDate(raw);
        if (view != null) {
            return view;
        }
        // otherwise, use this view configured as the tip.
        else {
            return new View(raw, ViewConfiguration.createTip());
        }
    }
View Full Code Here

     * @see #getServer()
     */
    protected View openView() throws BuildException {

        logStarteamVersion();
        View view = null;
        try {
            view = StarTeamFinder.openView(getViewURL());
        } catch (Exception e) {
            throw new BuildException(
                "Failed to connect to " + getURL(), e);
        }

        if (null == view) {
            throw new BuildException("Cannot find view" + getURL()
                + " in repository()");
        }

        View snapshot = createSnapshotView(view);
        log("Connected to StarTeam view " + getURL(),
            Project.MSG_VERBOSE);
        this.server = snapshot.getServer();
        return snapshot;
    }
View Full Code Here

        int labelID = getLabelID(raw);

        // if a label has been supplied, use it to configure the view
        // otherwise use current view
        if (labelID >= 0) {
            return new View(raw, ViewConfiguration.createFromLabel(labelID));
        }
        // if a date has been supplied use a view configured to the date.
        View view = getViewConfiguredByDate(raw);
        if (view != null) {
            return view;
        }
        // otherwise, use this view configured as the tip.
        else {
            return new View(raw, ViewConfiguration.createTip());
        }
    }
View Full Code Here

                                         + this.asOfDate
                                         + " not parsable by default"
                                         + " ISO8601 formats");
            }
        }
        return new View(raw, ViewConfiguration.createFromTime(
            new OLEDate(asOfDate)));
    }
View Full Code Here

    private final Folder configureRootStarteamFolder()
        throws BuildException {
        Folder starteamrootfolder = null;
        try {
            // no root local mapping has been specified.
            View snapshot = openView();

            // find the starteam folder specified to be the root of the
            // operation.  Throw if it can't be found.

            starteamrootfolder =
                    StarTeamFinder.findFolder(snapshot.getRootFolder(),
                            this.rootStarteamFolder);

            if (this.isPreloadFileInformation()) {
                PropertyNames pn = getServer().getPropertyNames();
                String[] props = new String[] {pn.FILE_NAME, pn.FILE_PATH,
View Full Code Here

     *
     * @param raw the unconfigured <code>View</code>
     * @return the snapshot <code>View</code> appropriately configured.
     */
    protected View createSnapshotView(View raw) {
        return new View(raw, ViewConfiguration.createTip());
    }
View Full Code Here

     * @see #getServer()
     */
    protected View openView() throws BuildException {

        logStarteamVersion();
        View view = null;
        try {
            view = StarTeamFinder.openView(getViewURL());
        } catch (Exception e) {
            throw new BuildException(
                "Failed to connect to " + getURL(), e);
        }

        if (null == view) {
            throw new BuildException("Cannot find view" + getURL() +
                    " in repository()");
        }

        View snapshot = createSnapshotView(view);
        this.server = snapshot.getServer();
        return snapshot;
    }
View Full Code Here

TOP

Related Classes of com.starbase.starteam.View

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.