Page should be rendered in a Container with type of Page. Page will be rendered using: configuration file, page processor class file, view html file, language file, and plugin as needed. Configuration file is rendering control that define what should be used and how to render the page. Page processor class file is used to process the request and render the defined output. View html file is used to forming the output together with page processor class file. Language file is used as language source of rendered page. Plugin can be used as additional components of rendered page.
Example is rendering dynamic and sortable grid of this screenshot:
configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<page name="_CurActvsList" id="_CurActvsList" >
<processor PageSecurityCode="18"
sOnlyTemplateFileName="ADM__CurActvsList.html" CanPublic="false">
<PageActionSelectionScript><![CDATA[
switch ((string)GetCurrentPageConfig("sForm")) {
case "CurActvsList":
CIISONLINE_ADM__CurActvsList::CurActvsListAction (GetCurrentPageConfig("sAction"));
}
]]></PageActionSelectionScript>
<TemplateProcessingScript><![CDATA[
CIISONLINE_ADM__CurActvsList::CurActvsList_Show();
]]></TemplateProcessingScript>
<ResponseProcessingScript><![CDATA[
ResponseWrite (PrintVar("main"));
]]></ResponseProcessingScript>
<IncludeFile>PageClass/ADM_Header.php</IncludeFile>
<IncludeFile>PageClass/ADM_Footer.php</IncludeFile>
<IncludeFile>PageClass/ADM__CurActvsList.php</IncludeFile>
<TemplateSpaceHolder name="Header">ADM_Header.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Footer">ADM_Footer.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space01">Space01.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space02">Space02.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space03">Space03.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space04">Space04.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space05">Space05.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space06">Space06.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space07">Space07.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space08">Space08.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space09">Space09.html</TemplateSpaceHolder>
<TemplateSpaceHolder name="Space10">Space10.html</TemplateSpaceHolder>
</processor>
</page>
page processor file:
class CIISONLINE_ADM__CurActvsList extends CIISONLINE_PageProcessor{
static function MenuPath_Show() {
}
protected static function CommonSetVar() {
/* Common Javascript Setting Value */
CommonSetVar();
/*-------------------------------*/
SetVar ("msg_reallytodeleteCurActvs",
ToHTML(GetTextLanguage("sCurActvsListMsgReallyToDeleteActivities")));
}
static function Search_Show() {
SetVar ("CurActvsListSearchTitle",
ToHTML(GetTextLanguage("sCurrentActivitiesCurActvsListSearchTitle")));
SetVar ("KeywordsCaption",
ToHTML(GetTextLanguage("sCurrentActivitiesKeywordsTitle")));
SetVar ("LoginCaption",
ToHTML(GetTextLanguage("sCurrentActivitiesLoginColumnTitle")));
SetVar ("ModuleIdCaption",
ToHTML(GetTextLanguage("sCurrentActivitiesModuleIdColumnTitle")));
SetVar ("ModifiedTimeCaption",
ToHTML(GetTextLanguage("sCurrentActivitiesModifiedTimeColumnTitle")));
SetVar ("ds_keywords", ToHTML(GetParam("ds_keywords")));
SetVar ("ds_moduleid", ToHTML(GetParam("ds_moduleid")));
SetVar ("ds_login", ToHTML(GetParam("ds_login")));
SetVar ("ds_modifiedtime", ToHTML(GetParam("ds_modifiedtime")));
SetVar ("SearchButton",
ToHTML(GetTextLanguage("sCurrentActivitiesSearchButtonTitle")));
/* Common Javascript Setting Value */
self::CommonSetVar();
/*-------------------------------*/
Parse ("CurActvsSearchForm", false);
}
static function CurActvsListAction($sAction) {
$fldNumDisplayedRows = GetParam("DisplayedRows");
if ((string)$sAction == "delete"
&& (string)$fldNumDisplayedRows!=""
&& is_numeric($fldNumDisplayedRows)) {
if ($fldNumDisplayedRows>0){
$sListCurActvsListAction = ListToGetSelectedSQLListOfHTTPRequest2(
$fldNumDisplayedRows,"caid",",","Text"
);
}
}
if (isset($sListCurActvsListAction)
&& (string)$sListCurActvsListAction!="") {
switch ($sAction) {
case "delete":
$sSQL = "delete from ".GetTableConfig("sCurrentActvsTbNm")
." where "
.GetTableConfig("sCurrentActvsTbColPrefix")."01 in (".
$sListCurActvsListAction.")";
ExecuteSQL2 ($sSQL);
$sError = ProcessError();
if ((string)$sError!="") {
SetCurrentPageConfig ("sPageErrorMessage",
ToHTML(GetTextLanguage("sErrorExecutingDatabaseCommand"))
.GetSystemConfig("sHTMLMessageSeparator"));
OnPageAccessErrorLogWrite ($sError);
}
}
}
}
/*===============================
* Display Grid Form
*-------------------------------*/
static function CurActvsList_Show() {
$sFileName = GetParam("sFileName");
if ((string)$sFileName=="")
$sFileName = GetFullURLAddress(
GetCommandNameConfig("sCurActvsListPageCommandName"),"");
$sFormParams = "ds_keywords=".ToURL(GetParam("ds_keywords"))
."&ds_moduleid=".ToURL(GetParam("ds_moduleid"))
."&ds_modifiedtime=".ToURL(GetParam("ds_modifiedtime"))
."&ds_login=".ToURL(GetParam("ds_login"))."&rspp=".ToURL(GetParam("rspp"))."&";
$sMenuPath = "";
if ((string)GetParam("MenuPath")=="") {
$sMenuPathParams = $sMenuPath;
} else {
$sMenuPathParams = GetParam("MenuPath").",".$sMenuPath;
}
$sMenuPathParams = "MenuPath=".ToURL($sMenuPathParams)."&";
$sPageErrorMessage = GetCurrentPageConfig("sPageErrorMessage");
if ($sPageErrorMessage=="") {
SetVar ("ActionMessage", "");
/* Info Successfull Access */
OnPageAccessInfoLogWrite ("");
} else {
SetVar ("message", ($sPageErrorMessage));
Parse ("ActionMessage", false);
}
/* Common Javascript Setting Value */
self::CommonSetVar();
/*-------------------------------*/
$sCurrentActvsTbNm = GetTableConfig("sCurrentActvsTbNm");
$sCurrentActvsTbColPrefix = GetTableConfig("sCurrentActvsTbColPrefix");
$sWhere = "";
$pkeywords = GetParam("ds_keywords");
if ((string)$pkeywords != "") {
if ((string)$sWhere != "") $sWhere = " AND ";
$sWhere .= "(c.".$sCurrentActvsTbColPrefix."02 like '%"
.str_replace("'", "''",$pkeywords)
."%' or c.".$sCurrentActvsTbColPrefix."03 like '%"
.str_replace("'","''",$pkeywords) ."%') ";
}
$pModuleId = GetParam("ds_moduleid");
if ((string)$pModuleId != "") {
if ((string)$sWhere != "") $sWhere .= " AND ";
$sWhere .= "c.".$sCurrentActvsTbColPrefix."07=".ToSQL($pModuleId, "Text");
}
$pLogin = GetParam("ds_login");
if ((string)$pLogin != "") {
if ((string)$sWhere != "") $sWhere .= " AND ";
$sWhere .= "c.".$sCurrentActvsTbColPrefix."03=".ToSQL($pLogin, "Text");
}
$pModifiedTime = GetParam("ds_modifiedtime");
if ((string)$pModifiedTime != "" && isDisplayDateTimeString($pModifiedTime)) {
if ((string)$sWhere != "") $sWhere .= " AND ";
$sWhere .= "c.".$sCurrentActvsTbColPrefix."13<"
.ToSQL(DisplayDateToValue($pModifiedTime), "Date");
}
$oPaging = new CIISONLINE_Paging(
"FormCurActvsList","CheckAllCurActvs","DListCurActvsList"
,"CurActvsListNoRecords","CurActvsListNavigator","");
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."01"
,"curactv_id","ActivityIdColumn",""
,GetTextLanguage("sCurrentActivitiesActivityIdColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."02"
,"curactv_accountid","AccountIdColumn",""
,GetTextLanguage("sCurrentActivitiesAccountIdColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."03"
,"curactv_login","LoginColumn",""
,GetTextLanguage("sCurrentActivitiesLoginColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."04"
,"curactv_logintime","LoginTimeColumn",""
,GetTextLanguage("sCurrentActivitiesLoginTimeColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."05"
,"curactv_loginfrom","LoginFromColumn",""
,GetTextLanguage("sCurrentActivitiesLoginFromColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."06"
,"curactv_loginstatus","LoginStatusColumn",""
,GetTextLanguage("sCurrentActivitiesLoginStatusColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."07"
,"curactv_moduleid","ModuleIdColumn",""
,GetTextLanguage("sCurrentActivitiesModuleIdColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."08"
,"curactv_page","PageColumn",""
,GetTextLanguage("sCurrentActivitiesPageColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."09"
,"curactv_sessionid","SessionIdColumn",""
,GetTextLanguage("sCurrentActivitiesSessionIdColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."10"
,"curactv_accessas","AccessAsColumn",""
,GetTextLanguage("sCurrentActivitiesAccessAsColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."11"
,"curactv_loginouttime","LogTimeColumn",""
,GetTextLanguage("sCurrentActivitiesLogTimeColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."12"
,"curactv_createdtime","CreatedTimeColumn",""
,GetTextLanguage("sCurrentActivitiesCreatedTimeColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."13"
,"curactv_modifiedtime","ModifiedTimeColumn",""
,GetTextLanguage("sCurrentActivitiesModifiedTimeColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."14"
,"curactv_logouttime","LogoutTimeColumn",""
,GetTextLanguage("sCurrentActivitiesLogoutTimeColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."15"
,"curactv_useragent","UserAgentColumn",""
,GetTextLanguage("sCurrentActivitiesUserAgentColumnTitle"));
$oPaging->AddSQLDataColumn("c.".$sCurrentActvsTbColPrefix."16"
,"curactv_instanceid","InstanceColumn",""
,GetTextLanguage("sCurrentActivitiesInstanceColumnTitle"));
$oPaging->AddKeyColumn(0);
$oPaging->AddDynamicDataColumn("Prmcuractv_curactv_id","\");
$oPaging->AddStaticDataColumn("curactv_URLLink"
,GetFullURLAddress(GetCommandNameConfig("sCurActvViewPageCommandName"),""));
$oPaging->AddColumnFilter(7,"MaxLength25");
$oPaging->SQLDataFrom=$sCurrentActvsTbNm." c";
$oPaging->SQLDataOrder = " order by c.".$sCurrentActvsTbColPrefix."02 Asc";
$oPaging->FormTitle = GetTextLanguage("sCurrentActivitiesFormTitle");
$oPaging->AddTitle("DeleteCommand"
,GetTextLanguage("sCurrentActivitiesDeleteCommandTitle"));
$oPaging->AddTitle("ExportCommand"
, GetTextLanguage("sCurrentActivitiesExportCommandTitle"));
$oPaging->FormAction=GetFullURLAddress(
GetCommandNameConfig("sCurActvViewPageCommandName"), "");
$oPaging->FormParams=$sFormParams;
$oPaging->TransitParams="rspp=".ToURL(GetParam("rspp"))."&";
$oPaging->AddParams("MenuPathParams", ($sMenuPathParams));
$oPaging->AddParams("FileName",$sFileName);
$oPaging->AddParams("CurActvsExportLink"
,GetFullURLAddress(GetCommandNameConfig("sCurActvsExportPageCommandName"), ""));
$oPaging->ProcessSorting();
$sOrder = $oPaging->GetSQLSortOrder();
$oPaging->WhereInSQLDataFrom=false;
$oPaging->SQLSelection=$oPaging->BuildSQLSelection(false,$sWhere,$sOrder);
$oPaging->SQLCountSelection=$oPaging->BuildSQLCountSelection(false,$sWhere);
$oPaging->RecordsPerPage=GetCurrentUserRecordsPerPageSetting(
GetUserConfigPreferenceConst("iUserConfigNumActivitiesPerPageListPage")
,GetSystemConfig("iDefNumActivitiesPerPage"));
$oPaging->CalculatePagesCount();
$oPaging->CurrentPage=$oPaging->GetPageParam();
$oPaging->DisplayedIDsListName="caidList";
$oPaging->NumberOfPagesToList = GetCurrentUserConfig("iNumDisplayedPageNavigator");
$oPaging->DataList_Show();
unset($oPaging);
}
}
page view file:
<!--BeginFormCurActvsList-->
<form method="POST" Action="{FileName}" name="CurActvsList" id="CurActvsList" accept-charset="UTF-8">
<table class="FormTABLE" width="100%">
<!--BeginActionMessage-->
<tr>
<td class="FormMessageTD" colspan="11">
<font class="FormMessageFONT">{message}</font></td>
</tr>
<!--EndActionMessage-->
<tr>
<td class="FormHeaderTD" colspan="11">
<a name="CurActvs" id="CurActvs"><font class="FormHeaderFONT">{FormTitle}</font></a></td>
</tr>
<tr>
<td class="ColumnTD" nowrap>
<font class="ColumnFONT"><!--BeginCheckAllCurActvs-->
<input type="checkbox" name="caidall" id="caidall" value="ON" onclick="checkboxselection2('caid','{DisplayedRows}','CurActvsList');">
<!--EndCheckAllCurActvs--></font></td>
<td class="ColumnTD" nowrap>
<a href="{FileName}{FormParams}FormCurActvsList_Sorting=1
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ActivityIdColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=2
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{AccountIdColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=3
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=4
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginTimeColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=5
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{LoginFromColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=7
&FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ModuleIdColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=8&
FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{PageColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=10&
FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{AccessAsColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=13&
FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{ModifiedTimeColumn}</font></a></td>
<td class="ColumnTD" nowrap><a href="{FileName}{FormParams}FormCurActvsList_Sorting=16&
FormCurActvsList_Sorted={Form_Sorting}&">
<font class="ColumnFONT">{InstanceColumn}</font></a></td>
</tr>
<!--BeginDListCurActvsList-->
<tr>
<td class="DataTD" nowrap>
<font class="DataFONT">
<input type="checkbox" name="caid{counter}" id="caid{counter}" value="{curactv_id}">
</font></td>
<td class="DataTD" nowrap>
<a href="{curactv_URLLink}{FormParams}{MenuPathParams}curactv_id={Prmcuractv_curactv_id}">
<font class="DataFONT">{curactv_id}</font></a></td>
<td class="DataTD" nowrap><font class="DataFONT">{curactv_accountid}</font></td>
<td class="DataTD" nowrap><font class="DataFONT">{curactv_login}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT">{curactv_logintime}</font></td>
<td class="DataTD" nowrap><font class="DataFONT">{curactv_loginfrom}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT">{curactv_moduleid}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT" width="100%">{curactv_page}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT">{curactv_accessas}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT">{curactv_modifiedtime}</font></td>
<td class="DataTD" nowrap> <font class="DataFONT">{curactv_instanceid}</font></td>
</tr>
<!--EndDListCurActvsList-->
<!--BeginCurActvsListNoRecords-->
<tr><td colspan="11" class="DataTD"><font class="DataFONT">{NoRecords}</font></td></tr>
<!--EndCurActvsListNoRecords-->
<tr>
<td colspan="11" class="ColumnTD">
<table width="100%">
<tr>
<td align="left" nowrap>
<a href="javascript:gotopage('{CurActvsExportLink}');">
<font class="ColumnFONT">{ExportCommand}</font></a>
<!--BeginBulkFooterOperation-->
<a href="javascript:del();"><font class="ColumnFONT">{DeleteCommand}</font></a>
<!--EndBulkFooterOperation-->
</td>
</tr>
<tr>
<td align="right" nowrap>
<!--BeginCurActvsListNavigator-->
<a href{CurActvsListNavigatorFirstPage}
="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={FirstPage}#CurActvs">
<font class="ColumnFONT">{First}</font></a>
<a href{CurActvsListNavigatorFirstPage}
="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={PrevPage}#CurActvs">
<font class="ColumnFONT">{Previous}</font></a>
<font class="ColumnFONT">[
<!--BeginCurActvsListNavigatorPages-->
<a href{NavigatorPageSwitch}
="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={NavigatorPageNumber}#CurActvs">
<font class="ColumnFONT">{NavigatorPageNumberView}</font></a>
<!--EndCurActvsListNavigatorPages-->
{NumberOfPages} {CurActvsListNavigatorPagesCount} ]</font>
<a href{CurActvsListNavigatorLastPage}
="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={NextPage}#CurActvs">
<font class="ColumnFONT">{Next}</font></a>
<a href{CurActvsListNavigatorLastPage}
="{FileName}{FormParams}{SortParams}FormCurActvsList_Page={LastPage}#CurActvs">
<font class="ColumnFONT">{Last}</font></a>
<!--EndCurActvsListNavigator-->
</td>
</tr>
</table>
</td>
</tr>
<input type="hidden" name="FormName" id="FormName" value="CurActvsList">
<input type="hidden" name="FormAction" id="FormAction" value="">
<input type="hidden" name="caidList" id="caidList" value="{caidList}">
<input type="hidden" name="DisplayedRows" id="DisplayedRows" value="{DisplayedRows}">
</table>
</form>
<!--EndFormCurActvsList-->
page language file:
<?xml version="1.0" encoding="UTF-8"?>
<language page="CurActvsList">
<category name="label" >
<title name="sCurrentActivitiesFormTitle">Current Activities</title>
<title name="sCurrentActivitiesActivityIdColumnTitle">Activity ID</title>
<title name="sCurrentActivitiesAccountIdColumnTitle">Account ID</title>
.....
.....
<title name="sCurrentActivitiesCurActvsListSearchTitle">Search</title>
<title name="sCurrentActivitiesKeywordsTitle">Keywords</title>
<title name="sCurrentActivitiesSearchButtonTitle">Search</title>
</category>
<category name="error_message" >
<title name="sCurActvsListMsgReallyToDeleteActivities">Really To Delete?</title>
</category>
</language>
No comments:
Post a Comment