001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.console.web.develop.web.page;
009:
010: //base classes
011: import java.io.IOException;
012: import java.util.ArrayList;
013: import java.util.HashMap;
014:
015: //project specific classes
016: import org.jfolder.common.UnexpectedSystemException;
017: import org.jfolder.common.tagging.ConceptTagPreferences;
018: import org.jfolder.common.tagging.RootConceptTagHolder;
019: import org.jfolder.common.utils.xml.XMLHelper;
020: import org.jfolder.common.web.template.SubmitActionContext;
021: import org.jfolder.common.web.template.SubmitActionParameters;
022: import org.jfolder.console.base.ConsolePageContext;
023: import org.jfolder.console.base.ConsolePageParameters;
024: import org.jfolder.console.base.ConsolePageSession;
025: import org.jfolder.console.base.NamesForParentCpc;
026: import org.jfolder.console.base.context.RenderConsolePageContextHelper;
027: import org.jfolder.console.base.context.SubMessageHolderConsolePageContext;
028: import org.jfolder.console.config.ConsoleConfig;
029: import org.jfolder.console.config.ConsoleConfigTagPreferencesHelper;
030:
031: //other classes
032:
033: public class RenderWebPageContextHelper extends
034: RenderConsolePageContextHelper {
035:
036: private RenderWebPageContextHelper() {
037: }
038:
039: public final static void renderWebPageContext(
040: ConsolePageContext inCpc, ConsoleConfig inCc)
041: throws IOException {
042:
043: RenderWebPageContextHelper rwpch = new RenderWebPageContextHelper();
044:
045: rwpch.render(inCpc, inCc);
046: }
047:
048: protected boolean renderCustomSubPane(ConsolePageContext inCpc,
049: String inContext, ConsoleConfig inCc, int inSection,
050: int inIndex) throws IOException {
051: //
052:
053: boolean outValue = false;
054:
055: HashMap mainProps = getAllMainProperties(inCc);
056: HashMap contextProps = null;
057: if (inSection == AREA__LEFT) {
058: contextProps = getAllLeftSectionPaneProperties(inCc,
059: inIndex);
060: } else if (inSection == AREA__CENTER) {
061: contextProps = getAllCenterSectionPaneProperties(inCc,
062: inIndex);
063: } else if (inSection == AREA__RIGHT) {
064: contextProps = getAllRightSectionPaneProperties(inCc,
065: inIndex);
066: } else {
067: throw UnexpectedSystemException.unknownState();
068: }
069:
070: if (inContext
071: .equals(ConsoleConfigTagPreferencesHelper.CONTEXT__WEB_PAGE_DISPLAY)) {
072: //
073:
074: //
075: ArrayList barIconUrls = new ArrayList();
076: ArrayList barIconLabels = new ArrayList();
077: ArrayList barIconSacs = new ArrayList();
078:
079: //
080: initializeActions(barIconUrls, barIconLabels, barIconSacs,
081: inCc, inSection, inIndex, inCpc);
082:
083: int width = getContextWidth(contextProps);
084: int height = getContextHeight(contextProps);
085:
086: DevelopWebPagePaneViewContext.newInstance(inCpc,
087: (width / inCpc.getColumnWidth()), height, 50, 50,
088: convertToStringList(barIconUrls),
089: convertToStringList(barIconLabels),
090: convertToSacList(barIconSacs));
091: //BasePaneRcthTreeConsolePageContext.newInstance(
092: // inCpc, (width/inCpc.getColumnWidth()), height, 50, 50,
093: // new String[0], new String[0], new SubmitActionContext[0]);
094: //BasePaneRcthTagConsolePageContext newInstance(
095: // ConsolePageContext inCpc, int inColumnCount,
096: // int inHeight, int inBarHeight, int inBarColumnWidth,
097: // String inBarIconUrls[], String inBarIconLabels[],
098: // SubmitActionContext inBarSac[])
099: outValue = true;
100: }
101:
102: return outValue;
103: }
104: }
|