code: public static FormElement generateForm(I_CmsEditableData editableData, boolean isNew, String target, String mode) {
  
          // create a form to submit a post request to the editor JSP
          Map<String, String> formValues = new HashMap<String, String>();
          if (editableData.getSitePath() != null) {
              formValues.put("resource", editableData.getSitePath());
          }
          if (editableData.getElementLanguage() != null) {
              formValues.put("elementlanguage", editableData.getElementLanguage());
          }
          if (editableData.getElementName() != null) {
              formValues.put("elementname", editableData.getElementName());
          }
  
          // in case the editor is opened within this window, use the current URI as back link
          String backlink = "_self".equals(target)
          ? CmsCoreProvider.get().getUri()
          : CmsCoreProvider.get().getContentEditorBacklinkUrl();
  
          formValues.put("backlink", backlink);
          formValues.put("redirect", "true");
          formValues.put("directedit", "true");
          formValues.put("editcontext", CmsCoreProvider.get().getUri());
          formValues.put("nofoot", "1");
          if (isNew) {
              formValues.put("newlink", editableData.getNewLink());
              formValues.put("editortitle", editableData.getNewTitle());
          }
  
          String postCreateHandler = editableData.getPostCreateHandler();
          if (postCreateHandler != null) {
              formValues.put("postCreateHandler", postCreateHandler);
          }
          if (mode != null) {
              formValues.put("mode", mode);
          }
          FormElement formElement = CmsDomUtil.generateHiddenForm(
              CmsCoreProvider.get().link(CmsCoreProvider.get().getContentEditorUrl()),
              Method.post,
              target,
              formValues);
          return formElement;
      }
docs: Generates the form to post to the editor frame.<p>
  
  @param editableData the data about the resource which should be edited
  @param isNew true if the resource to be edited doesn'T already exist
  @param target the target of the form to be created
  @param mode the mode for creating new elements
  
  @return the form element which, when submitted, opens the editor