[opencms-dev] About migration OC5 for OC6

Deiverson Jorge deiverson at oriens.com.br
Wed Nov 16 14:50:20 CET 2005


Thx for response,

Kaffamanesh,

Template-Main.jsp is:

<%@ page session="false" import="java.util.*,org.opencms.jsp.*,
org.opencms.i18n.CmsMessages, org.opencms.main.*, org.opencms.file.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"  %>

<%

// initialise Cms Action Element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
    
// Collect the objects required to access the OpenCms VFS from the request
//com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
String uri = cms.getRequestContext().getUri(); 

// get all properties of the file
Map properties = cms.properties("search");

// get locale and message properties
String locale = cms.property("locale", "search", "en").toLowerCase();
CmsMessages messages = cms.getMessages("org.opencms.templates.messages",
locale);
properties.put("locale", locale);

// get top level/language folder 
String topfolder = CmsResource.getPathPart(uri, 1) + locale + "/";
properties.put("__topfolder", topfolder);

// Variables for use on the page
String imgPath = cms.link("../resources/images/");
String jsPath = cms.link("../resources/js/");
String cssPath = cms.link("../resources/css/");
String elmPath = "../elements/";
String sitePath = cms.link("/oriens/");
String lucenePath = cms.link("../jsptemplates/");

String propDescription = cms.property("Description", "search",
messages.key("page_description"));
String propKeywords = cms.property("Keywords", "search",
messages.key("page_keywords"));
String propEncoding= cms.property("content-encoding", "search",
"ISO-8859-1");

%>

.....

<%
       cms.include(elmPath + "template-head.jsp");     
%>

......
End code
_________________________________________


This template-head.jsp is a element (after i change),

<%@ page session="false" import="org.opencms.jsp.*,org.opencms.file.*,
java.lang.*, java.util.*, org.opencms.i18n.CmsMessages" %>
<%@ taglib prefix="cms" uri="/WEB-INF/opencms.tld" %>

<%

// initialise Cms Action Element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
    
// Collect the objects required to access the OpenCms VFS from the request
//com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
String uri = cms.getRequestContext().getUri(); 

// get all properties of the file
Map properties = cms.properties("search");

// get locale and message properties
String locale = cms.property("locale", "search", "en").toLowerCase();
CmsMessages messages = cms.getMessages("org.opencms.templates.messages",
locale);
properties.put("locale", locale);

// get top level/language folder 
String topfolder = CmsResource.getPathPart(uri, 1) + locale + "/";
properties.put("__topfolder", topfolder);

// Variables for use on the page
String imgPath = cms.link("../resources/images/");
String sitePath = cms.link("/oriens/");

%>
  <tr>
    <td width="775" height="66" colspan="2" valign="top">

    <!--Tabela 1: topo.inicio -->

      <table width="775" height="66" border="0" cellpadding="0"
cellspacing="0">
        <tr>
          <td width="154" height="58" align="left" valign="top">
            <a href="<%= sitePath + "index.html" %>"><img src="<%= imgPath
+ "logo_oriens.png" %>" width="154" height="58" border="0"></a>
          </td>
          <td width="621" height="58" valign="middle">
            <img src="<%= imgPath + "topo.png" %>" align="right"
width="263" height="58" border="0" usemap="#Map">
          </td>
        </tr>
        <tr>
          <td colspan="2" width="775" height="8" background="<%= imgPath +
"barrazul.png" %>"></td>
        </tr>
      </table>

    <!--Tabela 1: topo.fim -->

    </td>
  </tr>
<map name="Map">
  <area shape="rect" coords="162,38,255,53" href="<%= sitePath +
"main/login.html" %>">
  <area shape="rect" coords="90,38,152,53" href="<%= sitePath +
"download/index.html" %>">
<!--  <area shape="rect" coords="4,38,80,53" href="#">  -->
</map>
_________________________________
If i direct acess template-head.jsp, is work, but if tell
Template-Main.jsp, not work =(

"Arash Kaffamanesh" <arash.kaffamanesh at pomegranate.de> on quarta-feira, 16
de novembro de 2005 at 11:51 -0300 wrote:
>Jorge,
>
>are you including element-head.jsp or template-head.jsp?  ;-)
>
>Under /sytsem/modules/<yourModule>/elements/
>
>template-head.jsp must exist and not element-head.jsp!
>
>If it doesn't help, send the part or whole of your Template-Main.jsp
>which includes the head element, I'll say what is going wrong.
>
>HTH,
>
>Kind Regards,
>Arash
>
>
>-----Original Message-----
>From: opencms-dev-bounces at opencms.org
>[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Deiverson Jorge
>Sent: Mittwoch, 16. November 2005 14:01
>To: opencms-dev at opencms.org
>Subject: [opencms-dev] About migration OC5 for OC6
>
>
>I show tutorial for migration OC5 for 6
>(http://www.pomegranate.de:9000/cms/forum/viewthread?thread=10)
>
>But I have problem...
>
>Template-Main.jsp tell element-head.jsp...
>
>File not found: /elements/template-head.jsp
>Reason: Error reading resource from path "/elements/template-head.jsp"
>Reason: Unable to read resource "/elements/template-head.jsp"
>
>Details...
>
>com.opencms.legacy.CmsLegacyException: File not found:
>/elements/template-head.jsp
>	at
>com.opencms.legacy.CmsXmlTemplateLoader.includeExtension(CmsXmlTemplateL
>oader.java:882)
>	at
>org.opencms.loader.CmsResourceManager.resolveIncludeExtensions(CmsResour
>ceManager.java:744)
>
>Does anyone knows how to fix this?
>
>Thx
>
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please
>visit http://mail.opencms.org/mailman/listinfo/opencms-dev
>





More information about the opencms-dev mailing list