code: public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, String name) throws CmsException {
  
          CmsPropertyDefinition propertyDefinition = null;
  
          name = name.trim();
          // validate the property name
          CmsPropertyDefinition.checkPropertyName(name);
          // TODO: make the type a parameter
          try {
              try {
                  propertyDefinition = getVfsDriver(dbc).readPropertyDefinition(
                      dbc,
                      name,
                      dbc.currentProject().getUuid());
              } catch (CmsException e) {
                  propertyDefinition = getVfsDriver(dbc).createPropertyDefinition(
                      dbc,
                      dbc.currentProject().getUuid(),
                      name,
                      CmsPropertyDefinition.TYPE_NORMAL);
              }
  
              try {
                  getVfsDriver(dbc).readPropertyDefinition(dbc, name, CmsProject.ONLINE_PROJECT_ID);
              } catch (CmsException e) {
                  getVfsDriver(dbc).createPropertyDefinition(
                      dbc,
                      CmsProject.ONLINE_PROJECT_ID,
                      name,
                      CmsPropertyDefinition.TYPE_NORMAL);
              }
  
              try {
                  getHistoryDriver(dbc).readPropertyDefinition(dbc, name);
              } catch (CmsException e) {
                  getHistoryDriver(dbc).createPropertyDefinition(dbc, name, CmsPropertyDefinition.TYPE_NORMAL);
              }
          } finally {
  
              // fire an event that a property of a resource has been deleted
              OpenCms.fireCmsEvent(
                  new CmsEvent(
                      I_CmsEventListener.EVENT_PROPERTY_DEFINITION_CREATED,
                      Collections.<String, Object> singletonMap("propertyDefinition", propertyDefinition)));
  
          }
  
          return propertyDefinition;
      }
docs: Creates a property definition.<p>
  
  Property definitions are valid for all resource types.<p>
  
  @param dbc the current database context
  @param name the name of the property definition to create
  
  @return the created property definition
  
  @throws CmsException if something goes wrong