^1640740822412
@
sname
EditHtmlPage
slabel
EditHtmlPage
sdescriptors
xworker.web.controls.SimpleControl
sth_createIndex
false
sth_registMyChilds
false
sth_mark
false
  @/@actions
  sname
  actions
  sdescriptors
  xworker.web.controls.SimpleControl/@actions
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  actions
    @/@actions/@doAction
    sname
    doAction
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.Thing;

import xworker.dataObject.DataObject;
import xworker.doc.treehtmldoc.HtmlInfo;

def docThing = world.getThing(requestBean.docPath);

if(docThing.getBoolean("isNeedLogin") && session.getAttribute(requestBean.docPath) == null){
    response.sendRedirect("do?sc=xworker.doc.treehtmldoc.AdminLogin&docPath=" + requestBean.docPath);
    return;
}

def id = requestBean.id;
def page = HtmlInfo.getPageThing(docThing, id);
if(requestBean.command == "save"){
    def content = requestBean.content;
    page.set("description", content);
    page.save();
}

actionContext.getScope(0).put("value", page.getString("description"));
return "success";
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    doAction
      @/@actions/@doAction/@contexts
      sname
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_mark
      false
      sid
      contexts
        @/@actions/@doAction/@contexts/@DataSouceActionContext
        sname
        DataSouceActionContext
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        ognl:world.getThing(requestBean.get("docPath")).dataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.context.Contexts/@DataSouceActionContext
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        DataSouceActionContext
  @/@view
  sname
  view
  sbelongToHtml
  true
  stitle
  editor
  sstyle
  default
  shasHead
  false
  shasBottom
  false
  SotherHeads
#$@text#$@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>
#$@text#$@
  sdescriptors
  xworker.web.controls.SimpleControl/@view
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  view
    @/@view/@code
    sname
    code
    Scode
#$@text#$@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
	<title>SWT Kckeditor</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!--<script type="text/javascript" src="fckeditor/2.6beta1/fckeditor.js"></script>-->
	<script type="text/javascript" src="fckeditor/4_1/ckeditor.js"></script>
	<script type="text/javascript">
function getContents(){	
	var oEditor = CKEDITOR.instances.data ;	
	window.status = "html_edit_content:" + oEditor.getData();
  	//alert(window.status) ;	
}

function setContents(html){
    var oEditor = CKEDITOR.instances.data ;	
    
    html = html.replace(new RegExp("&_n_;","gm"), "\n");
    html = html.replace(new RegExp("&_r_;","gm"), "\r");
    html = html.replace(new RegExp("&_quot_;","gm"), "\"");
    oEditor.setData(html);
    //oEditor.SetHTML(html);
    //var contentDiv = document.getElementById("data");
    //contentDiv.value = html;
}

function setContentsFirst(html){
    //var oEditor = FCKeditorAPI.GetInstance('data') ;
    //oEditor.SetHTML(html);
    
    html = html.replace(new RegExp("&_n_;","gm"), "\n");
    html = html.replace(new RegExp("&_r_;","gm"), "\r");
    html = html.replace(new RegExp("&_quot_;","gm"), "\"");
    var contentDiv = document.getElementById("data");
    contentDiv.value = html;
}

function executeCommand( commandName ){
	  var oEditor = FCKeditorAPI.GetInstance('data') ;

	  // Execute the command.
	  oEditor.Commands.GetCommand( commandName ).Execute() ;
}

function FCKeditor_OnComplete( editorInstance ){
	  executeCommand("FitWindow");	  
}
</script>
</head>
<body>	
	<form id="contentForm" name="contentForm" method="post" action="do" >
	    <input type="hidden" name="sc" value="xworker.doc.treehtmldoc.EditHtmlPage"/>
	     <input type="hidden" name="thingPath" value="${requestBean.thingPath?if_exists}"/>
	     <input type="hidden" name="command" value="save"/>
	     <input type="hidden" name="id" value="${requestBean.id}"/>
	     <input type="hidden" name="docPath" value="${requestBean.docPath}"/>
		<textarea  id="data" name="content" rows="20" cols="60">${(value?html)?if_exists}</textarea>
<script language="javascript">    
    var editor = CKEDITOR.replace('data',{ 
filebrowserImageBrowseUrl : 'do?sc=xworker.doc.treehtmldoc.FileBrowser&docPath=${requestBean.docPath}',  
filebrowserFlashBrowseUrl : 'do?sc=xworker.doc.treehtmldoc.FileBrowser&docPath=${requestBean.docPath}'  
        });
    editor.on('instanceReady',   // editor是CKEDITOR的一个实例
                 function(event){
                    event.editor.getCommand('maximize').exec();
                  }
    );    

    //var oFCKeditor = new FCKeditor( 'data' ) ;    
    //oFCKeditor.BasePath = "fckeditor/";
    //oFCKeditor.ToolbarSet="${(requestBean.toolbarSet)?default("SwtEdit")}";
    //oFCKeditor.ReplaceTextarea() ;    
     
</script>
	<form id="contentForm" name="contentForm" method="post" action="do?sc=xworker.swt.xworker.HtmlEditorHttp/@showEditorHtml">
	     <input type="hidden" name="editorContent"  id="editorContent" value=""/>
	</form>
</body>
</html>
#$@text#$@
    sdescriptors
    xworker.html.base.container.childs/@code
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_mark
    false
    sid
    code
  @/@success
  sname
  success
  stype
  form
  scontentType
  text/html;charset=UTF-8
  svalue
  xworker.doc.treehtmldoc.EditHtmlPage/@view
  sdescriptors
  xworker.web.controls.SimpleControl/@result
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_mark
  false
  sid
  success
