@Override
  public String doDefault() throws Exception {
    if (isFieldLocked()) {
      return "locked";
    }

    // Set up the context so the view can see it nicely.
    final FieldConfigScheme configScheme = getConfig();
    setGlobal(isGlobalAvailable());
    if (configScheme != null) {
      setName(configScheme.getName());
      setDescription(configScheme.getDescription());

      // Check if this is still editable in "basic" mode
      if (configScheme.isBasicMode()) {
        setBasicMode(true);
        setGlobal(configScheme.isAllProjects());

        final Set issueTypesList = configScheme.getAssociatedIssueTypes();
        setIssuetypes(GenericValueUtils.transformToStrings(issueTypesList, "id"));

        final List projectCategoriesList = configScheme.getAssociatedProjectCategories();
        setProjectCategories(GenericValueUtils.transformToLongIds(projectCategoriesList));

        final List projectsList = configScheme.getAssociatedProjects();
        setProjects(GenericValueUtils.transformToLongIds(projectsList));

        // Set the config
        final MultiMap configMap = configScheme.getConfigsByConfig();
        if (configMap == null) {
          fieldConfigIds = new Long[0];
        } else {
          final Set entries = configScheme.getConfigsByConfig().keySet();
          fieldConfigIds = new Long[entries.size()];
          int i = 0;
          for (final Object entry : entries) {
            final FieldConfig config = (FieldConfig) entry;
            fieldConfigIds[i] = config.getId();
            i++;
          }
        }

      } else {
        // Complex mode
        setBasicMode(false);
        // @TODO
      }
    }

    return super.doDefault();
  }
  public Collection getAllProjects() throws Exception {
    Collection availableProjects = Collections.EMPTY_LIST;

    final Collection projects = projectManager.getProjects();

    if (projects != null) {
      availableProjects = new ArrayList(projects);
      availableProjects =
          CollectionUtils.subtract(availableProjects, getCustomField().getAssociatedProjects());
      final FieldConfigScheme fieldConfigScheme = getFieldConfigScheme();
      if (fieldConfigScheme != null) {
        final List currentlySlectedProjects = fieldConfigScheme.getAssociatedProjects();
        if (currentlySlectedProjects != null) {
          availableProjects.addAll(currentlySlectedProjects);
        }
      }
    }

    return availableProjects;
  }