JEECG upload the plugin upgrade - code generator

Preface:

    Is based on existing uploadify upload the swf, with the popularity of H5, flash will exit the stage of history, JEECG principle of advancing with the times, the system will be fully upgraded JEECG upload feature, upload using the new plug-plupload, this plug-in Upload supports multiple modes html5, flash, silverlight, html4, can be achieved by configuring priority mode, the new version of major browsers available for the use of H5, do not support the lower version of IE browser H5 can take flash mode. The following explanation JEECG upgrade code generator.

Upgrade steps:

1. Download the upgrade file

    Links: https://pan.baidu.com/s/1wQ7xT83bglouprPN0Gu7qA  Password: ay6q

2. [New file]

    Increase JS / css, the plupload folder directly copied to src / main / webapp / plug-in / under

3. Modify the file]

    Map.js copied to src / main / webapp / plug-in / tools / lower cover update.

4. [New file]

    UploadPlTag.java copied to src / main / java / org / jeecgframework / tag / core / easyui / lower.

5. [New file]

    Plupload.ftl copied to src / main / java / org / jeecgframework / tag / ftl / lower.

6. Modify File]

    BaseTag.java copied to src / main / java / org / jeecgframework / tag / core / easyui / under, modified as follows:

1
2
3
4
5
6
7
if  (oConvertUtils.isIn( "uploadify" , types)) {
     /*sb.append("<link rel=\"stylesheet\" href=\""+basePath+"/plug-in/uploadify/css/uploadify.css\" type=\"text/css\"></link>");
     sb.append("<script type=\"text/javascript\" src=\""+basePath+"/plug-in/uploadify/jquery.uploadify-3.1.js\"></script>");*/
     sb.append( "<link rel=\"stylesheet\" href=\"" +basePath+ "/plug-in/uploadify/css/uploadify.css\" type=\"text/css\"></link>" );
     sb.append( "<script type=\"text/javascript\" src=\"" +basePath+ "/plug-in/plupload/plupload.full.min.js\"></script>" );
     sb.append( "<script type=\"text/javascript\" src=\"" +basePath+ "/plug-in/tools/Map.js\"></script>" );
}

7. Modify File]

    Modify src / main / webapp / WEB-INF / tld / easyui.tld file, found <name> upload </ name> tag, modify its configuration <tag-class> is org.jeecgframework.tag.core.easyui.UploadPlTag ,amend as below:

1
2
3
4
5
6
<tag>
         <name>upload</name>
         <!-- <tag- class >org.jeecgframework.tag.core.easyui.UploadTag</tag- class > -->
         <tag- class >org.jeecgframework.tag.core.easyui.UploadPlTag</tag- class >
         <body-content>JSP</body-content>
         <description>选项卡选项标签</description>

8. Modify File]

    In the src / main / resources / jeecg / down search "jquery.uploadify-3.1.js" page if there is need to replace this path to JS plug-in / plupload / plupload.full.min.js, and adding an extra JS introduction:

1
<script type= "text/javascript"  src= "plug-in/tools/Map.js" ></script>

    For example: to search the file src / main / resources / jeecg / ext-template / table / onetomany / cgform_jspTemplate_add.ftl have "jquery.uploadify-3.1.js" code is as follows:

1
2
3
4
5
<t:base type= "jquery,easyui,tools,DatePicker" ></t:base>
<# if  callbackFlag ==  true >
<link rel= "stylesheet"  href= "plug-in/uploadify/css/uploadify.css"  type= "text/css"  />
<script type= "text/javascript"  src= "plug-in/uploadify/jquery.uploadify-3.1.js" ></script>
</# if >

  

    Now if necessary in the judgment JS replaced, and a new, into the following code:

1
2
3
4
5
6
<t:base type= "jquery,easyui,tools,DatePicker" ></t:base>
  <# if  callbackFlag ==  true >
  <link rel= "stylesheet"  href= "plug-in/uploadify/css/uploadify.css"  type= "text/css"  />
  <script type= "text/javascript"  src= "plug-in/plupload/plupload.full.min.js" ></script>
  <script type= "text/javascript"  src= "plug-in/tools/Map.js" ></script>
  </# if >

  

    Can also be written directly into tabbed

1
2
3
4
<t:base type= "jquery,easyui,tools,DatePicker" ></t:base>
<# if  callbackFlag ==  true >
<t:base type= "uploadify" ></t:base>
</# if >

  or

1
<t:base type= "jquery,easyui,tools,DatePicker<#if callbackFlag == true>,uploadify</#if>" ></t:base>

Guess you like

Origin www.cnblogs.com/Jeely/p/11309990.html