Package.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. MWF.xApplication.process.Xform = MWF.xApplication.process.Xform || {};
  2. MWF.xApplication.cms.Xform = MWF.xApplication.cms.Xform || {};
  3. MWF.require("MWF.xScript.CMSMacro", null, false);
  4. MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
  5. MWF.xDesktop.requireApp("cms.Xform", "ModuleImplements", null, false);
  6. //MWF.xDesktop.requireApp("cms.Xform", "Label", null, false);
  7. //MWF.xDesktop.requireApp("cms.Xform", "Textfield", null, false);
  8. //MWF.xDesktop.requireApp("cms.Xform", "Number", null, false);
  9. //MWF.xDesktop.requireApp("cms.Xform", "Personfield", null, false);
  10. //MWF.xDesktop.requireApp("cms.Xform", "Orgfield", null, false);
  11. //MWF.xDesktop.requireApp("cms.Xform", "Readerfield", null, false);
  12. //MWF.xDesktop.requireApp("cms.Xform", "Authorfield", null, false);
  13. //MWF.xDesktop.requireApp("cms.Xform", "Calendar", null, false);
  14. //MWF.xDesktop.requireApp("cms.Xform", "Textarea", null, false);
  15. //MWF.xDesktop.requireApp("cms.Xform", "Select", null, false);
  16. //MWF.xDesktop.requireApp("cms.Xform", "Radio", null, false);
  17. //MWF.xDesktop.requireApp("cms.Xform", "Checkbox", null, false);
  18. //MWF.xDesktop.requireApp("cms.Xform", "Button", null, false);
  19. MWF.xDesktop.requireApp("process.Xform", "Div", null, false);
  20. MWF.xApplication.cms.Xform.Div = MWF.CMSDiv = new Class({
  21. Extends: MWF.APPDiv
  22. });
  23. MWF.xDesktop.requireApp("process.Xform", "Common", null, false);
  24. MWF.xApplication.cms.Xform.Common = MWF.CMSCommon = new Class({
  25. Extends: MWF.APPCommon
  26. });
  27. //MWF.xApplication.cms.Xform.Image = MWF.CMSImage = new Class({
  28. // Extends: MWF.APPImage
  29. //});
  30. MWF.xDesktop.requireApp("process.Xform", "Image", null, false);
  31. MWF.xApplication.cms.Xform.Image = MWF.CMSImage = new Class({
  32. Extends: MWF.APP$Module,
  33. _loadUserInterface: function(){
  34. if (this.json.properties && this.json.properties["src"]){
  35. var value = this.json.properties["src"];
  36. if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1 || value.indexOf("x_cms_assemble_control")!=-1)){
  37. var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
  38. var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
  39. var host3 = MWF.Actions.getHost("x_cms_assemble_control");
  40. if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
  41. value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
  42. }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
  43. value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
  44. }
  45. if (value.indexOf("/x_portal_assemble_surface")!==-1){
  46. value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
  47. }else if (value.indexOf("x_portal_assemble_surface")!==-1){
  48. value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
  49. }
  50. if (value.indexOf("/x_cms_assemble_control")!==-1){
  51. value = value.replace("/x_cms_assemble_control", host3+"/x_cms_assemble_control");
  52. }else if (value.indexOf("x_cms_assemble_control")!==-1){
  53. value = value.replace("x_cms_assemble_control", host3+"/x_cms_assemble_control");
  54. }
  55. value = o2.filterUrl(value);
  56. }
  57. try{
  58. this.node.set("src", value);
  59. }catch(e){}
  60. }else if (this.json.srcfile && this.json.srcfile!="none"){
  61. value = this.json.srcfile;
  62. if (typeOf(value)==="object"){
  63. var url;
  64. if(value.portal) {
  65. url = MWF.xDesktop.getPortalFileUr(value.id, value.portal);
  66. }else if(value.appId){
  67. url = MWF.xDesktop.getCMSFileUr(value.id, value.appId);
  68. }else{
  69. url = MWF.xDesktop.getProcessFileUr(value.id, value.application);
  70. }
  71. url = o2.filterUrl(url);
  72. this.node.set("src", url);
  73. }else{
  74. var host = MWF.Actions.getHost("x_portal_assemble_surface");
  75. var action = MWF.Actions.get("x_portal_assemble_surface");
  76. var uri = action.action.actions.readFile.uri;
  77. uri = uri.replace("{flag}", value);
  78. uri = uri.replace("{applicationFlag}", this.form.json.application);
  79. value = host+"/x_portal_assemble_surface"+uri;
  80. value = o2.filterUrl(value);
  81. this.node.set("src", value);
  82. }
  83. }else if (typeOf(this.json.src)=="object"){
  84. var src = MWF.xDesktop.getImageSrc( this.json.src.imageId );
  85. this.node.set("src", src);
  86. }
  87. }
  88. });
  89. //MWF.xDesktop.requireApp("cms.Xform", "ImageClipper", null, false);
  90. //MWF.xDesktop.requireApp("cms.Xform", "Table", null, false);
  91. //MWF.xDesktop.requireApp("cms.Xform", "Datagrid", null, false);
  92. MWF.xDesktop.requireApp("process.Xform", "Html", null, false);
  93. MWF.xApplication.cms.Xform.Html = MWF.CMSHtml = new Class({
  94. Extends: MWF.APPHtml
  95. });
  96. //MWF.xDesktop.requireApp("cms.Xform", "Tab", null, false);
  97. //MWF.xApplication.cms.Xform.tab$Page = MWF.CMSTab$Page = new Class({
  98. // Extends: MWF.APPTab$Page
  99. //});
  100. //MWF.xApplication.cms.Xform.tab$Content = MWF.CMSTab$Content = new Class({
  101. // Extends: MWF.APPTab$Content
  102. //});
  103. //MWF.xDesktop.requireApp("cms.Xform", "Tree", null, false);
  104. //MWF.xDesktop.requireApp("cms.Xform", "Iframe", null, false);
  105. //MWF.xDesktop.requireApp("cms.Xform", "Htmleditor", null, false);
  106. //MWF.xDesktop.requireApp("cms.Xform", "Office", null, false);
  107. //MWF.xDesktop.requireApp("cms.Xform", "Attachment", null, false);
  108. //MWF.xDesktop.requireApp("cms.Xform", "Actionbar", null, false);
  109. //MWF.xDesktop.requireApp("cms.Xform", "Log", null, false);
  110. //MWF.xDesktop.requireApp("cms.Xform", "View", null, false);
  111. //MWF.xDesktop.requireApp("cms.Xform", "ViewSelector", null, false);
  112. //MWF.xDesktop.requireApp("cms.Xform", "Stat", null, false);
  113. MWF.xApplication.cms.Xform.Package = {};