Publish
Access
{{reader}}
Favourite Pages
{{pageEntry.pageName}}
Signed in as {{currentUser}} {{avatar}}
Sign Out
Sign In as Different User
{{currentUserExtraOptions}}
OpenForum
Actions
Publish
Get Action
Publishes a page to a remote site
Parameters
pageName - the name of the page to publish
Usage:
/OpenForum/Actions/Publish?pageName=MyPage
Server Side Javascript for GET method
//OpenForum/Actions/Publish/get.sjs
if(typeof(pageName)=="undefined") { transaction.setResult(transaction.SHOW_PAGE); } else { newPageName = transaction.getParameter("newPageName"); // Zip Page file.zipPage( pageName ); // Create page on remote site remoteSite = "http://192.168.0.127:8181"; external.getData(remoteSite+"/OpenForum/Actions/Save?pageName="+newPageName+"&fileName=page.wiki&data="); // Copy Zip to remote site parentPage = pageName.substring( 0,pageName.lastIndexOf("/") ); pageZipFile = pageName.substring( pageName.lastIndexOf("/")+1 )+".zip"; external.putFile(remoteSite+"/OpenForum/"+newPageName,parentPage,pageZipFile); // Unzip on remote site external.getData(remoteSite+"/OpenForum/Actions/Unzip?pageName="+newPageName+"&fileName="+pageZipFile); // Rebuild page on remote site external.getData(remoteSite+"/OpenForum/Actions/RefreshPage?pageName="+newPageName); htmlData = wiki.buildPage("/OpenForum/Actions/Publish","Published ["+remoteSite+"/"+newPageName+"]",true); transaction.sendPage(htmlData); }
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×