Package org.boco.seamwebappgen.info

Examples of org.boco.seamwebappgen.info.ShowAttribute


    // 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());

      codeChunk.addHtmlCode("\t<p:cell grayFill=\".7\" horizontalAlignment=\"left\"  verticalAlignment=\"middle\">#{msgs.form_" + bean.getName() + "_" + attribute.getQualifiedName().replace(".", "_") + "}</p:cell>\r\n");
      codeChunk.addHtmlCode("\t<p:cell               horizontalAlignment=\"justify\" verticalAlignment=\"middle\">#{" + Utils.makeFirstLetterLowerCase(bean.getName()) + "." + attribute.getQualifiedName() + "}</p:cell>\r\n");

      codeChunks.add(codeChunk);
    }

    // Inserisce gli attributi provenienti da relazioni
View Full Code Here


    int idx = 1;

    for (int i = 0; i < showAttributes.size(); i++)
    {
      ShowAttribute attribute = showAttributes.get(i);

      if (!attribute.isKey())
      {
        if (i > 0)
          ret += ",";

        ret += attribute.getWidth();
      }
    }

    return ret;
  }
View Full Code Here

    // Campi da visualizzare del bean
    int idx = 1;

    for (int i = 0; i < showAttributes.size(); i++)
    {
      ShowAttribute attribute = showAttributes.get(i);

      if (!attribute.isKey())
      {
        if (i > 0)
          columnClasses += ",";

        if (!attribute.belongsToRelationship())
        {
          // Attributi del bean

          if (attribute.getIconValues().size() == 0)
          {
            if (attribute.getType().equals("java.lang.String"))
            {
              columnClasses += "dataColumnLeftAlignment";
            }
            if (attribute.getType().equals("java.lang.Boolean"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.util.Date"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.lang.Double"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Long"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Integer"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
          }
          else
          {
            columnClasses += "dataColumnCenterAlignment";
          }

          idx += 2;
        }
        else
        {
          // Attributi dei bean collegati da relazioni

          if (attribute.getRelationship().isToMany())
          {
            if (attribute.getType().equals("java.lang.String"))
            {
              columnClasses += "dataColumnLeftAlignment";
            }
            if (attribute.getType().equals("java.lang.Boolean"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.util.Date"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.lang.Double"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Long"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Integer"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
          }
          else
          {
            if (attribute.getType().equals("java.lang.String"))
            {
              columnClasses += "dataColumnLeftAlignment";
            }
            if (attribute.getType().equals("java.lang.Boolean"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.util.Date"))
            {
              columnClasses += "dataColumnCenterAlignment";
            }
            if (attribute.getType().equals("java.lang.Double"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Long"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            if (attribute.getType().equals("java.lang.Integer"))
            {
              columnClasses += "dataColumnRightAlignment";
            }
            idx += 2;
          }
View Full Code Here

    // Campi da visualizzare del bean
    int idx = 1;

    for (int i = 0; i < showAttributes.size(); i++)
    {
      ShowAttribute attribute = showAttributes.get(i);

      if (!attribute.isKey())
      {
        rows += "<rich:column";

        //        /** Gestione allineamento colonne in funzione del tipo di dato **/
        //
        //        if (attribute.getType().contains("Double") || attribute.getType().contains("Integer") || attribute.getType().contains("Long"))
        //        {
        //          rows += " align=\"right\" ";
        //        }
        //
        //        if (attribute.getType().contains("String"))
        //        {
        //          rows += " align=\"left\" ";
        //        }
        //
        //        if (attribute.getType().contains("Date") || attribute.getType().contains("Boolean"))
        //        {
        //          rows += " align=\"center\" ";
        //        }
        //
        rows += ">\r\n";

        if (!attribute.belongsToRelationship())
        {
          // Attributi del bean

          rows += "\t<f:facet name=\"header\">\r\n";
          rows += "\t\t<h:panelGroup style=\"white-space: nowrap;\">\r\n";
          rows += "\t\t\t<h:outputText value=\"#{msgs.list_" + beanName + attribute.SeamLabel() + "}\" />\r\n";

          rows += "\t\t\t<a4j:region>\r\n";
          rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "A}\" image=\"../img/asc.gif\" rendered=\"#{order!=" + (idx) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
          rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "A}\" image=\"../img/asc_selected.gif\" rendered=\"#{order==" + (idx) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
          rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "D}\" image=\"../img/desc.gif\" rendered=\"#{order!=" + (idx + 1) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
          rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "D}\" image=\"../img/desc_selected.gif\" rendered=\"#{order==" + (idx + 1) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
          rows += "\t\t\t<a4j:status><f:facet name=\"start\"><h:graphicImage  value=\"../img/spinner.gif\"/></f:facet></a4j:status>\r\n";
          rows += "\t\t\t</a4j:region>\r\n";

          rows += "\t\t</h:panelGroup>\r\n";
          rows += "\t</f:facet>\r\n";

          if (attribute.getIconValues().size() == 0)
          {
            if (!attribute.isTrans())
            {
              rows += "\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + attribute.SeamField() + "}\"";
              if (attribute.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
                rows += " escape=\"false\" ";
              rows += " >\r\n";
            }
            else
            {
              if (attribute.getTransientParameters().equals(""))
              {
                rows += "\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + attribute.SeamField() + "}\" >\r\n";
              }
              else
              {
                rows += "\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + "." + Utils.makeGet(attribute.getName()) + "(" + attribute.getTransientParameters() + ")}\" >\r\n";
              }
            }

            if (attribute.getType().equals("java.util.Date") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"LongConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
            }

            rows += "\t</h:outputText>\r\n";
          }
          else
          {
            Vector<String> values = attribute.getIconValues();

            for (int k = 0; k < values.size(); k++)
            {
              rows += "\t<h:graphicImage url=\"../img/" + attribute.getIcons().get(k) + "\" rendered=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + attribute.SeamField() + "==" + values.get(k) + "}\" />\r\n";
            }
          }

          idx += 2;

          rows += "</rich:column>\r\n\r\n";
        }
        else
        {
          // Attributi dei bean collegati da relazioni

          if (attribute.getRelationship().isToMany())
          {
            // rows += "<rich:column>\r\n";
            rows += "\t<f:facet name=\"header\" style=\"white-space: nowrap;\">\r\n";

            rows += "\t\t\t<h:outputText value=\"#{msgs.list_" + beanName;

            rows += "_" + attribute.getRelationships().get(0).getName();

            //rows += attribute.SeamLabel() + "}\" styleClass = \"noWrap\" />\r\n";
            rows += attribute.SeamLabel() + "}\" />\r\n";

            rows += "\t</f:facet>\r\n";

            // Celle senza bordi
            rows += "\t<rich:dataTable verticalGridVisible=\"false\" horizontalGridVisible=\"true\" var=\"" + Utils.makeMethod2Field(attribute.getRelationship().getName()) + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + "." + Utils.makeMethod2Field(attribute.getRelationship().getName()) + "}\" >\r\n";

            rows += "\t\t\t<rich:column";

            //            if (attribute.getType().contains("Double") || attribute.getType().contains("Integer") || attribute.getType().contains("Long"))
            //            {
            //              rows += " align=\"right\" ";
            //            }
            //
            //            if (attribute.getType().contains("String"))
            //            {
            //              rows += " align=\"left\" ";
            //            }
            //
            //            if (attribute.getType().contains("Date") || attribute.getType().contains("Boolean"))
            //            {
            //              rows += " align=\"center\" ";
            //            }

            // Celle senza bordi
            //rows += ">\r\n";
            rows += " style=\"background-color: transparent; border-left-style: none; border-right-style: none;\" >\r\n";

            rows += "\t\t\t<h:outputText value=\"#{" + Utils.makeMethod2Field(attribute.getRelationship().getName()) + attribute.SeamField() + "}\" >\r\n";

            if (attribute.getType().equals("java.util.Date"))
            {
              rows += "\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
            {
              rows += "\t\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
            {
              rows += "\t\t\t\t<f:converter converterId=\"LongConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
            {
              rows += "\t\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
            }

            rows += "\t\t\t</h:outputText>\r\n";
            rows += "\t\t</rich:column>\r\n";
            rows += "\t</rich:dataTable>\r\n";
            rows += "</rich:column>\r\n\r\n";
          }
          else
          {
            rows += "\t<f:facet name=\"header\">\r\n";
            rows += "\t\t<h:panelGroup style=\"white-space: nowrap;\">\r\n";

            rows += "\t\t\t<h:outputText value=\"#{msgs.list_" + beanName;

            rows += "_" + attribute.getRelationships().get(0).getName();

            rows += attribute.SeamLabel() + "}\" />\r\n";

            rows += "\t\t\t<a4j:region>\r\n";
            rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "A}\" image=\"../img/asc.gif\" rendered=\"#{order!=" + (idx) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
            rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "A}\" image=\"../img/asc_selected.gif\" rendered=\"#{order==" + (idx) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
            rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "D}\" image=\"../img/desc.gif\" rendered=\"#{order!=" + (idx + 1) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
            rows += "\t\t\t<a4j:commandButton action=\"#{" + beanName + "Manager.orderBy" + (i + 1) + "D}\" image=\"../img/desc_selected.gif\" rendered=\"#{order==" + (idx + 1) + "}\" ajaxSingle=\"true\" reRender=\"" + Utils.makeFirstLetterLowerCase(beanName) + "\"/>\r\n";
            rows += "\t\t\t<a4j:status><f:facet name=\"start\"><h:graphicImage  value=\"../img/spinner.gif\"/></f:facet></a4j:status>\r\n";
            rows += "\t\t\t</a4j:region>\r\n";

            rows += "\t\t</h:panelGroup>\r\n";
            rows += "\t</f:facet>\r\n";

            rows += "\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(beanName);

            for (int k = 0; k < attribute.getRelationships().size(); k++)
              rows += "." + Utils.makeMethod2Field(attribute.getRelationships().get(k).getName());

            rows += "." + attribute.getName() + "}\" >\r\n";

            if (attribute.getType().equals("java.util.Date") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"LongConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
            }

            rows += "\t</h:outputText>\r\n";
View Full Code Here

    // 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");
View Full Code Here

      ret.addHtmlCode("\t\t\t\t\t>\r\n");
    }

    for (int i = 0; i < rel.getRelatedAttributes().size(); i++)
    {
      ShowAttribute attr = rel.getRelatedAttributes().get(i);

      ret.addHtmlCode("\t\t\t\t\t\t<rich:column");

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

      ret.addHtmlCode("\t\t\t\t\t\t\t<f:facet name=\"header\">\r\n");

      ret.addHtmlCode("\t\t\t\t\t\t\t\t<h:outputText value=\"#{msgs.form_" + bean.getName() + "_" + rel.getName());

      for (int k = 0; k < attr.getRelationships().size(); k++)
      {
        ret.addHtmlCode("_");
        ret.addHtmlCode(attr.getRelationships().get(k).getName());
      }

      ret.addHtmlCode("_" + attr.getName() + "");

      ret.addHtmlCode("}\" />\r\n");

      ret.addHtmlCode("\t\t\t\t\t\t\t</f:facet>\r\n");

      if (attr.getRelationships().size() == 0)
      {
        ret.addHtmlCode("\t\t\t\t\t\t\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(rel.getToBeanName()) + "." + attr.getName() + "}\"");

        if (attr.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
          ret.addHtmlCode(" escape=\"false\"");

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

        if (attr.getType().equals("java.util.Date"))
        {
          ret.addHtmlCode("\t\t\t\t\t\t\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n");
        }
        if (attr.getType().equals("java.lang.Double") && !attr.isListFormatOff())
        {
          ret.addHtmlCode("\t\t\t\t\t\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n");
        }

        if (attr.getType().equals("java.lang.Long") && !attr.isListFormatOff())
        {
          ret.addHtmlCode("\t\t\t\t\t\t\t\t<f:converter converterId=\"LongConverter\" />\r\n");
        }

        if (attr.getType().equals("java.lang.Integer") && !attr.isListFormatOff())
        {
          ret.addHtmlCode("\t\t\t\t\t\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n");
        }

        ret.addHtmlCode("\t\t\t\t\t\t\t</h:outputText >\r\n");
      }
      else
      {
        /**
         *
         * Attributo nella forma
         *
         *  [relationship.]*Atribute
         *
         */

        if (!attribute2N(attr))
        {
          ret.addHtmlCode("\t\t\t\t\t\t\t<h:outputText value=\"#{" + Utils.makeFirstLetterLowerCase(rel.getToBeanName()) + ".");

          for (int k = 0; k < attr.getRelationships().size(); k++)
          {
            if (k > 0)
              ret.addHtmlCode(".");

            ret.addHtmlCode(Utils.makeMethod2Field(attr.getRelationships().get(k).getName()));
          }

          ret.addHtmlCode("." + attr.getName());

          ret.addHtmlCode("}\"");

          if (attr.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
            ret.addHtmlCode(" escape=\"false\"");

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

          if (attr.getType().equals("java.util.Date"))
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"#{msgs.Application_DateFormat}\"  />\r\n");
          }
          if (attr.getType().equals("java.lang.Double") && !attr.isListFormatOff())
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n");
          }

          if (attr.getType().equals("java.lang.Long") && !attr.isListFormatOff())
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"LongConverter\" />\r\n");
          }

          if (attr.getType().equals("java.lang.Integer") && !attr.isListFormatOff())
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n");
          }

          ret.addHtmlCode("\t\t\t\t\t\t</h:outputText>\r\n");
        }
        else
        {
          ret.addHtmlCode("\t\t\t\t<rich:dataTable verticalGridVisible=\"false\" horizontalGridVisible=\"true\" var=\"" + Utils.makeMethod2Field(attr.getRelationship().getName()) + "\" value=\"#{" + Utils.makeFirstLetterLowerCase(rel.getToBeanName()) + ".");

          for (int k = 0; k < attr.getRelationships().size(); k++)
          {
            if (k > 0)
              ret.addHtmlCode(".");

            ret.addHtmlCode(Utils.makeMethod2Field(attr.getRelationships().get(k).getName()));
          }

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

          ret.addHtmlCode("\t\t\t\t\t<rich:column");

          if (attr.getType().contains("Double") || attr.getType().contains("Integer") || attr.getType().contains("Long"))
          {
            ret.addHtmlCode(" align=\"right\" ");
          }

          if (attr.getType().contains("String"))
          {
            ret.addHtmlCode(" align=\"left\" ");
          }

          if (attr.getType().contains("Date") || attr.getType().contains("Boolean"))
          {
            ret.addHtmlCode(" align=\"center\" ");
          }

          // Celle senza bordi
          ret.addHtmlCode(" style=\"background-color: transparent; border-left-style: none; border-right-style: none;\" >\r\n");

          ret.addHtmlCode("\t\t\t\t\t\t<h:outputText value=\"#{" + Utils.makeMethod2Field(attr.getRelationship().getName()) + attr.SeamField() + "}\"");

          if (attr.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
            ret.addHtmlCode(" escape=\"false\"");

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

          if (attr.getType().equals("java.util.Date"))
          {
            ret.addHtmlCode("\t\t\t\t\t\t\t<f:converter converterId=\"#{msgs.Application_DateFormat}\"  />\r\n");
          }
          if (attr.getType().equals("java.lang.Double"))
          {
            //ret.addHtmlCode("\t\t\t\t\t\t\t<f:convertNumber groupingUsed=\"true\" minFractionDigits=\"2\" maxFractionDigits=\"2\" locale=\"IT_it\" />\r\n");
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n");
          }

          if (attr.getType().equals("java.lang.Long") && !attr.isListFormatOff())
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"LongConverter\" />\r\n");
          }

          if (attr.getType().equals("java.lang.Integer") && !attr.isListFormatOff())
          {
            ret.addHtmlCode("\t\t\t\t<f:converter converterId=\"IntegerConverter\" />\r\n");
          }

          ret.addHtmlCode("\t\t\t\t\t\t</h:outputText>\r\n");
View Full Code Here

  {
    Vector<ShowAttribute> ret = new Vector<ShowAttribute>();

    for (int i = 0; i < showAttributes.length; i++)
    {
      ShowAttribute tmp = null;

      if (showAttributes[i].contains("."))
      {
        // L'attributo contiene anche i riferimenti a relazioni

        Vector<String> items = Utils.splitRelationships(showAttributes[i]);

        tmp = new ShowAttribute(items.lastElement());

        String toBeanName = beanName;

        for (int m = 0; m < items.size() - 1; m++)
        {
          Relationship rel = infoReader.getRelationship(toBeanName, items.get(m));

          tmp.addRelationship(rel);

          toBeanName = rel.getToBeanName();
        }

        tmp.setType(infoReader.getBeanAttribute(tmp.getRelationship().getToBeanName(), tmp.getName()).getType());
        tmp.setImplementationType(infoReader.getBeanAttribute(toBeanName, tmp.getName()).getImplementationType());
        tmp.setFormFormatOff(infoReader.getBeanAttribute(toBeanName, tmp.getName()).isFormFormatOff());
        tmp.setListFormatOff(infoReader.getBeanAttribute(toBeanName, tmp.getName()).isListFormatOff());
      }
      else
      {
        tmp = new ShowAttribute(showAttributes[i]);
        tmp.setType(infoReader.getBeanAttribute(beanName, tmp.getName()).getType());
        tmp.setImplementationType(infoReader.getBeanAttribute(beanName, tmp.getName()).getImplementationType());
        tmp.setFormFormatOff(infoReader.getBeanAttribute(beanName, tmp.getName()).isFormFormatOff());
        tmp.setListFormatOff(infoReader.getBeanAttribute(beanName, tmp.getName()).isListFormatOff());
      }

      ret.add(tmp);
    }
View Full Code Here

  {
    Vector<ShowAttribute> ret = new Vector<ShowAttribute>();

    for (int i = 0; i < showInFormAttributes.size(); i++)
    {
      ShowAttribute attr = showInFormAttributes.get(i);

      if (attr.getRelationship() != null && attr.getRelationship().getName().equals(relationshipName))
        ret.add(attr);
    }

    return ret;
  }
View Full Code Here

    // Campi da visualizzare del bean

    for (int i = 0; i < showAttributes.size(); i++)
    {
      ShowAttribute attribute = showAttributes.get(i);

      if (!attribute.isKey())
      {
        if (!attribute.belongsToRelationship())
        {
          // Attributi del bean

          titles += "<p:cell grayFill=\".7\" verticalAlignment=\"middle\"><p:paragraph alignment=\"center\">";

          titles += "#{msgs.list_" + beanName + attribute.SeamLabel() + "}";

          titles += "</p:paragraph></p:cell>\r\n";
        }
        else
        {
          // Attributi dei bean collegati da relazioni

          titles += "<p:cell grayFill=\".7\" verticalAlignment=\"middle\"><p:paragraph alignment=\"center\">";

          titles += "#{msgs.list_" + beanName + "_" + attribute.getRelationships().get(0).getName() + attribute.SeamLabel() + "}";

          titles += "</p:paragraph></p:cell>\r\n";

        }
      }
View Full Code Here

    // Campi da visualizzare del bean

    for (int i = 0; i < showAttributes.size(); i++)
    {
      ShowAttribute attribute = showAttributes.get(i);

      if (!attribute.isKey())
      {
        if (!attribute.belongsToRelationship())
        {
          // Attributi del bean

          rows += "<p:cell verticalAlignment=\"middle\" horizontalAlignment=\"";

          if (attribute.getType().equals("java.util.Date") || attribute.getType().equals("java.lang.Boolean"))
            rows += "center";
          else
          {
            if (attribute.getType().equals("java.lang.String"))
              rows += "left";
            else
              rows += "right";
          }

          rows += "\">";

          rows += "<p:paragraph><p:text ";

          if (!attribute.isTrans())
          {
            rows += "value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + attribute.SeamField() + "}\" >\r\n";
          }
          else
          {
            if (attribute.getTransientParameters().equals(""))
            {
              rows += "value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + attribute.SeamField() + "}\" >\r\n";
            }
            else
            {
              rows += "value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + "." + Utils.makeGet(attribute.getName()) + "(" + attribute.getTransientParameters() + ")}\" >\r\n";
            }
          }

          if (attribute.getImplementationType() == AttributeImplementationType.FORMATTEDTEXTAREA)
          {
            rows += "\t\t<f:converter converterId=\"Html2PdfConverter\" />\r\n";
          }

          if (attribute.getType().equals("java.util.Date") && !attribute.isListFormatOff())
          {
            rows += "\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n";
          }
          if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
          {
            rows += "\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
          }

          if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
          {
            rows += "\t\t<f:converter converterId=\"LongConverter\" />\r\n";
          }
          if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
          {
            rows += "\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
          }

          rows += "</p:text>";

          rows += "</p:paragraph></p:cell>\r\n";
        }
        else
        {
          // Attributi dei bean collegati da relazioni

          if (attribute.getRelationship().isToMany())
          {
            rows += "<p:cell verticalAlignment=\"middle\"><p:paragraph>\r\n";

            rows += "\t<ui:repeat value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + "." + Utils.makeMethod2Field(attribute.getRelationship().getName()) + "}\" var=\"" + Utils.makeMethod2Field(attribute.getRelationship().getName()) + "\">\r\n";

            rows += "\t\t<p:paragraph><p:text ";

            rows += "value=\"#{" + Utils.makeMethod2Field(attribute.getRelationship().getName()) + attribute.SeamField() + "}\" >\r\n";

            if (attribute.getType().equals("java.util.Date") && !attribute.isListFormatOff())
            {
              rows += "\t\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\"  />\r\n";
            }
            if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
            {
              rows += "\t\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"LongConverter\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
            {
              //rows += "\t\t\t<f:convertNumber integerOnly=\"true\" groupingUsed=\"true\" locale=\"IT_it\" />\r\n";
              rows += "\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
            }

            rows += "\t\t</p:text></p:paragraph>\r\n";

            rows += "\t</ui:repeat>\r\n";

            rows += "</p:paragraph></p:cell>\r\n";
          }
          else
          {
            rows += "<p:cell verticalAlignment=\"middle\"><p:paragraph><p:text ";

            rows += "value=\"#{" + Utils.makeFirstLetterLowerCase(beanName) + "." + Utils.makeMethod2Field(attribute.getRelationships().get(0).getName()) + attribute.SeamField() + "}\" >\r\n";

            if (attribute.getType().equals("java.util.Date"))
            {
              rows += "\t\t<f:convertDateTime pattern=\"#{msgs.Application_DateFormat}\" />\r\n";
            }
            if (attribute.getType().equals("java.lang.Double") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"DoubleConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Long") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"LongConverter\" />\r\n";
            }

            if (attribute.getType().equals("java.lang.Integer") && !attribute.isListFormatOff())
            {
              rows += "\t\t<f:converter converterId=\"IntegerConverter\" />\r\n";
            }

            rows += "</p:text>";
View Full Code Here

TOP

Related Classes of org.boco.seamwebappgen.info.ShowAttribute

Copyright © 2018 www.massapicom. 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.