主页 > 云主机 > > 正文

服务器_凉山网站建设_最新活动

来源:胜利云 发布时间:2021-09-26 19:21 标签:服务器网站建设最新活动凉山
浏览:

This document explains steps for customizing and configuring WPC (Web Page Composer) on Portal. The document will include steps to create custom forms, their styling and how these custom forms can be made available to the users for content editing:

Web Page Composer (WPC) is a tool for business users that facilitates the creation and management of portal pages that can combine business applications with user-generated Web content and static content. In this way, major content creation activities can be performed directly by business users.

The below flowchart depicts how a content is created and then displayed to end users.

As can be seen from the above flow, to display WPC content to users, two key components are required, viz:

Any changes in look and feel of content would therefore be done in XSL, whereas any changes in the required fields or data would have to be done in XML.

The following scetions deal with this aspect and will cover in detail the following flow:

In addition, the last section touches upon the creation of custom WPC editor component on drop Down.

2.2     Creating a custom WPC XML form

2.2.1     Two major parts of XML

Below is an example of properties created for a custom form (here some of the type values are customised, for more information,                       please read about standard WPC Editor Components):

Below is an example of elements created for custom form:

2.2.2.     Description of various attributes used to create a custom form

2.2.3.     Description of the custom form created:

Note: If the system property is not defined, then the values saved in the custom component cannot be read by the WPC editor during XML transformation.

2.2.4.     Preview of XML Form

The data created using forms is stored as XML. WPC utilizes XML transformations to transform XML data into HTML content. Custom XSL after creation below is the screenshot of the XSL head:

Description of the XSL head:

XSL display logic for the content stored for form described in Section 2.1:

XSL display logic for the form described in section 2.1:

select="document/elements/element" or select="document/properties/property"

Note: Nested for-each loops cannot be used as the context is lost. For nesting, you should use xsl:if or xsl:when.

4.  As can be seen from the above screenshot, we can define different styles for various elements by checking for individual                elements using xsl:if

5.  In xsl:if, current() will have the value of the element used in select. For example:

the only thing the init() method does is to call the initializeFromPageContext()

public void initializeFromPageContext( AbstractEditorObject editorObject, IPageContext context, ComponentConfig cc) {} –>This method initializes the composite editor from the page context. The localization takes place in this method as well.

public void initialiseFromXML( String xmlContent, Attributes attributes, IPropertyMap properties, AbstractEditorObject object, IPortalComponentRequest request) {} –-> This performs the same actions as initializeFromPageContext() but initialization data is taken from the XML file.

private Component getComponent( TextEdit question, HtmlEditorComponent answer, AbstractEditorObject editorObject, Locale locale) {} –> This private method is invoked by initializeFromXML() and initializeFromPageContext() methods in order to create the UI widgets. In Web forms HTMLB UI components are used.

public Element getXMLElement( Document document, String elementId, String tagName, boolean includePropertyValues) {} –> This method creates an XML element to be added in the output XML file.

public class DropDownComponent extends AbstractEditorComponent {

private Hashtable values = new Hashtable();

private static final String application = "net";

private static final String component = "DropDownComponent";

public void init(AbstractEditorObject editorObject, ComponentConfig cc) {

initializeFromPageContext(editorObject, null, cc);

}

public void initializeFromPageContext(AbstractEditorObject editorObject, IPageContext context,         ComponentConfig cc) {

this.editorObject = editorObject;

this.componentConfig = cc;

DropdownListBox menu = null;

if (context != null) {

this.values = new Hashtable();

menu = (DropdownListBox) context.getComponentForId("menu_" + editorObject.getId());

if (menu != null) {

if (editorObject.getPropertyName().getName() != null) {

String[] menuOptions = populateData(editorObject.getPropertyName().getName());

for (int i = 0; i < menuOptions.length; i++) {

menu.addItem(menuOptions[i], menuOptions[i]);

}

setCoreValue(String.valueOf(menu.getSelection())); //this adds the value as KM property

this.values.put("menu", String.valueOf(menu.getSelection()));

}

}

}

Locale locale = Locale.getDefault();

if (context != null) {

IPortalComponentRequest request = (IPortalComponentRequest) context.getRequest();

locale = Utils.getCurrentUserLocale(request);

}

Component comp = getCompoundComponent(menu, editorObject);

setHtmlbComponent(comp);

}

public void initialiseFromXML(String xmlContent, Attributes attributes, IPropertyMap properties,

AbstractEditorObject editorObject, IPortalComponentRequest request) {

this.values = new Hashtable();

DropdownListBox menu = new DropdownListBox("menu_" + this.editorObject.getId());

if (editorObject.getPropertyName().getName() != null) {

String[] menuOptions = populateData(editorObject.getPropertyName().getName());

for (int i = 0; i < menuOptions.length; i++) {

menu.addItem(menuOptions[i], menuOptions[i]);

}

}

if (attributes.getValue(IEditorConsts.ATTR_VALUE) != null) {

if (attributes.getValue(IEditorConsts.ATTR_VALUE).equals("")) {

menu.setSelection("NA");

this.values.put("menu", "NA");

} else {

menu.setSelection((attributes.getValue(IEditorConsts.ATTR_VALUE)));

this.values.put("menu", attributes.getValue(IEditorConsts.ATTR_VALUE));

}

}

Locale locale = Utils.getCurrentUserLocale(request);

setHtmlbComponent(getCompoundComponent(menu,editorObject));

}

private Component getCompoundComponent(DropdownListBox menu, AbstractEditorObject editorObject) {

FormLayout fl = new FormLayout();

if (menu == null) {

menu = new DropdownListBox("menu_" + this.editorObject.getId());

if (editorObject.getPropertyName().getName() != null) {

String[] menuOptions = populateData(editorObject.getPropertyName().getName());

for (int i = 0; i < menuOptions.length; i++) {

menu.addItem(menuOptions[i], menuOptions[i]);

menu.setSelection(menuOptions[i]);

}

}

menu.setEnabled(editorObject.isEnabled());

}

menu.setWidth(String.valueOf(editorObject.getSize()));

FormLayoutCell flcMenu = fl.addComponent(1, 1, menu);

flcMenu.setPaddingRight("10px");

flcMenu.setPaddingLeft("0px");

flcMenu.setColspan(2);

return fl;

}

public Element getXMLElement(Document document, String elementId, String tagName, boolean includePropertyValues) {

HtmlParser parser = new HtmlParser();

Element element = document.createElement(tagName);

element.setAttribute("type", elementId);

element.setAttribute(IEditorConsts.ATTR_VALUE, this.values != null ? (String) this.values.get("menu") : "");

Text text = document.createTextNode(this.values != null ? (String) this.values.get("menu") : "");

element.appendChild(text);

return element;

}

public Element getDefaultXMLElement(Document document, String elementId, String tagName, String defaultValue,

IPropertyName propName) {

Element element = document.createElement(tagName);

element.setAttribute("type", elementId);

element.setAttribute(IEditorConsts.ATTR_VALUE, "");

return element;

}

private String[] populateData(String propName) {

String[] menuOptions = new String[10];

try {

IConfigClientContext context = IConfigClientContext.createContext();

IConfigManager configManager = Configuration.getInstance().getConfigManager(context);

if(configManager != null) {

IConfigPlugin namespacePlugin = configManager.getConfigPlugin("/cm/services/properties_metadata");

if (namespacePlugin != null) {

IMutableConfigurable[] namespaceConfigurables = namespacePlugin.getConfigurables();

for (int i = 0; i < namespaceConfigurables.length; i++) {

if (namespaceConfigurables[i].getIdValue().equals(propName)) {

Map props = namespaceConfigurables[i].getProperties(true);

menuOptions = ((String) props.get("values")).split(",");

}

}

}

}

} catch (Exception e) {

e.printStackTrace();

}

return menuOptions;

}

}

