Examples of WGPRequestPath


Examples of de.innovationgate.wgpublisher.WGPRequestPath

                addWarning("Error calling TML action: " + e.getMessage());
            }
    }
   
    // Conditionally execute special action changeLanguage
        WGPRequestPath path = (WGPRequestPath) request.getAttribute(WGACore.ATTRIB_REQUESTPATH);
    if (path.getPreferredLanguageChange() != null) {
      actionLink = new TMLActionLink(request.getSession());
      actionLink.setDefaultAction(TMLAction.DEFAULTACTION_CHANGELANGUAGE);
           
            try {
                if (path.getPreferredLanguageChange().equals(WGPRequestPath.PREFERREDLANGUAGECHANGE_USECONTENT)) {
                    actionLink.setParam1((String) getTMLContext().meta("language"));
                }
                else {
                    actionLink.setParam1(path.getPreferredLanguageChange());
                }
               
          actionLink.setContextPath(getTMLContext().getpath());
                             
                TMLAction calledAction = callAction(actionLink, ajax);
                               
                // In case of a called master action we rebuild the session of the current db
                // To let the following WebTML request reflect eventually done changes in the action
                if (calledAction != null && calledAction.isMaster()) {
                    getTMLContext().db().reopenSession();
                }
               
            }
            catch (TMLActionException e) {
                addWarning("Error changing preferred language to '" + path.getPreferredLanguageChange() + "' bc of exception: " + e.getClass().getName() + " message: " + e.getMessage());
                log.error("Error changing preferred language to '" + path.getPreferredLanguageChange() + "'", e);
            }
            catch (WGAPIException e) {
                addWarning("Error changing preferred language to '" + path.getPreferredLanguageChange() + "' bc of exception: " + e.getClass().getName() + " message: " + e.getMessage());
                log.error("Error changing preferred language to '" + path.getPreferredLanguageChange() + "'", e);
            }
            actioncalled = true;
           

    }
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGPRequestPath

     * This is meant to be used on WGA error pages to provide minimal information about the requested content to WGA Content Manager.
     * @throws IOException
     */
    public void writeContentInfo() throws IOException {
       
        WGPRequestPath requestPath = (WGPRequestPath) _pageContext.getRequest().getAttribute(WGACore.ATTRIB_REQUESTPATH);
        if (requestPath == null) {
            return;
        }
      
        String quote = "\"";
        String dbKeyStr = quote + requestPath.getDatabaseKey() + quote;
        String contentKeyStr = "null";
        String structKeyStr = "null";
        String titleStr = "null";
      
        // Try to retrieve content key to fill content specific information
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGPRequestPath

        // Obsolete
        //context.setpreferredlanguage(lang);
       
    HttpServletRequest request = context.getrequest();
    WGPRequestPath path = (WGPRequestPath) request.getAttribute(WGACore.ATTRIB_REQUESTPATH);

    try {
            URLBuilder urlBuilder = new URLBuilder(null, 0, null, langContext.contenturl(path.getMediaKey(), path.getLayoutKey()), context.getrequest().getQueryString());
            if (urlBuilder.hasParameter("$action")) {
                urlBuilder.removeParameter("$action");
            }
           
      context.redirectto(urlBuilder.rebuild(false));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.