org.sonatype.nexus.formfields.StringTextFormField Java Examples

The following examples show how to use org.sonatype.nexus.formfields.StringTextFormField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GoogleCloudBlobStoreDescriptor.java    From nexus-blobstore-google-cloud with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public GoogleCloudBlobStoreDescriptor(final BlobStoreQuotaService quotaService) {
  super(quotaService);
  bucket = new StringTextFormField(
      GoogleCloudBlobStore.BUCKET_KEY,
      messages.bucketName(),
      messages.bucketHelp(),
      FormField.MANDATORY
  );

  location = new StringTextFormField(
      GoogleCloudBlobStore.LOCATION_KEY,
      messages.locationName(),
      messages.locationHelp(),
      FormField.MANDATORY
  ).withInitialValue("us-central1");

  credentialFile = new StringTextFormField(
      GoogleCloudBlobStore.CREDENTIAL_FILE_KEY,
      messages.credentialPath(),
      messages.credentialHelp(),
      FormField.OPTIONAL
  );
}
 
Example #2
Source File: ApplicationPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
public ApplicationPrivilegeDescriptor() {
  super(TYPE);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_DOMAIN,
          messages.domain(),
          messages.domainHelp(),
          FormField.MANDATORY
      ),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #3
Source File: ScriptTaskDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public ScriptTaskDescriptor(final NodeAccess nodeAccess, @Named("${nexus.scripts.allowCreation:-false}") boolean allowCreation) {
  super(TYPE_ID,
      ScriptTask.class,
      messages.name(),
      VISIBLE,
      isExposed(allowCreation),
      new StringTextFormField(
          LANGUAGE,
          messages.languageLabel(),
          messages.languageHelpText(),
          FormField.MANDATORY
      ).withInitialValue(ScriptEngineManagerProvider.DEFAULT_LANGUAGE),
      new TextAreaFormField(
          SOURCE,
          messages.sourceLabel(),
          messages.sourceHelpText(),
          FormField.MANDATORY,
          null,
          !allowCreation
      ),
      nodeAccess.isClustered() ? newMultinodeFormField() : null);
}
 