发表评论
验证码: 点击我更换图片

注:网友评论仅供其表达个人看法,并不代表本站立场。

热门文章

  • 域名备案_阿里云销售顾问_最新活动
    <strong>域名备案_阿里云销售顾问_最新活动</strong>

    域名备案_阿里云销售顾问_最新活动

    高速互联网和功能强大的应用程序使得几乎所有有办公桌工作的人都可以在家工作。然而今天,大多数公司仍然坚持要求员工忍受有时令人心碎的上下班路...

  • 数据库_分布式消息中间件实践pdf_免费领
    <strong>数据库_分布式消息中间件实践pdf_免费领</strong>

    数据库_分布式消息中间件实践pdf_免费领

    作者:马库斯·瓦纳关于2017年趋势的讨论正在迅速而激烈地展开,职场也不例外。随着新的一年即将到来,职场趋势专家们正在为2017年列出自己的预测清单...

  • 域名注册_自考数据库_免费6个月
    <strong>域名注册_自考数据库_免费6个月</strong>

    域名注册_自考数据库_免费6个月

    正如Facebook和Twitter首席运营官(COO)上周在美国国会作证时所说,出现的一个突出主题是,这些公司在保护其平台免受网络攻击方面所扮演的角色。这些公...

  • 域名解析_阿里云是什么意思_怎么买
    <strong>域名解析_阿里云是什么意思_怎么买</strong>

    域名解析_阿里云是什么意思_怎么买

    类别工作日新闻与文化财务人力资源规划技术创新分析与见解客户和社区行业金融服务政府保健高等教育款待媒体和娱乐专业和商业服务零售技术更多播客...

  • 网站服务器_王者荣耀服务器未响应_限时
    网站服务器_王者荣耀服务器未响应_限时

    网站服务器_王者荣耀服务器未响应_限时

    日本甲骨文公司今天宣布,ISOU项目采用甲骨文区块链平台管理一种本币的发行和消费。日本甲骨文公司是ISOU项目的支持公司,该项目旨在解决人口稀少地...

云储存

更多 >
  • <strong>微软云_最后的灰姑娘百度云_排行榜</strong>
    微软云_最后的灰姑娘百度云_排行榜

    SAP Lumira的1.25版现在有一个Universe查询面板扩展,您需要安装它。安装后,您将看到熟悉的查询面板。您不需要"发布"到BI平台,而需要对BI平台执行"文件>另...

  • <strong>网站空间_斗破苍穹动漫第二季百度云_哪</strong>
    网站空间_斗破苍穹动漫第二季百度云_哪

    如果你读过我以前的博客,那么你就知道如何创建一个定制报告程序,根据映射表自动分析APO中的CIF后处理记录,并从阻塞的队列/记录中提取错误消息号。...

云储存游戏服务器_滨州网站建设_学生机
云储存网站空间_申报数据库_怎么样
云储存文件存储_rms服务器_免费1年
云储存微软云_哪家企业邮箱好_精选特惠
云储存企业网站_宁波网站建设哪家好_9元