docs: public static void fillItemDefault(Item resourceItem, CmsObject cms, CmsResource resource, Locale locale) {
  
          if (resource == null) {
              LOG.error("Error rendering item for 'null' resource");
              return;
          }
  
          if (resourceItem == null) {
              LOG.error("Error rendering 'null' item for resource " + resource.getRootPath());
              return;
          }
          if (cms == null) {
              cms = A_CmsUI.getCmsObject();
              LOG.warn("CmsObject was 'null', using thread local CmsObject");
          }
          CmsResourceUtil resUtil = new CmsResourceUtil(cms, resource);
          Map<String, CmsProperty> resourceProps = null;
          try {
              List<CmsProperty> props = cms.readPropertyObjects(resource, false);
              resourceProps = new HashMap<String, CmsProperty>();
              for (CmsProperty prop : props) {
                  resourceProps.put(prop.getName(), prop);
              }
          } catch (CmsException e1) {
              LOG.debug("Unable to read properties for resource '" + resource.getRootPath() + "'.", e1);
          }
          I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource);
          if (resourceItem.getItemProperty(PROPERTY_TYPE_ICON) != null) {
              resourceItem.getItemProperty(PROPERTY_TYPE_ICON).setValue(
                  new CmsResourceIcon(resUtil, resource.getState(), true));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_PROJECT) != null) {
              Label projectFlag = null;
              switch (resUtil.getProjectState().getMode()) {
                  case 1:
                      projectFlag = new Label(
                          new CmsCssIcon(OpenCmsTheme.ICON_PROJECT_CURRENT).getHtml(resUtil.getLockedInProjectName()),
                          ContentMode.HTML);
                      break;
                  case 2:
                      projectFlag = new Label(
                          new CmsCssIcon(OpenCmsTheme.ICON_PROJECT_OTHER).getHtml(resUtil.getLockedInProjectName()),
                          ContentMode.HTML);
                      break;
                  case 5:
                      projectFlag = new Label(
                          new CmsCssIcon(OpenCmsTheme.ICON_PUBLISH).getHtml(resUtil.getLockedInProjectName()),
                          ContentMode.HTML);
                      break;
                  default:
              }
              resourceItem.getItemProperty(PROPERTY_PROJECT).setValue(projectFlag);
          }
  
          if (resourceItem.getItemProperty(PROPERTY_INSIDE_PROJECT) != null) {
              resourceItem.getItemProperty(PROPERTY_INSIDE_PROJECT).setValue(Boolean.valueOf(resUtil.isInsideProject()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_RELEASED_NOT_EXPIRED) != null) {
              resourceItem.getItemProperty(PROPERTY_RELEASED_NOT_EXPIRED).setValue(
                  Boolean.valueOf(resUtil.isReleasedAndNotExpired()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_RESOURCE_NAME) != null) {
              resourceItem.getItemProperty(PROPERTY_RESOURCE_NAME).setValue(resource.getName());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_SITE_PATH) != null) {
              resourceItem.getItemProperty(PROPERTY_SITE_PATH).setValue(cms.getSitePath(resource));
          }
  
          if ((resourceItem.getItemProperty(PROPERTY_TITLE) != null) && (resourceProps != null)) {
              resourceItem.getItemProperty(PROPERTY_TITLE).setValue(
                  resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_TITLE)
                  ? resourceProps.get(CmsPropertyDefinition.PROPERTY_TITLE).getValue()
                  : "");
          }
          boolean inNavigation = false;
          if ((resourceItem.getItemProperty(PROPERTY_NAVIGATION_TEXT) != null) && (resourceProps != null)) {
              resourceItem.getItemProperty(PROPERTY_NAVIGATION_TEXT).setValue(
                  resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVTEXT)
                  ? resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVTEXT).getValue()
                  : "");
              inNavigation = resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVTEXT);
          }
  
          if ((resourceItem.getItemProperty(PROPERTY_NAVIGATION_POSITION) != null) && (resourceProps != null)) {
              try {
                  Float navPos = resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVPOS)
                  ? Float.valueOf(resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVPOS).getValue())
                  : (inNavigation ? Float.valueOf(Float.MAX_VALUE) : null);
                  resourceItem.getItemProperty(PROPERTY_NAVIGATION_POSITION).setValue(navPos);
                  inNavigation = navPos != null;
              } catch (Exception e) {
                  LOG.debug("Error evaluating navPos property", e);
              }
          }
  
          if (resourceItem.getItemProperty(PROPERTY_IN_NAVIGATION) != null) {
              if (inNavigation
                  && (resourceProps != null)
                  && resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_NAVINFO)
                  && CmsClientSitemapEntry.HIDDEN_NAVIGATION_ENTRY.equals(
                      resourceProps.get(CmsPropertyDefinition.PROPERTY_NAVINFO).getValue())) {
                  inNavigation = false;
              }
              resourceItem.getItemProperty(PROPERTY_IN_NAVIGATION).setValue(Boolean.valueOf(inNavigation));
          }
  
          if ((resourceItem.getItemProperty(PROPERTY_COPYRIGHT) != null) && (resourceProps != null)) {
              resourceItem.getItemProperty(PROPERTY_COPYRIGHT).setValue(
                  resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_COPYRIGHT)
                  ? resourceProps.get(CmsPropertyDefinition.PROPERTY_COPYRIGHT).getValue()
                  : "");
          }
  
          if ((resourceItem.getItemProperty(PROPERTY_CACHE) != null) && (resourceProps != null)) {
              resourceItem.getItemProperty(PROPERTY_CACHE).setValue(
                  resourceProps.containsKey(CmsPropertyDefinition.PROPERTY_CACHE)
                  ? resourceProps.get(CmsPropertyDefinition.PROPERTY_CACHE).getValue()
                  : "");
          }
  
          if (resourceItem.getItemProperty(PROPERTY_RESOURCE_TYPE) != null) {
              resourceItem.getItemProperty(PROPERTY_RESOURCE_TYPE).setValue(
                  CmsWorkplaceMessages.getResourceTypeName(locale, type.getTypeName()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_IS_FOLDER) != null) {
              resourceItem.getItemProperty(PROPERTY_IS_FOLDER).setValue(Boolean.valueOf(resource.isFolder()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_SIZE) != null) {
              if (resource.isFile()) {
                  resourceItem.getItemProperty(PROPERTY_SIZE).setValue(Integer.valueOf(resource.getLength()));
              }
          }
  
          if (resourceItem.getItemProperty(PROPERTY_PERMISSIONS) != null) {
              resourceItem.getItemProperty(PROPERTY_PERMISSIONS).setValue(resUtil.getPermissionString());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_DATE_MODIFIED) != null) {
              resourceItem.getItemProperty(PROPERTY_DATE_MODIFIED).setValue(Long.valueOf(resource.getDateLastModified()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_USER_MODIFIED) != null) {
              resourceItem.getItemProperty(PROPERTY_USER_MODIFIED).setValue(resUtil.getUserLastModified());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_DATE_CREATED) != null) {
              resourceItem.getItemProperty(PROPERTY_DATE_CREATED).setValue(Long.valueOf(resource.getDateCreated()));
          }
  
          if (resourceItem.getItemProperty(PROPERTY_USER_CREATED) != null) {
              resourceItem.getItemProperty(PROPERTY_USER_CREATED).setValue(resUtil.getUserCreated());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_DATE_RELEASED) != null) {
              long release = resource.getDateReleased();
              if (release != CmsResource.DATE_RELEASED_DEFAULT) {
                  resourceItem.getItemProperty(PROPERTY_DATE_RELEASED).setValue(Long.valueOf(release));
              } else {
                  resourceItem.getItemProperty(PROPERTY_DATE_RELEASED).setValue(null);
              }
          }
  
          if (resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED) != null) {
              long expire = resource.getDateExpired();
              if (expire != CmsResource.DATE_EXPIRED_DEFAULT) {
                  resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED).setValue(Long.valueOf(expire));
              } else {
                  resourceItem.getItemProperty(PROPERTY_DATE_EXPIRED).setValue(null);
              }
          }
  
          if (resourceItem.getItemProperty(PROPERTY_STATE_NAME) != null) {
              resourceItem.getItemProperty(PROPERTY_STATE_NAME).setValue(resUtil.getStateName());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_STATE) != null) {
              resourceItem.getItemProperty(PROPERTY_STATE).setValue(resource.getState());
          }
  
          if (resourceItem.getItemProperty(PROPERTY_USER_LOCKED) != null) {
              resourceItem.getItemProperty(PROPERTY_USER_LOCKED).setValue(resUtil.getLockedByName());
          }
      }