on 03-10-2014 5:07 PM
Hi everybody,
I'm tring to follow a guide, to create a custom layout for the web page composer.
This guide:
I builded the portal project and I deployed it on the portal.
Actualy i can see and select my custom layout and i can drop the element on the container from the page builder, but, when i save the content I can't see any elements anymore.
If I publish the page I see my custom Layout... but empty, without any paragraph or article.
Do u have any idea on why this could appen ?
Best regards Enrico.
To everybody,
I made it to work,
the error was pretty stupid just didnt report the right container id on the com.sap.portal.reserved.layout.Cont1 property in my portalapp.xml.
JSP
<lyt:container id="testoSinistra" />
PORTALAPP
<property name="com.sap.portal.reserved.layout.Cont1" value="testoSinistra">
<property name="title" value="Left Column"/>
<property name="orientation" value="vertical"/>
</property>
I will upload the project for anyone who have any issue on implementing a WPC layout.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enrico, thanks for sharing! it's priceless!
I have a question about XML_Template:
You've used
...
layoutID="pcd:portal_content/templates/pcc/layouts/1Top4Bottom_(100__25_25_25_25)"
pageID="1Top4Bottom"
...
<CustomAttributes>
<Attribute key="JSP_Template" value="gpar:/1Top4BottomLayout/1Top4Bottom"/>
</CustomAttributes>
However, your project is named meli.it.WebPageComposerCustomLayouts and your component is meli_layout.
Despite that, did you be able to work properly with this custom layout both in design time and runtime?
Perhaps I'm confused about this. After several tries, I was not be able to get working my custom layout.
Hope you can help me.
Thanks in advance
BR
Marcelo.
Hi Enrico,
you're right, my XML_Template was malformed.
After I've corrected it, everything work like a charm.
Related to layoutID and pageID, I've followed this KBA article:
1748950 - Custom WPC layouts displayed incorrectly at Design Time after upgrade to 7.3
I think it's somehow related because, in the end, it worked.
A true mistery, indeed
Thanks for your help.
Best regards,
Marcelo
Hi everybody,
Thanks for your help but I still didn't make my layout work.
I uploaded the project on my dropbox and i will share here the link.
Hope somebody can have a look on it and help me to find the problem.
Here is the link:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enrico,
Your XML template in portalapp.xml is collapsed, that's probably the reason, it misses spaces.
Example:
Instead of <Constainer containerID="com.sap.portal.reserved.layout.Cont1">
You have <ContainercontainerID="com.sap.portal.reserved.layout.Cont1">
My suggestion is that you take the XML template, decode it using:
http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/decode.aspx
make sure you do all of the spacing correctly and then use
to encode it back and insert it to the portalapp.xml
BR,
Saar
Ok guys,
I just copied the xml descriptor from the guide and than I had one compoenet.
I paste here the source for the application-config and the component I'm interested on.
<application-config>
<property name="SharingReference" value="com.sap.portal.pagebuilder"/>
</application-config>
<components>
<component name="meli_layout">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.pcm.Title" value="Meli Book Layout"/>
<property name="com.sap.portal.pcm.Description" value="Meli Book Layout"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="meli_two_columns.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="testoSinistra" value="top">
<property name="title" value="Left Column"/>
<property name="orientation" value="vertical"/>
</property>
<property name="TestoDestra" value="bottom1">
<property name="title" value="Right Column"/>
<property name="orientation" value="vertical"/>
</property>
<property name="XML_Template" value="<?xml version="1.0" encoding="UTF-8"?><PageLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/PBlayout.xsd" layoutID="pcd:portal_content/templates/pcc/layouts/1Top4Bottom_(100__25_25_25_25)" pageID="1Top4Bottom"><CustomAttributes><Attribute key="JSP_Template" value="gpar:/1Top4BottomLayout/1Top4Bottom" /></CustomAttributes><TableLayout width="100%" height="100%" cols="2" /><ContainersRow><Container containerID="testoSinistra"><TableCellData width="50%" height="100%" colSpan="1" vAlign="top" /></Container><Container containerID="testoDestra"><TableCellData width="50%" height="100%" colSpan="1" vAlign="top" /></Container></ContainersRow></PageLayout>"/>
</component-profile>
</component>
</components>
I also had a look on this guide:
How to Use the Tag Library - Running an Enterprise Portal - SAP Library
It looks pretty similar to what I got apart for this line on the <component-profile> tag:
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
that is on the sap How To
<property name="NavigationTagLibrary"
value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
I tried to change it and save thje project but i still get the error on the jsp page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<?xml version="1.0" encoding="ISO-8859-1"?>
<application>
<application-config>
...
<property name="SharingReference" value="knowledgemanagement,
com.sap.portal.pagebuilder,
com.sap.portal.navigation.navigationtaglibrary,
com.sap.portal.useragent"/>
<property name="SafetyLevel" value="no_safety"/>
</application-config>
<components>
<component name="xxx">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="com.sap.portal.page.builder.optimization.level" value="2"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="TagLibSAPLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="TagLibSAPNavigation" value="/SERVICE/com.sap.portal.navigation.navigationtaglibrary/taglib/TagLibrary.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="framework/layout_framework.jsp"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="TechnicalContainer">
<property name="plainDescription" value="Technical Container"/>
<property name="orientation" value="vertical"/>
</property>
</component-profile>
</component>
</components>
<services/>
</application>
This works well for me, please try it on your own
regards
Hi Lawrence,
I uploaded my project on dropbox, if you can have a look on it, maybe you can find the issue.
I still couldn't find it.
Thanks for your help anyway.
It's still not working,
I get this exception:
[PortalAppBroker.getJSPResourceComponent() failed jsp/meli_two_columns.jsp@meli.it.WebPageComposerCustomLayouts.meli_layout
[EXCEPTION]
com.sap.portal.prt.om.ObjectNotAvailableException: Object: [jsp/meli_two_columns.jsp@meli.it.WebPageComposerCustomLayouts.meli_layout] load failed
at com.sap.portal.prt.om.ObjectsManager.createObejctHandle(ObjectsManager.java:246)
at com.sap.portal.prt.om.ObjectsManager.getObjectHandle(ObjectsManager.java:147)
at com.sap.portal.prt.broker.PortalAppBroker.getJSPResourceComponent(PortalAppBroker.java:456)
...
...
...
Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [prt:taglib:TagLibSAPLayout]. Possible reason - validation failed. Check if your TLD is valid against its scheme.
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspTaglibDirective.registerTaglib(JspTaglibDirective.java:279)
...
...
...
Caused by: java.lang.NullPointerException: while trying to invoke the method com.sapportals.portal.prt.deployment.descriptor.IConfiguration.getPropertyValue(java.lang.String) of an object loaded from local variable 'profile'
at com.sap.portal.prt.servlets_jsp.syntax.JspTaglibDirective.determineInternalTaglibLocation(JspTaglibDirective.java:124)
Any ideas ?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application>
<application-config>
<property name="SharingReference" value="knowledgemanagement,
com.sap.portal.pagebuilder,
com.sap.portal.navigation.navigationtaglibrary,
com.sap.portal.useragent"/>
<property name="SafetyLevel" value="no_safety"/>
</application-config>
<components>
<component name="overview">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="TagLibSAPLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="TagLibSAPNavigation" value="/SERVICE/com.sap.portal.navigation.navigationtaglibrary/taglib/TagLibrary.tld"/>
<property name="com.sap.portal.pcm.Title" value="Book (100,25|25|25|25)"/>
<property name="com.sap.portal.pcm.Description" value="Book Layout (100% Top, 25% Bottom mostleft, 25% Bottom left, 25% Bottom right, 25 Bottom mostright)"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="book.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="top">
<property name="title" value="Top Column"/>
<property name="orientation" value="vertical"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="bottom1">
<property name="title" value="Bottom Column leftmost"/>
<property name="orientation" value="vertical"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont3" value="bottom2">
<property name="title" value="Bottom Column left"/>
<property name="orientation" value="vertical"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont4" value="bottom3">
<property name="title" value="Bottom Column right"/>
<property name="orientation" value="vertical"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont5" value="bottom4">
<property name="title" value="Bottom Column rightmost"/>
<property name="orientation" value="vertical"/>
</property>
<property name="XML_Template" value="<?xmlversion="1.0" encoding="UTF-8"?><PageLayoutxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="../xsd/PBlayout.xsd"layoutI... width="100%" height="100%"cols="4"/><ContainersRow><ContainercontainerID="com.sap.portal.reserved.layout.Cont1"><TableCellData width="100%" height="100%" colSpan="4"vAlign="top"/></Container></ContainersRow><ContainersRow><ContainercontainerID="com.sap.portal.reserved.layout.Cont2"><TableCellData width="25%" height="100%" colSpan="1"vAlign="top"/></Container><ContainercontainerID="com.sap.portal.reserved.layout.Cont3"><TableCellData width="25%" height="100%" colSpan="1"vAlign="top"/></Container><ContainercontainerID="com.sap.portal.reserved.layout.Cont4"><TableCellData width="25%" height="100%" colSpan="1"vAlign="top"/></Container><ContainercontainerID="com.sap.portal.reserved.layout.Cont5"><TableCellData width="25%" height="100%" colSpan="1"vAlign="top"/></Container></ContainersRow></PageLayout>"/>
</component-profile>
</component>
<component name="meli_layout">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="TagLibSAPLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="TagLibSAPNavigation" value="/SERVICE/com.sap.portal.navigation.navigationtaglibrary/taglib/TagLibrary.tld"/>
<property name="com.sap.portal.pcm.Title" value="Meli Book Layout"/>
<property name="com.sap.portal.pcm.Description" value="Meli Book Layout"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="meli_two_columns.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="top">
<property name="title" value="Left Column"/>
<property name="orientation" value="vertical"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="top2">
<property name="title" value="Right Column"/>
<property name="orientation" value="vertical"/>
</property>
<property name="XML_Template" value="<?xml version="1.0" encoding="UTF-8"?><PageLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/PBlayout.xsd" layoutID="pcd:portal_content/templates/pcc/layouts/1Top4Bottom_(100__25_25_25_25)" pageID="1Top4Bottom"><CustomAttributes><Attribute key="JSP_Template" value="gpar:/1Top4BottomLayout/1Top4Bottom" /></CustomAttributes><TableLayout width="100%" height="100%" cols="2" /><ContainersRow><Container containerID="testoSinistra"><TableCellData width="50%" height="100%" colSpan="1" vAlign="top" /></Container><Container containerID="testoDestra"><TableCellData width="50%" height="100%" colSpan="1" vAlign="top" /></Container></ContainersRow></PageLayout>"/>
</component-profile>
</component>
</components>
<services/>
</application>
.......
<%@ taglib uri="prt:taglib:TagLibSAPLayout" prefix="lyt" %>
<%@ taglib uri="prt:taglib:TagLibSAPNavigation" prefix="nav" %>
<%@ page import="com.sapportals.portal.pb.layout.taglib.variabledef.RunMode" %>
<lyt:template>
<link rel="stylesheet" href="com.sap.km.cm.docs/meli_documents/Meli_common/Meli_css/meli_template_css.css" type="text/css"></link>
<table border=0 cellSpacing=0 cellPadding=0 width="100%" height="100%">
<tbody>
<tr>
<td class="sfondo-testi-interni-dx" vAlign=top width="50%">
testo di prova cella 1
<lyt:container id="top" wrappingMethod="none" />
</td>
<td class="sfondo-testi-interni-sx" vAlign=top width="50%">
testo di prova cella 2
<lyt:container id="top2" wrappingMethod="none" />
</td>
</tr>
</tbody>
</table>
</lyt:template>
regards
Hi Enrico,
Make sure that you have no self enclosing tags in the layout:
for example <div/> instead of <div></div> as this might cause this issue.
If you can, upload the files to some location we can download and see that they are correct.
BR,
Saar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enrico,
doesnt tryed it on my own, but the tutorial looks straight forward and the procedure very similar to implementing a regular custom layout. Did you used the published source or changed it to accord it to your needs? Do you have any log entries regarding that issue? Thanks,
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lawrence,
I had a look on the logs and i found an exception
[PortalAppBroker.getJSPResourceComponent() failed jsp/meli_two_columns.jsp@meli.it.WebPageComposerCustomLayouts.meli_layout
[EXCEPTION]
Caused by: com.sapportals.portal.prt.runtime.PortalRuntimeException: Error while processing jsp: portal module name = meli.it.WebPageComposerCustomLayouts, JSP name = jsp/meli_two_columns.jsp
at com.sap.portal.prt.servlets_jsp.JSPProcessor.processJsp(JSPProcessor.java:67)
at com.sap.portal.prt.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:129)
at com.sap.portal.prt.broker.PortalComponentItem.load(PortalComponentItem.java:371)
at com.sap.portal.prt.om.ObjectsManager.createObejctHandle(ObjectsManager.java:234)
... 86 more
Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [prt:taglib:com.sap.portal.reserved.layout.WpcTagLibLayout]. Possible reason - validation failed. Check if your TLD is valid against its scheme.
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspTaglibDirective.registerTaglib(JspTaglibDirective.java:279)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspTaglibDirective.verifyAttributes(JspTaglibDirective.java:151)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspDirective.parse(JspDirective.java:106)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.parse(ElementCollection.java:105)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.ParserImpl.parse(ParserImpl.java:696)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.GenerateJavaFile.generateJavaFile(GenerateJavaFile.java:72)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:282)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.generateJavaFile(JSPProcessor.java:206)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:138)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassName(JSPChecker.java:378)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.compileAndGetClassName(JSPChecker.java:307)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassNameForProduction(JSPChecker.java:237)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.processJSPRequest(JSPChecker.java:168)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.processJSPRequest(JSPChecker.java:115)
at com.sap.engine.services.servlets_jsp.jspparser_api.JspParser.generateJspClass(JspParser.java:156)
at com.sap.engine.services.servlets_jsp.jspparser_api.JspParser.generateJspClass(JspParser.java:120)
at com.sap.portal.prt.servlets_jsp.JSPProcessor.processJsp(JSPProcessor.java:63)
... 89 more
Caused by: java.lang.NullPointerException: while trying to invoke the method com.sapportals.portal.prt.deployment.descriptor.IConfiguration.getPropertyValue(java.lang.String) of an object loaded from local variable 'profile'
at com.sap.portal.prt.servlets_jsp.syntax.JspTaglibDirective.determineInternalTaglibLocation(JspTaglibDirective.java:124)
at com.sap.portal.prt.servlets_jsp.syntax.JspTaglibDirective.getRealUri(JspTaglibDirective.java:52)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspTaglibDirective.registerTaglib(JspTaglibDirective.java:220)
... 105 more
I don't know if this could depends on my declaration of the taglib on the jsp.
Because the line where I specify my taglib is marked red and the message from NWDS is:
Can not find the tag library descriptor for "prt:taglib:com.sap.portal.reserved.layout.TagLibLayout.
All the tags lyt are marked in yellow.
I tought about to import the class com.sap.portal.reserved.layout.TagLibLayout
but I couldn't find it on any jar.
Do u have any hint ?
Thanks
Enrico
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.