code: public static IndexedContainer getProjectsContainer(CmsObject cms, String captionPropertyName) {
  
          IndexedContainer result = new IndexedContainer();
          result.addContainerProperty(captionPropertyName, String.class, null);
          Locale locale = A_CmsUI.get().getLocale();
          List<CmsProject> projects = getAvailableProjects(cms);
          boolean isSingleOu = isSingleOu(projects);
          for (CmsProject project : projects) {
              String projectName = project.getSimpleName();
              if (!isSingleOu && !project.isOnlineProject()) {
                  try {
                      projectName = projectName
                          + " - "
                          + OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
                              locale);
                  } catch (CmsException e) {
                      LOG.debug("Error reading project OU.", e);
                      projectName = projectName + " - " + project.getOuFqn();
                  }
              }
              Item projectItem = result.addItem(project.getUuid());
              projectItem.getItemProperty(captionPropertyName).setValue(projectName);
          }
          return result;
      }
docs: Returns the selectable projects container.<p>
  
  @param cms the CMS context
  @param captionPropertyName the name of the property used to store captions
  
  @return the projects container