Examples of InfoReader


Examples of de.bananaco.permissions.info.InfoReader

      pm = new WorldPermissionsManager(this);

    pm.engage();

    if (info == null)
      info = new InfoReader();

    info.instantiate();
    PermissionsPlayerListener pl = new PermissionsPlayerListener(this);

    getServer().getPluginManager().registerEvent(
View Full Code Here

Examples of de.bananaco.permissions.info.InfoReader

  @Override
  public void onLoad() {
    pm = new WorldPermissionsManager(this);
    perm = pm;
    info = new InfoReader();
    PermissionBridge.loadPseudoPlugin(this, getClassLoader());
  }
View Full Code Here

Examples of de.bananaco.permissions.info.InfoReader

     
      String group = "", user = "";
        Player player = plugin.getServer().getPlayer(resident.getName());
       
        //PermissionSet bPermPM = Permissions.getWorldPermissionsManager().getPermissionSet(player.getWorld());
        InfoReader bPermIR = Permissions.getInfoReader();
       
        if (node == "prefix") {
          group = bPermIR.getGroupPrefix(getPlayerGroup(player), player.getWorld().getName());
          user = bPermIR.getPrefix(player);
        } else if (node == "suffix") {
          group = bPermIR.getGroupSuffix(getPlayerGroup(player), player.getWorld().getName());
          user = bPermIR.getSuffix(player);
        }
        if (group == null) group = "";
        if (user == null) user = "";
     
      if (!group.equals(user))
View Full Code Here

Examples of de.bananaco.permissions.info.InfoReader

     */
    @Override
    public int getGroupPermissionIntNode(String playerName, String node) {
      Player player = plugin.getServer().getPlayer(playerName);
   
    InfoReader bPermIR = Permissions.getInfoReader();
   
    String result = bPermIR.getValue(player, node);
   
    try {
      return Integer.parseInt(result);
    } catch (NumberFormatException e) {
      return -1;
View Full Code Here

Examples of de.bananaco.permissions.info.InfoReader

     */
    @Override
    public String getPlayerPermissionStringNode(String playerName, String node) {
      Player player = plugin.getServer().getPlayer(playerName);
   
    InfoReader bPermIR = Permissions.getInfoReader();
   
    String result =  bPermIR.getValue(player, node);
        
    if (result == null)
      return "";
   
    return result;
View Full Code Here

Examples of de.willuhn.jameica.util.InfoReader

        Logger.warn("unable to read " + infos[i] + ", skipping");
        continue;
      }

      try {
        InfoReader ir = new InfoReader(new FileInputStream(infos[i]));
        buffer.append("<p>");
        buffer.append("<b>" + ir.getName() + "</b>");
        buffer.append("<br/>" + ir.getDescription());
        buffer.append("<br/>" + ir.getUrl());
        buffer.append("<br/>" + ir.getLicense());
        buffer.append("</p>");
      }
      catch (Exception e)
      {
        Logger.error("unable to parse " + infos[0],e);
View Full Code Here

Examples of org.boco.seamwebappgen.info.InfoReader

    if (targetDir.endsWith(File.separator))
      this.targetDir = targetDir;
    else
      this.targetDir = targetDir + File.separator;

    infoReader = new InfoReader(sourceDir);
    basePackage = infoReader.getPackage();

    this.messageArea = messageArea;
    this.progressBar = progressBar;
  }
View Full Code Here

Examples of org.boco.seamwebappgen.info.InfoReader

    String textAreaIds = "";
    String printButton = "";
    String hiddenAttributes = "";
    String dynamicMenus = "";

    InfoReader infoReader = new InfoReader(sourceDir);

    if (!inPopUp)
    {
      template = "." + File.separator + "templates" + File.separator + "Seam_Form.xhtml";
      sourceForm = sourceDir + ".." + File.separator + "html" + File.separator + bean.getName() + ".xhtml";
      targetForm = targetDir + "html" + File.separator + bean.getName() + ".xhtml";
    }
    else
    {
      template = "." + File.separator + "templates" + File.separator + "Seam_FormInPopUp.xhtml";
      sourceForm = sourceDir + ".." + File.separator + "html" + File.separator + bean.getName() + "InPopUp.xhtml";
      targetForm = targetDir + "html" + File.separator + bean.getName() + "InPopUp.xhtml";
    }

    Vector<CodeChunk> codeChunks = new Vector<CodeChunk>();

    // Recupera il codice custom nella pagina
    LinkedList<String> yourJavaScriptCode = Utils.getYourCode(sourceForm, CustomCodeType.JAVA);
    LinkedList<String> yourCode = Utils.getYourCode(sourceForm, CustomCodeType.JSP);

    /** Predispone la lista di tutti gli attributi da inserire nel form **/
    /** I campi Transient sono gestiti in questa sezione **/
    for (int i = 0; i < bean.getAttributes().size(); i++)
    {
      Attribute attribute = bean.getAttributes().get(i);

      if (!attribute.isKey() && (attribute.getImplementationType() != AttributeImplementationType.HIDEINFORM))
      {
        CodeChunk codeChunk = new CodeChunk(attribute.getOrderInForm());

        codeChunk.addHtmlCode("\t<tr><td width=\"100%\">\r\n");

        codeChunk.addHtmlCode("\t\t<rich:panel rendered=\"#{");

        codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE'");
        if (!attribute.getOnCreateIf().equals(""))
          codeChunk.addHtmlCode(" and " + attribute.getOnCreateIf());
        codeChunk.addHtmlCode(")");

        codeChunk.addHtmlCode(" or ");

        codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'");
        if (!attribute.getOnEditIf().equals(""))
          codeChunk.addHtmlCode(" and " + attribute.getOnEditIf());
        codeChunk.addHtmlCode(")");

        codeChunk.addHtmlCode(" or ");

        codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
        if (!attribute.getOnDisplayIf().equals(""))
          codeChunk.addHtmlCode(" and " + attribute.getOnDisplayIf());
        codeChunk.addHtmlCode(")");

        codeChunk.addHtmlCode(" or ");

        codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
        if (!attribute.getOnDeleteIf().equals(""))
          codeChunk.addHtmlCode(" and " + attribute.getOnDeleteIf());
        codeChunk.addHtmlCode(")");

        codeChunk.addHtmlCode("}\" >\r\n");

        codeChunk.addHtmlCode("\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n");
        codeChunk.addHtmlCode("\t\t\t<tr>\r\n");
        codeChunk.addHtmlCode("\t\t\t<td class=\"formFieldLabel\" >\r\n");
        codeChunk.addHtmlCode("\t\t\t\t<h:outputLabel for=\"" + attribute.getName() + "\"  value=\"#{msgs.form_" + bean.getName() + attribute.SeamLabel() + "}\" />\r\n");
        codeChunk.addHtmlCode("\t\t\t</td>\r\n");

        codeChunk.addHtmlCode("\t\t\t<td width=\"1%\">\r\n");
        if (attribute.isRequired())
          codeChunk.addHtmlCode("\t\t\t\t<h:outputText value=\"*\"  rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE' or " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" style=\"color: red; font-weight: bold;\" />\r\n");
        codeChunk.addHtmlCode("\t\t\t</td>\r\n");

        if (attribute.getImplementationType() == AttributeImplementationType.TEXTAREA || attribute.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
        {
          if (attribute.getType().equals("java.lang.String"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true));
            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
            if (!attribute.getOnDisplayIf().equals(""))
              codeChunk.addHtmlCode(" and " + attribute.getOnDisplayIf());
            codeChunk.addHtmlCode(")");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
            if (!attribute.getOnDeleteIf().equals(""))
              codeChunk.addHtmlCode(" and " + attribute.getOnDeleteIf());
            codeChunk.addHtmlCode(")");

            codeChunk.addHtmlCode("}\" ");

            if (attribute.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
            {
              if (!textAreaIds.equals(""))
                textAreaIds += ",";
              textAreaIds += "form:" + attribute.getName() + "";

              codeChunk.addHtmlCode(" escape=\"false\" ");
            }

            codeChunk.addHtmlCode("/>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }
        }

        if (attribute.getImplementationType() == AttributeImplementationType.LISTBOX)
        {
          codeChunk.addHtmlCode("\t\t\t<td>\r\n");

          codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true));
          /**         
                    codeChunk.addHtmlCode("\t\t\t\t<h:selectOneMenu id=\"" + attribute.getName() + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + attribute.getName() + "}\" styleClass=\"formField\" ");

                    codeChunk.addHtmlCode(" required=\"#{" + attribute.isRequired() + " and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation!=\'DELETE\'}\"");

                    codeChunk.addHtmlCode(" rendered=\"#{");

                    codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE'");
                    if (!attribute.getOnCreateIf().equals(""))
                      codeChunk.addHtmlCode(" and " + attribute.getOnCreateIf());
                    codeChunk.addHtmlCode(")");

                    codeChunk.addHtmlCode(" or ");

                    codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'");
                    if (!attribute.getOnEditIf().equals(""))
                      codeChunk.addHtmlCode(" and " + attribute.getOnEditIf());
                    codeChunk.addHtmlCode(")");

                    codeChunk.addHtmlCode("}\" >\r\n");

                    codeChunk.addHtmlCode("\t\t\t\t\t<f:selectItem itemValue=\"\"  itemLabel=\"#{msgs.Application_noSelectionLabel}\" />\r\n");

                    for (String option : attribute.getLabels())
                    {
                      codeChunk.addHtmlCode("\t\t\t\t\t<f:selectItem itemValue=\"" + option + "\"  itemLabel=\"" + option + "\"/>\r\n");
                    }

                   
                    if (!attribute.getAjaxEvent().equals(""))
                    {
                      codeChunk.addHtmlCode("\t\t\t\t\t"+addAjaxSupport(attribute.getAjaxEvent(), attribute.getIdsToRerenderOnAjaxEvent())+"\r\n");
                    }
                   
                    codeChunk.addHtmlCode("\t\t\t\t</h:selectOneMenu>\r\n");
          **/
          codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
          if (!attribute.getOnDisplayIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnDisplayIf());
          codeChunk.addHtmlCode(")");

          codeChunk.addHtmlCode(" or ");

          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
          if (!attribute.getOnDeleteIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnDeleteIf());
          codeChunk.addHtmlCode(")");

          codeChunk.addHtmlCode("}\" ");

          codeChunk.addHtmlCode("/>\r\n");

          codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
          codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

          codeChunk.addHtmlCode("\t\t\t</td>\r\n");
        }

        if (attribute.getImplementationType() == AttributeImplementationType.TEXT)
        {
          if (attribute.getType().equals("java.lang.Boolean"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().equals("java.lang.String"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");

            codeChunk.addHtmlCode("}\" ");

            codeChunk.addHtmlCode("/>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().equals("java.util.Date"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");

            codeChunk.addHtmlCode("\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");

            codeChunk.addHtmlCode("}\" ");

            codeChunk.addHtmlCode(">\r\n");

            if (!attribute.isFormFormatOff())
              codeChunk.addHtmlCode("\t\t\t\t\t<s:convertDateTime pattern=\"#{msgs.Application_DateFormat}\"/>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t</h:outputText>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().equals("java.lang.Double"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");

            codeChunk.addHtmlCode("}\" ");

            codeChunk.addHtmlCode(">\r\n");

            codeChunk.addHtmlCode("\t\t\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t\t</h:outputText>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().equals("java.lang.Long"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");

            codeChunk.addHtmlCode("}\" ");

            codeChunk.addHtmlCode(">\r\n");

            if (!attribute.isFormFormatOff())
              codeChunk.addHtmlCode("\t\t\t\t<f:converter converterId=\"LongConverter\"/>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t\t</h:outputText>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().equals("java.lang.Integer"))
          {
            codeChunk.addHtmlCode("\t\t\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:outputText id=\"" + attribute.getName() + "Display\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" rendered=\"#{");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");

            codeChunk.addHtmlCode(" or ");

            codeChunk.addHtmlCode(Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");

            codeChunk.addHtmlCode("}\" ");

            codeChunk.addHtmlCode(">\r\n");

            if (!attribute.isFormFormatOff())
              codeChunk.addHtmlCode("\t\t\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t\t</h:outputText>\r\n");

            codeChunk.addHtmlCode("\t\t\t\t<br />\r\n");
            codeChunk.addHtmlCode("\t\t\t\t<h:message for=\"" + attribute.getName() + "\" errorClass=\"rich-messages-label\" />\r\n");

            codeChunk.addHtmlCode("\t\t\t</td>\r\n");
          }

          if (attribute.getType().contains("UploadedFile") || attribute.getType().contains("org.boco.seamUtility.upload.UploadedFile"))
          {
            /**
             * Gestione degli upload / download dal form
             */
            usesUpload = "enctype=\"multipart/form-data\"";

            if (bean.getRelationship(Utils.makeGet(bean.getName() + "Upload")) == null)
            {
              // Piu' allegati

              codeChunk.addHtmlCode("\t\t\t<td>\r\n");

              codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");

              codeChunk.addHtmlCode("\t\t\t\t<h:dataTable var=\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload\"  value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Uploads}\" >\r\n");

              codeChunk.addHtmlCode("\t\t\t\t<h:column>\r\n");

              codeChunk.addHtmlCode("\t\t\t\t\t<h:commandButton action=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm.downloadFile(facesContext)}\" image=\"img/download.png\" rendered=\"#{(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null) and (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm!=null) and ((" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY') or (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'))}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm.fileName}\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm!=null}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t\t<h:outputLabel for=\"delete" + Utils.makeFirstLetterLowerCase(attribute.getName()) + "\" value=\"Rimuovi\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t\t<h:selectBooleanCheckbox for=\"delete" + Utils.makeFirstLetterLowerCase(attribute.getName()) + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm.checkDelete}\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t\t<h:outputLabel for=\"update" + Utils.makeFirstLetterLowerCase(attribute.getName()) + "\" value=\"Sostituisci\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t\t<h:selectBooleanCheckbox for=\"update" + Utils.makeFirstLetterLowerCase(attribute.getName()) + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + Utils.makeFirstLetterLowerCase(attribute.getName()) + "Fm.checkUpdate}\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");

              codeChunk.addHtmlCode("\t\t\t\t</h:column>\r\n");

              codeChunk.addHtmlCode("\t\t\t\t</h:dataTable>\r\n");

              codeChunk.addHtmlCode("\t\t\t</td>\r\n");
            }
            else
            {
              // Un solo allegato

              codeChunk.addHtmlCode("\t\t\t<td>\r\n");

              codeChunk.addHtmlCode("\t\t\t\t" + insertAttribute2Form(attribute, bean.getName(), true) + "\r\n");

              codeChunk.addHtmlCode("\t\t\t\t<h:commandButton action=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + attribute.getName() + "Fm.downloadFile(facesContext)}\" image=\"img/download.png\" rendered=\"#{");

              codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null) and (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + attribute.getName() + "Fm!=null) and ((" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
              if (!attribute.getOnDisplayIf().equals(""))
                codeChunk.addHtmlCode(" and " + attribute.getOnDisplayIf());
              codeChunk.addHtmlCode(")");

              codeChunk.addHtmlCode(" or ");

              codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
              if (!attribute.getOnDeleteIf().equals(""))
                codeChunk.addHtmlCode(" and " + attribute.getOnDeleteIf());
              codeChunk.addHtmlCode("))");

              codeChunk.addHtmlCode("}\" ");

              codeChunk.addHtmlCode("/>\r\n");

              codeChunk.addHtmlCode("\t\t\t\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + attribute.getName() + "Fm.fileName}\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + attribute.getName() + "Fm!=null}\" />\r\n");

              codeChunk.addHtmlCode("\t\t\t\t<h:outputLabel for=\"delete" + attribute.getName() + "\" value=\"Rimuovere\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");
              codeChunk.addHtmlCode("\t\t\t\t<h:selectBooleanCheckbox for=\"delete" + attribute.getName() + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload." + attribute.getName() + "Fm.checkDelete}\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + Utils.makeFirstLetterLowerCase(bean.getName()) + "Upload!=null and " + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'}\" />\r\n");

              codeChunk.addHtmlCode("\t\t\t</td>\r\n");
            }
          }
        }

        /** Campi di sola visualizzazione * */

        if (attribute.getImplementationType() == AttributeImplementationType.READONLY)
        {
          if (attribute.getType().equals("java.lang.String"))
          {
            codeChunk.addHtmlCode("\t<td>\r\n");
            codeChunk.addHtmlCode("\t\t<tr:outputText id=\"" + attribute.getName() + "\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" />\r\n");
            codeChunk.addHtmlCode("\t</td>\r\n");
          }

          if (attribute.getType().equals("java.util.Date"))
          {
            codeChunk.addHtmlCode("\t<trh:cellFormat >\r\n");

            codeChunk.addHtmlCode("\t\t<tr:outputText id=\"" + attribute.getName() + "\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" >\r\n");

            codeChunk.addHtmlCode("\t\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n");

            codeChunk.addHtmlCode("\t\t</tr:outputText>\r\n");

            codeChunk.addHtmlCode("\t</trh:cellFormat>\r\n");
          }
          if (attribute.getType().equals("java.lang.Integer"))
          {
            codeChunk.addHtmlCode("\t<trh:cellFormat >\r\n");

            codeChunk.addHtmlCode("\t\t<tr:outputText id=\"" + attribute.getName() + "\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" >\r\n");

            codeChunk.addHtmlCode("\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n");

            codeChunk.addHtmlCode("\t\t</tr:outputText>\r\n");

            codeChunk.addHtmlCode("\t</trh:cellFormat>\r\n");
          }
          if (attribute.getType().equals("java.lang.Long"))
          {
            codeChunk.addHtmlCode("\t<trh:cellFormat >\r\n");

            codeChunk.addHtmlCode("\t\t<tr:outputText id=\"" + attribute.getName() + "\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" >\r\n");

            codeChunk.addHtmlCode("\t\t\t<f:converter converterId=\"LongConverter\" />\r\n");

            codeChunk.addHtmlCode("\t\t</tr:outputText>\r\n");

            codeChunk.addHtmlCode("\t</trh:cellFormat>\r\n");
          }
          if (attribute.getType().equals("java.lang.Double"))
          {
            codeChunk.addHtmlCode("\t<trh:cellFormat >\r\n");

            codeChunk.addHtmlCode("\t\t<tr:outputText id=\"" + attribute.getName() + "\"   value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + attribute.SeamField() + "}\" >\r\n");

            codeChunk.addHtmlCode("\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n");

            codeChunk.addHtmlCode("\t\t</tr:outputText>\r\n");

            codeChunk.addHtmlCode("\t</trh:cellFormat>\r\n");
          }
        }

        if (attribute.isHelp())
        {
          codeChunk.addHtmlCode("\t\t\t<td width=\"1%\"><h:graphicImage styleClass=\"imageLink\" url=\"img/info.gif\" onclick=\"help('help/form_" + bean.getName() + "_" + attribute.getName() + ".html');\" /></td>\r\n");
        }
        else
        {
          codeChunk.addHtmlCode("\t\t\t<td width=\"1%\"></td>\r\n");
        }

        codeChunk.addHtmlCode("\t\t\t</tr>\r\n");
        codeChunk.addHtmlCode("\t\t\t</table>\r\n");
        codeChunk.addHtmlCode("\t\t</rich:panel>\r\n");
        codeChunk.addHtmlCode("\t</td></tr>\r\n");

        codeChunks.add(codeChunk);
      }
    }

    // Inserisce gli attributi provenienti da relazioni che debbono essere
    // solo visualizzati
    for (int i = 0; i < bean.getShowInFormAttributes().size(); i++)
    {
      ShowAttribute attribute = bean.getShowInFormAttributes().get(i);

      CodeChunk codeChunk = new CodeChunk(attribute.getOrderInForm());

      if (attribute.getRelationship() != null && attribute.getRelationship().isToMany())
      {
        codeChunk.addHtmlCode("\r\n@ShowRelationshipAttributesInForm - Relazione :N non supportata - " + attribute.getRelationship().getName() + "\r\n");
      }
      else
      {
        codeChunk.addHtmlCode("\r\n\t<tr><td width=\"100%\">\r\n");

        if (!attribute.getOnCreateIf().equals("") || !attribute.getOnEditIf().equals("") || !attribute.getOnDisplayIf().equals("") || !attribute.getOnDeleteIf().equals(""))
        {
          codeChunk.addHtmlCode("\t\t<rich:panel width=\"100%\" rendered=\"#{");
          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE'");
          if (!attribute.getOnCreateIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnCreateIf());
          codeChunk.addHtmlCode(")");

          codeChunk.addHtmlCode(" or ");

          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'");
          if (!attribute.getOnEditIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnEditIf());
          codeChunk.addHtmlCode(")");

          codeChunk.addHtmlCode(" or ");

          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
          if (!attribute.getOnDisplayIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnDisplayIf());
          codeChunk.addHtmlCode(")");

          codeChunk.addHtmlCode(" or ");

          codeChunk.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
          if (!attribute.getOnDeleteIf().equals(""))
            codeChunk.addHtmlCode(" and " + attribute.getOnDeleteIf());
          codeChunk.addHtmlCode(")");
          codeChunk.addHtmlCode("}\" >\r\n");
        }
        else
        {
          codeChunk.addHtmlCode("\t<rich:panel>\r\n");
        }

        codeChunk.addHtmlCode("\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n");

        codeChunk.addHtmlCode("\t\t<tr>\r\n");

        codeChunk.addHtmlCode("\t\t<td class=\"formFieldLabel\" >\r\n");
        codeChunk.addHtmlCode("\t\t\t<h:outputLabel value=\"#{msgs.form_" + bean.getName() + "_" + attribute.getQualifiedName().replace(".", "_") + "}\" />\r\n");
        codeChunk.addHtmlCode("\t\t</td>\r\n");

        codeChunk.addHtmlCode("\t\t<td width=\"1%\"></td>\r\n");

        codeChunk.addHtmlCode("\t\t<td>\r\n");
        codeChunk.addHtmlCode("\t\t\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + attribute.getQualifiedName() + "}\" />\r\n");
        codeChunk.addHtmlCode("\t\t</td>\r\n");

        codeChunk.addHtmlCode("\t\t</tr>\r\n");

        codeChunk.addHtmlCode("\t\t</table>\r\n");

        codeChunk.addHtmlCode("\t\t</rich:panel>\r\n");
        codeChunk.addHtmlCode("\t</td></tr>\r\n");
      }

      codeChunks.add(codeChunk);
    }

    // Inserisce gli attributi provenienti da relazioni
    for (int i = 0; i < bean.getRelationships().size(); i++)
    {
      Relationship rel = bean.getRelationships().get(i);

      if (rel.isUsed() && !rel.isMasterDetail())
      {
        CodeChunk codeChunk = null;

        //if ( infoReader.BeanCrudInPopUp(rel.getToBeanName()) )
        if (!rel.isListBox() && rel.isCRUD())
        {
          dynamicMenus += "<a4j:region>\r\n";
          dynamicMenus += "<rich:contextMenu attached=\"false\" id=\"menu" + rel.getName() + "\" submitMode=\"ajax\" >\r\n";

          dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_display}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Display');\">\r\n";
          dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
          dynamicMenus += "\t</rich:menuItem>\r\n\r\n";

          if (rel.getPopUpEdit())
          {
            dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_edit}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Edit');\" rendered=\"#{(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE') or (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT')}\" >\r\n";
            dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
            dynamicMenus += "\t</rich:menuItem>\r\n\r\n";
          }

          if (rel.getPopUpDelete())
          {
            dynamicMenus += "\t<rich:menuItem ajaxSingle=\"true\" value=\"#{msgs.list_" + rel.getToBeanName() + "_delete}\" actionListener=\"#{" + rel.getToBeanName() + "Manager.popupMenuSelectItem}\" requestDelay=\"0\" oncomplete=\"openCrudPopUp_" + rel.getName() + "('Delete');\" rendered=\"#{(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE') or (" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT')}\" >\r\n";
            dynamicMenus += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
            dynamicMenus += "\t</rich:menuItem>\r\n\r\n";
          }

          dynamicMenus += "</rich:contextMenu>\r\n";
          dynamicMenus += "</a4j:region>\r\n";
        }

        if (!rel.isToMany())
        {
          // Relazione :1
          if (rel.isListBox())
          {
            // Relazione :1 implementata come ListBox
            codeChunk = insertSingleSelectionListBox2Form(sourceDir, bean, rel, true, false);
          }
          else
          {
            // Relazione :1 implementata come PopUp
            codeChunk = insertSingleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
            if (rel.isRequired())
              updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
            else
              updatePopUpRelationships += "";
          }
        }
        else
        {
          // Relazione :N
          if (rel.isListBox())
          {
            // Relazione :N implementata come ListBox
            codeChunk = insertMultipleSelectionListBox2Form(bean, rel, true, false);
          }
          else
          {
            // Relazione :N implementata come PopUp
            codeChunk = insertMultipleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
            if (rel.isRequired())
              updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
            else
              updatePopUpRelationships += "";
          }
        }

        codeChunk.setOrder(rel.getOrderInForm());
        codeChunks.add(codeChunk);
      }

      /** Relazioni master-detail in cui nel detail viene inserito anche una popup per la gestione del master **/
      if (rel.isUsed() && rel.isMasterDetail() && rel.getOrderInForm() != 0)
      {
        CodeChunk codeChunk = null;

        if (!rel.isToMany())
        {
          // Relazione :1 implementata come PopUp
          codeChunk = insertSingleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
          if (rel.isRequired())
            updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
          else
            updatePopUpRelationships += "";
        }
        else
        {
          // Relazione :N implementata come PopUp
          codeChunk = insertMultipleSelectionPopUp2Form(sourceDir, bean, rel, inPopUp);
          if (rel.isRequired())
            updatePopUpRelationships += "\tupdatePopUpRelationships(\"" + Utils.makeFirstLetterLowerCase(bean.getName()) + "_" + rel.getName() + "\");\r\n";
          else
            updatePopUpRelationships += "";
        }

        codeChunk.setOrder(rel.getOrderInForm());
        codeChunks.add(codeChunk);
      }

    }

    /** Predispone i Manager necessari per le chiamate remoting * */
    relatedManagers += bean.getName() + "Manager";

    for (int i = 0; i < bean.getRelationships().size(); i++)
    {
      Relationship rel = bean.getRelationships().get(i);

      if (rel.isUsed())
      {
        relatedManagers += "&" + rel.getToBeanName() + "Manager";
      }
    }

    /** Ordinamento dei chunck  **/

    CodeChunk chunks[] = codeChunks.toArray(new CodeChunk[0]);

    Arrays.sort(chunks, new CodeChunkComparator());

    //    for (int i = 0; i < chunks.length; i++)
    //    {
    //      javaScript += chunks[i].getJavascriptCode();
    //      rows += chunks[i].getHtmlCode();
    //    }

    Vector<CodeChunk> chunkVector = new Vector<CodeChunk>(java.util.Arrays.asList(chunks));

    /** Generazione dei grouppi di attributi **/
    for (int i = 0; i < bean.getFormFieldsGroups().size(); i++)
    {
      FormFieldsGroup group = bean.getFormFieldsGroups().get(i);

      CodeChunk start = new CodeChunk(group.getFromFieldOrder());
      start.addHtmlCode("\r\n\r\n<!-- START GROUP: " + group.getTitle() + "  -->\r\n");
      start.addHtmlCode("<rich:panel header=\"" + group.getTitle() + "\" rendered=\"#{");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='CREATE'");
      if (!group.getShowOnCreateIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnCreateIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='EDIT'");
      if (!group.getShowOnEditIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnEditIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DISPLAY'");
      if (!group.getShowOnDisplayIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnDisplayIf());
      start.addHtmlCode(")");

      start.addHtmlCode(" or ");

      start.addHtmlCode("(" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation=='DELETE'");
      if (!group.getShowOnDeleteIf().equals(""))
        start.addHtmlCode(" and " + group.getShowOnDeleteIf());
      start.addHtmlCode(")");

      start.addHtmlCode("}\" >\r\n\r\n");
      start.addHtmlCode("<table width=\"100%\">\r\n");

      int idx = getChunkIndex(chunkVector, start);

      chunkVector.add(idx, start);

      CodeChunk end = new CodeChunk(group.getToFieldOrder());

      end.addHtmlCode("</table>\r\n");
      end.addHtmlCode("\r\n\r\n</rich:panel>\r\n");
      //end.addHtmlCode("<tr:spacer height=\"25\" />\r\n");
      end.addHtmlCode("<!-- END GROUP: " + group.getTitle() + "  -->\r\n\r\n");

      idx = getChunkIndex(chunkVector, end);

      chunkVector.add(idx + 1, end);
    }

    /** Finalmente scrive i chunk nel tag che viene sostituito nel template **/

    for (int i = 0; i < chunkVector.size(); i++)
    {
      javaScript += chunkVector.get(i).getJavascriptCode();
      rows += chunkVector.get(i).getHtmlCode();
    }

    /** Gestione dei campi FORMATTEDTEXTAREA **/

    if (!textAreaIds.equals(""))
    {
      String HtmlEditorJavascriptTemplate = "." + File.separator + "templates" + File.separator + "HtmlEditorJavascript.js";

      HashMap<String, String> tags = new HashMap<String, String>();

      tags.put("@TextAreaIds", textAreaIds);

      javascriptHtmlEditor = Utils.SeamReplaceTag2String(tags, null, null, HtmlEditorJavascriptTemplate);
    }

    if (bean.getPrintMenuConditionInForm().equals(""))
      printButton = "\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.Application_print}\" action=\"/" + bean.getName() + "Print.seam\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation!='CREATE'}\" style=\"text-decoration: none; color: black\" />";
    else
      printButton = "\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.Application_print}\" action=\"/" + bean.getName() + "Print.seam\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "Operation!='CREATE' and " + bean.getPrintMenuConditionInForm() + "}\" style=\"text-decoration: none; color: black\" />";

    /** Gestione campi nascosti per CRUDInSeparatePopup **/
    if (inPopUp)
    {
      Vector<Relationship> relationships2ThisBean = infoReader.getAllRelationship2ThisBean(bean.getName());

      for (int r = 0; r < relationships2ThisBean.size(); r++)
      {
        Relationship rel = relationships2ThisBean.get(r);

        Bean fromBean = infoReader.getBean(rel.getFromBeanName());

        String tmp = generatePopUpJavascriptFunctionsInPopup(fromBean).replace("startup", "loadHiddenFields").replace("\tdocument.forms[\"form\"].elements[\"form:", "\tdocument.forms[\"form\"].elements[\"form:" + rel.getFromBeanName());
        //        tmp += "\r\n"+generatePopUpJavascriptFunctionsInPopup(fromBean).replace("startup", "loadHiddenFields");

        if (javaScript.contains("loadHiddenFields"))
View Full Code Here

Examples of org.boco.seamwebappgen.info.InfoReader

    // Recupera il codice custom nella pagina
    LinkedList<String> yourJavaScriptCode = Utils.getYourCode(sourceFile, CustomCodeType.JAVA);
    LinkedList<String> yourCode = Utils.getYourCode(sourceFile, CustomCodeType.JSP);

    InfoReader infoReader = new InfoReader(sourceDir);

    /**
     * Predisposizione delle informazion relative alle relazioni MASTER-DETAIL
     * non categorizzate
     */

    for (int i = 0; i < bean.getRelationships().size(); i++)
    {
      Relationship rel = bean.getRelationships().get(i);

      if (rel.isUsed())
      {
        if (rel.isMasterDetail() && !rel.isFromMaster())
        {
          // Il bean e' un Detail in una relazione MASTER-DETAIL

          // Predispone l'indicazione del Master (PATH) se questo bean e' un Detail
          path = "<h:outputText value=\"#{" + bean.getName() + "Manager.path}\" styleClass=\"listPath\" />\r\n";

          // Inserisce il bottone di selezione del Master

          if (rel.isGoToMasterMenuItem())
          {
            masterButton += "\t\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.list_" + rel.getFromBeanName() + "_" + rel.getToBeanName() + "}\" action=\"/list/" + rel.getToBeanName() + "List.seam?masterReference=true\" rendered=\"#{" + bean.getName() + "Manager.isDetailOf('" + rel.getToBeanName() + "')}\"   style=\"text-decoration: none; color: black\"  />\r\n";
          }
          else
            masterButton = "";
        }

        if (rel.isMasterDetail() && rel.isFromMaster())
        {
          // Il bean e' un Master in una relazione MASTER-DETAIL

          // Predispone i links a tutte le liste del bean DETAIL

          detailButton += "\t<rich:menuSeparator />\r\n";

          Vector<ShowList> lists = infoReader.getLists(rel.getToBeanName());
          for (int j = 0; j < lists.size(); j++)
          {
            // detailButton += "\t\t\t<tr:commandLink immediate=\"true\" value=\"#{msgs.list_" + rel.getFromBeanName() + "_" + lists.get(j).getName() + "}\" action=\"#{@BeanManager.goTo" + lists.get(j).getName() + "}\" style=\"white-space: nowrap;\" />\r\n";
            detailButton += "\t<rich:menuItem immediate=\"true\" value=\"#{msgs.list_" + rel.getFromBeanName() + "_" + lists.get(j).getName() + "}\" actionListener=\"#{@BeanManager.popupMenuSelectItem}\" action=\"#{@BeanManager.goTo" + lists.get(j).getName() + "}\" style=\"white-space: nowrap;\" >\r\n";
            detailButton += "\t\t<a4j:actionparam name=\"selectedId\" value=\"{selectedBean}\" />\r\n";
            detailButton += "\t</rich:menuItem>\r\n";
          }
        }
      }
    }

    /**
     * Predisposizione delle informazioni relative alle relazioni
     * MASTER-DETAIL categorizzate *
     */
    details += generateDetails(bean, sourceDir);

    // Prepara la lista dei campi

    columnClasses = listColumnClasses(bean.getShowAttributes(), true); // Stile delle colonne
    columnWidths = listColumnWidths(bean.getShowAttributes(), true); // Dimensioni delle colonne

    rows = listColumns(bean.getName(), bean.getShowAttributes()); // Colonne della tabella

    /** Bottone per la ricerca locale **/

    if (bean.getSearchAttributes().size() > 1)
    {
      selectionButton += "\r\n\taddMenuBarItem(new menuBarItem(\"<bean:message key=\"list." + bean.getName() + ".button.search\"/>\", \"\", \"\", \"\", \"code:doSubmit('<bean:message key=\"list." + bean.getName() + ".button.search\"/>');\"));\r\n";
    }

    /** Ricerca locale * */

    localSearch = localSearch(bean);
    javaScript += localSearch.getJavascriptCode();

    // Voce menu per ricerca

    if (bean.getSearchAttributes().size() > 1)
    {
      searchButton += "\t\t\t<h:commandLink  immediate=\"true\" value=\"#{msgs.list_" + bean.getName() + "_search}\" action=\"#{" + bean.getName() + "Manager.initSearch}\"  style=\"text-decoration: none; color: black\"  />\r\n";
    }

    // Menu creazione bean
    Vector<String> derivedBeans = infoReader.getDerivedBeans(bean.getName());
    if (derivedBeans.size() == 0)
    {
      if (listInfo.getNewMenuCondition().equals(""))
        createButtons = "\t\t\t<h:commandLink immediate=\"true\" value=\"#{msgs.list_" + bean.getName() + "_new}\" action=\"#{" + bean.getName() + "Manager.initCreate}\" style=\"text-decoration: none; color: black\"   />\r\n";
      else
View Full Code Here

Examples of org.boco.seamwebappgen.info.InfoReader

        if (rel.isUsed() && rel.isMasterDetail() && rel.isFromMaster() && rel.isCategorized())
        {
          HashMap<String, String> tags = new HashMap<String, String>();

          InfoReader infoReader = new InfoReader(sourceDir);
          Bean detailBean = infoReader.getBean(rel.getToBeanName());

          rows = rows = listColumns(detailBean.getName(), detailBean.getShowAttributes());

          tags.put("@bean", Utils.makeFirstLetterLowerCase(detailBean.getName()));
          tags.put("@Bean", detailBean.getName());
          tags.put("@masterBean", Utils.makeFirstLetterLowerCase(masterBean.getName()));
          tags.put("@Relationship", Utils.makeFirstLetterLowerCase(masterBean.getName()) + "." + Utils.makeMethod2Field(rel.getName()));
          tags.put("@Rows", rows);

          Bean targetBean = infoReader.getBean(rel.getToBeanName());

          String details = generateDetails(targetBean, sourceDir);

          tags.put("@Details", details);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.