All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.jsp.cms.jsp Maven / Gradle / Ivy

<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="bigdog" uri="http://www.openAuthn.org/tags/bigdog" %>
<%----%>


            
        
        
        Content Manager
        <%           
            int res_mode = 0;           
            if("1".equals(request.getParameter("res_mode"))){
                res_mode = 1;
            }
        %>
        
        <%
            if(res_mode == 1){
        %>
        
        
        
        <%
            }else{
        %>
        
        
        
        <%
            }
        %>     

        
        <%            
            String clzName = request.getParameter("clazName");
            Class clz = null;
            if (clzName != null) {
                clz = com.mycomm.itool.WebAppModule.utils.StringToBeanClass.getClass(clzName);
            }
            if (clz == null) {
                out.print("Invalide entity name!");
                return;
            }
            if (!clz.isAnnotationPresent(com.mycomm.itool.WebAppModule.annotation.MyActionURI.class)) {
                out.print("Invalide class AnnotationPresent!");
                return;
            }
            String JsFunctionPrefx = clz.getSimpleName();
            com.mycomm.itool.WebAppModule.annotation.MyActionURI myActionURI = (com.mycomm.itool.WebAppModule.annotation.MyActionURI) clz.getAnnotation(com.mycomm.itool.WebAppModule.annotation.MyActionURI.class);
            if(!myActionURI.enableReadPrivilege()){
                out.print("ReadPrivilege is Invalide !");
                return;
            }
            
            String actionLoadByList = myActionURI.actionLoadByList();
            String actionDelByList = myActionURI.actionDelByList();
            String actionAddUpdate = myActionURI.actionAddUpdate();
            String actionDelById = myActionURI.actionDelById();
            String actionLoadById = myActionURI.actionLoadById();
            com.mycomm.dao.dao4comm.framework.AnnotationStructureStrategy annotationStrategy = com.mycomm.dao.dao4comm.util.AnnotationParser.LoadAnnotationStructureStrategy(clz);
            String idFieldName = annotationStrategy.getIdField().getName();
            StringBuilder sb_titles = new StringBuilder();
            sb_titles.append("'").append(idFieldName).append("'").append(",");
            for (String nm : annotationStrategy.getSimpleFieldsNames()) {
                sb_titles.append("'").append(nm).append("'").append(",");
            }
            sb_titles.deleteCharAt(sb_titles.length() - 1);




        %>
        
        <%
                        StringBuilder sbPanelItems = new StringBuilder();
                        java.lang.reflect.Field[] fieldsItems =  annotationStrategy.getSimpleFields();
                        for(java.lang.reflect.Field fItem : fieldsItems){
                            fItem.setAccessible(true);
                            com.mycomm.itool.WebAppModule.annotation.MyWebLabel webLabel = fItem.getAnnotation(com.mycomm.itool.WebAppModule.annotation.MyWebLabel.class);                           
                            com.mycomm.dao.dao4comm.annotation.MyColumn myColumn = fItem.getAnnotation(com.mycomm.dao.dao4comm.annotation.MyColumn.class);
                            if(myColumn != null){
                                StringBuilder sbPanelItem = new StringBuilder();
                                String xType = "";
                                com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes javaDataTypes = com.mycomm.dao.dao4comm.annotation.dialect.FieldTypeDetector.getDataType(fItem);
                                if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JByte.equals(javaDataTypes)){
                                    continue;
                                }
                                if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JString.equals(javaDataTypes)){
                                    xType = "textfield";
                                    if(webLabel != null && webLabel.needHtmlEditor()){
                                        xType = "htmleditor";
                                    }
                                }else if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JChar.equals(javaDataTypes)){
                                   xType = "textfield";
                                }else if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JDate.equals(javaDataTypes)){
                                   xType = "datefield";
                                }else{
                                    xType = "numberfield";
                                }
                                String fieldLabel = "";
                                if(webLabel == null){
                                    fieldLabel = fItem.getName();
                                }else{
                                    fieldLabel = webLabel.MyLabel();
                                    if("".equals(fieldLabel)){
                                        fieldLabel = fItem.getName();
                                    }
                                }
                                String allowBlank = myColumn.isColumnNullable() ? "true":"false";
                                sbPanelItem.append("                        {xtype: \"").append(xType).append("\", name: \"").append(fItem.getName()).append("\", id: \"").append(fItem.getName()).append("\", fieldLabel: \"").append(fieldLabel).append("\", allowBlank: ").append(allowBlank);
                                if("numberfield".equals(xType)){
//                                   String nPostFix = " vtype: \"numeric\"";
//                                   sbPanelItem.append(" , ").append(nPostFix);
                                }
                                
                                if("datefield".equals(xType)){
                                   String nPostFix = " format: \"Y-m-d H:i:s\"";
                                   sbPanelItem.append(" , ").append(nPostFix);
                                }
                                
                                if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JShort.equals(javaDataTypes)){
                                   String shortPostFix = " maxValue:32767 , minValue:-32768 ";
                                   sbPanelItem.append(" , ").append(shortPostFix);
                                }
                                
                                 if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JBoolen.equals(javaDataTypes)){
                                   String shortPostFix = " maxValue:1 , minValue:0 ";
                                   sbPanelItem.append(" , ").append(shortPostFix);
                                } 
                                
                                if(com.mycomm.dao.dao4comm.annotation.dialect.JavaDataTypes.JChar.equals(javaDataTypes)){
                                   String charPostFix = " maxLength:1, maxLengthText:'only 1 character for char' ";
                                   sbPanelItem.append(" , ").append(charPostFix);
                                }
                                if(webLabel != null && webLabel.needHtmlEditor()){
                                    String htmlEditorPostFix = " height:150,width:600,value:'',labelWidth:70,labelSeparator:':',enableAlignments:true,enableColors:true,enableFont:true,enableFontSize:true,enableFormat:true,enableLinks:true,enableLists:true,enableSourceEdit:true";
                                    sbPanelItem.append(" , ").append(htmlEditorPostFix);
                                }
                                sbPanelItem.append("},\n ");
                                sbPanelItems.append(sbPanelItem.toString());
                            }
                        }
                        String ids = "                        {xtype: \"hidden\", name: \""+  idFieldName +"\", id:\""+idFieldName+"\", value: \"-100\"}";
                        sbPanelItems.append(ids);
                                           
                    %>
    
    
    




© 2015 - 2024 Weber Informatics LLC | Privacy Policy