<%@ page language="java" %><%@ page import="java.util.*" %><%@ page import="com.bmw.wcms.nsceditor.content.ObjectReference" %><%@ page import="com.bmwgroup.wcms.cmsal.*" %><%@ page import="com.bmwgroup.wcms.cmsal.exception.*" %><%@ page import="com.bmwgroup.wcms.common.cmstools.*" %><%@ page import="com.bmwgroup.wcms.contentmodel.*" %><%@ page import="com.bmwgroup.wcms.websiteapi.*" %><%@ page import="com.bmwgroup.wcms.base.*" %><%@ page import="com.bmwgroup.wcms.base.util.*" %><%@ page import="com.bmwgroup.wcms.base.mapelement.*" %><%@ page import="com.bmwgroup.wcms.template.util.*" %><%@ include file="../../../../../../../templates/_basic_rebrush/_includes/mcCommon.inc.jsp" %><%! // make current oid and url globally available final String thisVipOid = "2961443"; final String thisVipUrlAbsolute = "http://wcms10.bmwgroup.com/bmw_prod/com/en/newvehicles/5series/sedan/2010/preview/index.html"; %><% final String configurationSetName = null; final String vipSite = "bmw"; final String vipServer = "PROD"; final String vipserver = vipServer; int stage = 0; boolean forceSerializedObjects = false; // prepared variables of scope inside _jspService TextFormat standardFormat=null; try { CMSTemplate template = null; CMSObject cmsObject = null; CMSContext cmsContext = new CMSContext (vipSite, vipServer); CMSToolKit cmsToolKit = CMSSessionPoolSingleton.getCMSToolkit(configurationSetName); stage = cmsToolKit.mapStage(vipServer); //make cmsContext globally available cmsContextRef = cmsContext; if ((!ContentModelUtils.isCalledFromEditor(request))||(ContentModelUtils.isGeneratorCall(request, stage))) { //load Configuration loadConfiguration(cmsContext, "2961443", "http://wcms10.bmwgroup.com/bmw_prod/com/en/newvehicles/5series/sedan/2010/preview/index.html"); /* ---- Establish standard text formater start ---- */ String absoluteFormatUrl = ObjectUtils.absoluteUrl("http://wcms10.bmwgroup.com/bmw_prod/com/en/newvehicles/5series/sedan/2010/preview/index.html", ObjectUtils.getRelativeObjectUrl("2961443", "321", cmsContext)); standardFormat = new TextFormat(); standardFormat.init (absoluteFormatUrl); /* ---- Establish standard text formater end ---- */ /* ---- Define js code for configuration variables start ---- */ // generate a relative url from confJavascriptConfigurationOid, to reference JS-Script String confJavascriptConfigurationUrl=null; if(confJavascriptConfigurationOid != null) { try { confJavascriptConfigurationUrl = ObjectUtils.getRelativeObjectUrl("2961443", confJavascriptConfigurationOid, cmsContext); } catch(Exception e) {} } // include javascript configuration variables and configuration scripts // configuration.js might be missing, so check if(confJavascriptConfigurationUrl != null) { %> <% } String nearestMisc2Attribute = ObjectUtils.getNearestMetaAttributeAsString(ObjectUtils.getCMSEntry("2961443", cmsContext), CMSConstants.CMS_META_ATTR_MISC_2); if(nearestMisc2Attribute == null){ nearestMisc2Attribute = "null"; } else { nearestMisc2Attribute = "\""+nearestMisc2Attribute +"\""; } %> <% /* ---- Define js code for configuration variables end ---- */ } // End of if(!ContentModelUtils.isCalledFromEditor(request)) %> BMW International <% // // CMSTemplate template = new CMSTemplate( /* VIPURL */""); { template.setAttribute("ttCOMMENT", "
Using this template simple HTML redirects can be set up.
"); template.setAttribute("ttREGORDER", "comment,redirect,all,head data,metadata"); template.setVipObjId(new Integer("2961443")); template.setName(""); template.setDescription(""); CMSElement e; e = new CMSElement(); e.setName("link"); e.setAttribute("oT", "empty"); e.setAttribute("tD", "Link to which you want to redirect. The entries in the \"Link text\" field are not relevant"); e.setAttribute("tORD", "52"); e.setAttribute("tREGN", "redirect"); e.setAttribute("tT", "TEXT_LINK"); template.setElement(e); e = null; } %> <%! public String getFullScopeTemplateElementAttr(String elementName, String attributeName) { return ""; } %> <% //
%> <% // // CMSObject cmsObject = new CMSObject(); request.setAttribute("cmsObject", cmsObject); { cmsObject.setVipObjId(new Integer("2961443")); cmsObject.setTemplate(template); CMSElement e; e = new CMSElement(); e.setName("link"); e.setAttribute("oLURL", /* VIPURL*/"../showroom/index.html"); cmsObject.putElement(e); e = null; cmsObject.addElementAttributes(template.getElements(), false); } %> <%! public String getFullScopeElementAttribute(String elementName, String attributeName) { return ""; } %> <% // %> <% // if (cmsObject == null) { cmsObject = template.createDummyObject(); } // %> <% if (!ContentModelUtils.isCalledFromEditor(request) && !ContentModelUtils.isGeneratorCall(request,stage)) { //------------------------------------------------------------------ // Prepare Page Elements //------------------------------------------------------------------ TextLinkElement link = new TextLinkElement(cmsContext, cmsObject,"link"); link.setFormatting(standardFormat,FORMAT_HTML); %> You will be redirected automatically. Please click HERE if you are not redirected shortly. <% } %> <% /* ---- free allocated objects ---- */ standardTextContent=null; // included code to serialize objects %><%@ include file="../../../../../../../templates/_basic_rebrush/_includes/serializedObjects.inc.jsp" %><% } catch (PendingDeploymentException pdEx) { CMSSession cmsSession = CMSSessionPoolSingleton.getCMSSession(configurationSetName); if (cmsSession != null) { CMSQuery currenQuery = cmsSession.getCMSQuery(stage, vipSite); if (currenQuery != null) { CMSEntry pageEntry = currenQuery.getEntryByOid("2961443"); if (pageEntry != null) { pageEntry.applyAction(CMSConstants.CMS_ACTION_REPUBLISH); } } } throw pdEx; } %>