Example #4
Source File: RepositoryAdminPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RepositoryAdminPrivilegeDescriptor(final RepositoryManager repositoryManager, final List<Format> formats) {
  super(TYPE, repositoryManager, formats);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_FORMAT,
          messages.format(),
          messages.formatHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeAnEntryForAllRepositories(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #5
Source File: RepositoryViewPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Inject
public RepositoryViewPrivilegeDescriptor(final RepositoryManager repositoryManager, final List<Format> formats) {
  super(TYPE, repositoryManager, formats);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_FORMAT,
          messages.format(),
          messages.formatHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeAnEntryForAllRepositories(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #6
Source File: WildcardPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public WildcardPrivilegeDescriptor() {
  super(TYPE);
  this.formFields = ImmutableList.of(
      new StringTextFormField(
          P_PATTERN,
          messages.pattern(),
          messages.patternHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #7
Source File: FileBlobStoreDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public FileBlobStoreDescriptor(final BlobStoreQuotaService quotaService,
                               final ApplicationDirectories applicationDirectories,
                               final BlobStoreUtil blobStoreUtil)
{
  super(quotaService);
  this.applicationDirectories = applicationDirectories;
  this.blobStoreUtil = blobStoreUtil;
  this.path = new StringTextFormField(
      PATH_KEY,
      messages.pathLabel(),
      null,
      MANDATORY
  );
}
 
Example #8
Source File: H2BackupTaskDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
public H2BackupTaskDescriptor()
{
  super(TYPE_ID, H2BackupTask.class, "Admin - Backup H2 Database", VISIBLE, EXPOSED, false,
      new ComboboxFormField<String>(
          DATASTORE,
          "Datastore",
          "The datastore to backup",
          MANDATORY
      ).withStoreApi("coreui_Datastore.readH2").withIdMapping("name").withNameMapping("name"),
      new StringTextFormField(LOCATION, "Location",
          "The full path for the database backup zip. May use {datetime} to have the present time included",
          MANDATORY));
}
 
Example #9
Source File: DatabaseBackupTaskDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public DatabaseBackupTaskDescriptor(final NodeAccess nodeAccess)
{
  super(TYPE_ID, DatabaseBackupTask.class, messages.name(), VISIBLE, EXPOSED,
      new StringTextFormField(
          BACKUP_LOCATION,
          messages.locationLabel(),
          messages.locationHelpText(),
          MANDATORY
      ),
      nodeAccess.isClustered() ? newLimitNodeFormField() : null
  );
}
 
Example #10
Source File: RepositoryContentSelectorPrivilegeDescriptor.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Inject
public RepositoryContentSelectorPrivilegeDescriptor(final RepositoryManager repositoryManager,
                                                    final SelectorManager selectorManager,
                                                    final List<Format> formats)
{
  super(TYPE, repositoryManager, formats);
  this.selectorManager = checkNotNull(selectorManager);
  this.formFields = ImmutableList.of(
      new SelectorComboFormField(
          P_CONTENT_SELECTOR,
          messages.contentSelector(),
          messages.contentSelectorHelp(),
          FormField.MANDATORY
      ),
      new RepositoryCombobox(
          P_REPOSITORY,
          messages.repository(),
          messages.repositoryHelp(),
          true
      ).includeEntriesForAllFormats(),
      new StringTextFormField(
          P_ACTIONS,
          messages.actions(),
          messages.actionsHelp(),
          FormField.MANDATORY
      )
  );
}
 
Example #11
Source File: S3BlobStoreDescriptor.java    From nexus-blobstore-s3 with Eclipse Public License 1.0 4 votes vote down vote up
public S3BlobStoreDescriptor() {
  this.bucket = new StringTextFormField(
      S3BlobStore.BUCKET_KEY,
      messages.bucketLabel(),
      messages.bucketHelp(),
      FormField.MANDATORY
  );
  this.accessKeyId = new StringTextFormField(
      S3BlobStore.ACCESS_KEY_ID_KEY,
      messages.accessKeyIdLabel(),
      messages.accessKeyIdHelp(),
      FormField.OPTIONAL
  );
  this.secretAccessKey = new PasswordFormField(
      S3BlobStore.SECRET_ACCESS_KEY_KEY,
      messages.secretAccessKeyLabel(),
      messages.secretAccessKeyHelp(),
      FormField.OPTIONAL
  );
  this.assumeRole = new StringTextFormField(
      S3BlobStore.ASSUME_ROLE_KEY,
      messages.assumeRoleLabel(),
      messages.assumeRoleHelp(),
      FormField.OPTIONAL
  );
  this.sessionToken = new StringTextFormField(
      S3BlobStore.SESSION_TOKEN_KEY,
      messages.sessionTokenLabel(),
      messages.sessionTokenHelp(),
      FormField.OPTIONAL
  );
  this.region = new StringTextFormField(
      S3BlobStore.REGION_KEY,
      messages.regionLabel(),
      messages.regionHelp(),
      FormField.OPTIONAL
  );
  this.endpoint = new StringTextFormField(
      S3BlobStore.ENDPOINT_KEY,
      messages.endpointLabel(),
      messages.endpointHelp(),
      FormField.OPTIONAL
  );
  this.expiration = new NumberTextFormField(
      S3BlobStore.EXPIRATION_KEY,
      messages.expirationLabel(),
      messages.expirationHelp(),
      FormField.OPTIONAL)
      .withInitialValue(S3BlobStore.DEFAULT_EXPIRATION_IN_DAYS)
      .withMinimumValue(-1);
}
 
Example #12
Source File: RebuildMaven2MetadataTaskDescriptor.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
public RebuildMaven2MetadataTaskDescriptor() {
  super(TYPE_ID,
      RebuildMaven2MetadataTask.class,
      "Repair - Rebuild Maven repository metadata (maven-metadata.xml)",
      VISIBLE,
      EXPOSED,
      new RepositoryCombobox(
          REPOSITORY_NAME_FIELD_ID,
          "Repository",
          "Select the hosted Maven repository to rebuild metadata",
          true
      ).includingAnyOfFormats(Maven2Format.NAME).includingAnyOfTypes(HostedType.NAME)
          .includeAnEntryForAllRepositories(),
      new StringTextFormField(
          GROUPID_FIELD_ID,
          "GroupId",
          "Maven groupId to narrow operation (limit to given groupId only)",
          false
      ),
      new StringTextFormField(
          ARTIFACTID_FIELD_ID,
          "ArtifactId (only if GroupId given)",
          "Maven artifactId to narrow operation (limit to given groupId:artifactId, only used if groupId set)",
          false
      ),
      new StringTextFormField(
          BASEVERSION_FIELD_ID,
          "Base Version (only if ArtifactId given)",
          "Maven base version to narrow operation (limit to given groupId:artifactId:baseVersion, used if groupId " +
              "and artifactId set!)",
          false
      ),
      new CheckboxFormField(
          REBUILD_CHECKSUMS,
          "Rebuild checksums",
          "Compare maven checksum files with recorded metadata, creating files if they are missing and updating " +
              "them if they are incorrect. This can significantly increase the time needed for this task.",
          OPTIONAL
      ).withInitialValue(false)
  );
}
 
Example #13
Source File: SettingsCapabilityDescriptor.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
public SettingsCapabilityDescriptor() {
  formFields = Lists.<FormField>newArrayList(
      new StringTextFormField(
          SettingsCapabilityConfiguration.TITLE,
          messages.titleLabel(),
          messages.titleHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_TITLE),
      new CheckboxFormField(
          SettingsCapabilityConfiguration.DEBUG_ALLOWED,
          messages.debugAllowedLabel(),
          messages.debugAllowedHelp(),
          FormField.OPTIONAL
      ).withInitialValue(RaptureSettings.DEFAULT_DEBUG_ALLOWED),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.STATUS_INTERVAL_AUTHENTICATED,
          messages.statusIntervalAuthenticatedLabel(),
          messages.statusIntervalAuthenticatedHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_STATUS_INTERVAL_AUTHENTICATED),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.STATUS_INTERVAL_ANONYMOUS,
          messages.statusIntervalAnonymousLabel(),
          messages.statusIntervalAnonymousHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_STATUS_INTERVAL_ANONYMOUS),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.SESSION_TIMEOUT,
          messages.sessionTimeoutLabel(),
          messages.sessionTimeoutHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_SESSION_TIMEOUT),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.REQUEST_TIMEOUT,
          messages.requestTimeoutLabel(),
          messages.requestTimeoutHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_REQUEST_TIMEOUT)
          .withMinimumValue(RaptureSettings.MIN_REQUEST_TIMEOUT),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.LONG_REQUEST_TIMEOUT,
          messages.longRequestTimeoutLabel(),
          messages.longRequestTimeoutHelp(),
          FormField.MANDATORY
      ).withInitialValue(RaptureSettings.DEFAULT_LONG_REQUEST_TIMEOUT)
          .withMinimumValue(RaptureSettings.DEFAULT_LONG_REQUEST_TIMEOUT),
      new NumberTextFormField(
          SettingsCapabilityConfiguration.SEARCH_REQUEST_TIMEOUT,
          messages.searchRequestTimeoutLabel(),
          messages.searchRequestTimeoutHelp(),
          FormField.OPTIONAL
      ).withMinimumValue(RaptureSettings.MIN_SEARCH_REQUEST_TIMEOUT)
  );
}