package org.jenkinsci.plugins.p4.workspace; import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.AutoCompletionCandidates; import hudson.model.Descriptor; import hudson.util.ListBoxModel; import java.util.ArrayList; import java.util.List; import org.jenkinsci.plugins.p4.client.ConnectionFactory; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; import com.perforce.p4java.client.IClientSummary; import com.perforce.p4java.client.IClientSummary.ClientLineEnd; import com.perforce.p4java.core.IStreamSummary; import com.perforce.p4java.option.server.GetStreamsOptions; import com.perforce.p4java.server.IOptionsServer; public class WorkspaceSpec extends AbstractDescribableImpl<WorkspaceSpec> { public final boolean allwrite; public final boolean clobber; public final boolean compress; public final boolean locked; public final boolean modtime; public final boolean rmdir; private final String streamName; private final String line; private final String view; public String getStream() { return streamName; } public String getLine() { return line; } public String getView() { return view; } @DataBoundConstructor public WorkspaceSpec(boolean allwrite, boolean clobber, boolean compress, boolean locked, boolean modtime, boolean rmdir, String streamName, String line, String view) { this.allwrite = allwrite; this.clobber = clobber; this.compress = compress; this.locked = locked; this.modtime = modtime; this.rmdir = rmdir; this.streamName = streamName; this.line = line; this.view = view; } @Extension public static class DescriptorImpl extends Descriptor<WorkspaceSpec> { @Override public String getDisplayName() { return "Perforce Client Spec"; } public ListBoxModel doFillLineItems() { ListBoxModel list = new ListBoxModel(); for (ClientLineEnd end : IClientSummary.ClientLineEnd.values()) { list.add(end.name()); } return list; } /** * Provides auto-completion for workspace names. Stapler finds this * method via the naming convention. * * @param value * The text that the user entered. */ public AutoCompletionCandidates doAutoCompleteStreamName( @QueryParameter String value) { AutoCompletionCandidates c = new AutoCompletionCandidates(); try { IOptionsServer iserver = ConnectionFactory.getConnection(); if (iserver != null && value.length() > 1) { List<String> streamPaths = new ArrayList<String>(); streamPaths.add(value + "..."); GetStreamsOptions opts = new GetStreamsOptions(); opts.setMaxResults(10); List<IStreamSummary> list = iserver.getStreams(streamPaths, opts); for (IStreamSummary l : list) { c.add(l.getStream()); } } } catch (Exception e) { } return c; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#13 | 29848 | Sandeep Kumar |
Merge pull request #195 from jenkinsci/StreamAtChange Support StreamAtChange for ManualWorkspace. |
||
#12 | 24942 | Paul Allen |
Deep clone of Workspace objects. WorkspaceSpec was not cloned and caused the View to change. JENKINS-54695 |
||
#11 | 23589 | Paul Allen |
Remove forced clobber and set default clobber option to true. JENKINS-49041 |
||
#10 | 23372 | Paul Allen | Add setter to modify workspace name and spec. | ||
#9 | 22866 | Paul Allen |
Merge pull request #55 from jenkinsci/hth Global Pipeline Library support. JENKINS-46121 JENKINS-46550 |
||
#8 | 22684 | Paul Allen | Added @Symbol to Extension classes for Pipeline Syntax. | ||
#7 | 22384 | Paul Allen | Remove duplicate code for Stream name auto completion. | ||
#6 | 22163 | Paul Allen |
Manual Workspace support for READONLY and PARTITIONED. Change Type to Enum. JENKINS-39753 |
||
#5 | 22128 | Paul Allen |
Helix Graph support for Jenkins. JENKINS-40354 |
||
#4 | 20308 | Paul Allen |
P4Groovy (experimental) Get a P4 object in groovy. Supporting basic functions: ’run’ (to run perforce commands), ‘fetch’ and ‘save’ (to access Perforce specs). |
||
#3 | 20179 | Paul Allen | Javadoc fixes for java 8 builds. | ||
#2 | 15138 | Paul Allen | Fix: StreamName not shown in Manual Workspace config. | ||
#1 | 9690 | Paul Allen |
[Branching using p4-jenkins] Release 1.0.1 |
||
//guest/paul_allen/dev/p4-jenkins/p4-client/src/main/java/org/jenkinsci/plugins/p4/workspace/WorkspaceSpec.java | |||||
#1 | 9672 | Paul Allen | Refactor name from 'p4_client' to 'p4'. | ||
//guest/paul_allen/dev/p4-jenkins/p4-client/src/main/java/org/jenkinsci/plugins/p4_client/workspace/WorkspaceSpec.java | |||||
#2 | 8756 | Paul Allen | Added Stream field to Manual Workspace config. | ||
#1 | 8749 | Paul Allen |
Split off Worksapce Spec from Manual Workspace configuration into a Property Jelly item. Plan to autoload values based on selected client. |