package org.jenkinsci.plugins.p4.workspace; 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; import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.AutoCompletionCandidates; import hudson.model.Descriptor; import hudson.util.ListBoxModel; import org.jenkinsci.plugins.p4.client.ConnectionFactory; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class WorkspaceSpec extends AbstractDescribableImpl<WorkspaceSpec> implements Serializable { private static final long serialVersionUID = 1L; 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 getStreamName() { 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. * @return suggestion */ 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 | |
---|---|---|---|---|---|
#3 | 22326 | Paul Allen | Merging down using p4-jenkins | ||
#2 | 22025 | Paul Allen |
Polling test for Graph. Added commit support for graph enabled client (used in the polling test, but not ready for users). |
||
#1 | 21940 | Paul Allen | Branching using p4-jenkins | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/workspace/WorkspaceSpec.java | |||||
#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. |