Package com.tek42.perforce.model

Examples of com.tek42.perforce.model.User


   * @return  A valid perforce group.
   * @throws PerforceException  If there is a problem or the group was not found.
   */
  public Group getGroup(String name) throws PerforceException {
    GroupBuilder builder = new GroupBuilder();
    Group group = builder.build(getPerforceResponse(builder.getBuildCmd(getP4Exe(), name)));
    if(group == null)
      throw new PerforceException("Failed to retrieve group: " + name);

    return group;
  }
View Full Code Here


                return FormValidation.ok();

            Depot depot = getDepotFromRequest(req);
            if (depot != null) {
                try {
                    Label p4Label = depot.getLabels().getLabel(label);
                    if (p4Label.getAccess() == null || p4Label.getAccess().equals(""))
                        return FormValidation.error("Label does not exist");
                } catch (PerforceException e) {
                    return FormValidation.error(
                            "Error accessing perforce while checking label");
                }
View Full Code Here

   *
   * @see com.tek42.perforce.parse.AbstractFormBuilder#buildForm(java.util.Map)
   */
  @Override
  public Label buildForm(Map<String, String> fields) throws PerforceException {
    Label label = new Label();
    label.setName(fields.get("Label"));
    label.setAccess(getField("Access", fields));
    label.setUpdate(getField("Update", fields));
    label.setDescription(getField("Description", fields));
    label.setOptions(getField("Options", fields));
    label.setOwner(getField("Owner", fields));
    label.setRevision(getField("Revision", fields));
    String views = getField("View", fields);
    for(String view : views.split("\n")) {
      label.addView(view);
    }
    return label;
  }
View Full Code Here

   * @return
   * @throws PerforceException
   */
  public Label getLabel(String name) throws PerforceException {
    LabelBuilder builder = new LabelBuilder();
    Label label = builder.build(getPerforceResponse(builder.getBuildCmd(getP4Exe(), name)));
    return label;
  }
View Full Code Here

        rsp.sendRedirect(".");
    }

    public void tagBuild(String tagname, String description, String owner) throws IOException, InterruptedException {
        Label label = new Label();
        label.setName(tagname);
        label.setDescription(description);
        label.setRevision(new Integer(changeNumber).toString());
        if(owner!=null && !owner.equals("")) label.setOwner(owner);

        PerforceSCM scm = getSCM();
        if(scm != null){
            depot.setPassword(scm.getDecryptedP4Passwd(this.getBuild().getProject(), this.getBuild().getBuiltOn()));
        }

        //Only take the depot paths and add them to the view.
        List<String> viewPairs = PerforceSCM.parseProjectPath(view, "workspace");
        for (int i=0; i < viewPairs.size(); i+=2){
            String depotPath = viewPairs.get(i);
            label.addView(depotPath);
        }
        try {
            depot.getLabels().saveLabel(label);
        } catch(PerforceException e) {
            e.printStackTrace();
View Full Code Here

   *
   * @see com.tek42.perforce.parse.AbstractFormBuilder#buildForm(java.util.Map)
   */
  @Override
  public User buildForm(Map<String, String> fields) throws PerforceException {
    User user = new User();
    user.setUsername(getField("User", fields));
    user.setEmail(getField("Email", fields));
    user.setFullName(getField("FullName", fields));
    user.setPassword(getField("Password", fields));
    user.setJobView(getField("JobView", fields));
    user.setReviews(getField("Review", fields));
    return user;
  }
View Full Code Here

    UserBuilder builder = new UserBuilder();

                //check if the user exists first.
                if(!exists(name)) return null;

    User user = builder.build(getPerforceResponse(builder.getBuildCmd(getP4Exe(), name)));
    return user;
  }
View Full Code Here

                    return FormValidation.error(
                            "Unable to check workspace against depot");
                }
               
                // Then, check workspace
                Workspace p4Workspace =
                    depot.getWorkspaces().getWorkspace(workspace, "");
                if (p4Workspace.getAccess() == null ||
                        p4Workspace.getAccess().equals(""))
                    return FormValidation.warning("Workspace does not exist. " +
                            "If \"Let Hudson/Jenkins Manage Workspace View\" is check" +
                            " the workspace will be automatically created.");
            } catch (PerforceException e) {
                return FormValidation.error(
View Full Code Here

            try {
                if (!depot.getStatus().exists(clientspec)) {
                    return FormValidation.error("ClientSpec does not exist");
                }

                Workspace p4Workspace = depot.getWorkspaces().getWorkspace(workspace, "");
                // Warn if workspace exists and is associated with a stream
                if (p4Workspace.getAccess() != null && !p4Workspace.getAccess().equals("") &&
                        p4Workspace.getStream() != null && !p4Workspace.getStream().equals("")) {
                    return FormValidation.warning("Workspace '" + workspace + "' already exists and is associated with a stream. " +
                        "If Jenkins is allowed to manage the workspace view, this workspace will be switched to a local workspace.");
                }
            } catch (PerforceException e) {
                return FormValidation.error(
View Full Code Here

            try {
                if (!depot.getStatus().exists(stream)) {
                    return FormValidation.error("Stream does not exist");
                }

                Workspace p4Workspace = depot.getWorkspaces().getWorkspace(workspace, "");
                // Warn if workspace exists and is not associated with a stream
                if (p4Workspace.getAccess() != null && !p4Workspace.getAccess().equals("") &&
                        (p4Workspace.getStream() == null || p4Workspace.getStream().equals(""))) {
                    return FormValidation.warning("Workspace '" + workspace + "' already exists and is not associated with a stream. " +
                        "If Jenkins is allowed to manage the workspace view, this workspace will be switched to a stream workspace.");
                }
            } catch (PerforceException e) {
                return FormValidation.error(
View Full Code Here

TOP

Related Classes of com.tek42.perforce.model.User

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.