Examples of TMLActionLink


Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

    else {
      actionKey = request.getParameter(URLPARAM_ACTION);
    }
       
    // Parse the action link and call the action
    TMLActionLink actionLink;
    if (actionKey != null && !actionKey.trim().equals("")) {
      //  actions
     
           
           
      try {
        actionLink = new TMLActionLink(URLDecoder.decode(actionKey, "UTF-8"),getCore());
               
                long starttime = System.currentTimeMillis();
        TMLAction action = callAction(actionLink, ajax);
                long endtime = System.currentTimeMillis();
               
                // We rebuild the session on the current context if the action was a master action
                // to be able to pick up modifications done there (F00004096)
                if (action != null && action.isMaster()) {
                    getTMLContext().db().reopenSession();
                }
               
                //F00004242
                if (actionLink.getMode() != null && actionLink.getMode().equals(TMLActionLink.MODE_AJAX_NO_PORTLET_REFRESH)) {
                    // this is an ajax action call do not render content result but portletEvents
                    status._isAjaxNoRefreshCall = true;
                    appendResult("");
                    setEvalBody(false);
                }
               
                actioncalled = true;                               
               
                if (debugNode != null) {
                    debugNode.addAttribute("actiontime", new Long(endtime - starttime).toString());
                }
      }
      catch (TMLInvalidActionLinkException e) {
          // Not logging these
      }
            catch (TMLActionException e) {
                addWarning("Error calling TML action: " + e.getMessage());
            }
            catch (IOException e) {
        addWarning("Error decoding action link: " + e.getMessage());
      }
            catch (WGAPIException e) {
                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
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

      params.add(this.getParam1());
      params.add(this.getParam2());
      params.add(this.getParam3());
      params.add(this.getParam4());
      params.add(this.getParam5());
            TMLActionLink link = tmlAction.createActionLink(params, this.getTMLContext());
           
            // F00004242
            if (ActionBase.AJAX_MODE_NO_PORTLET_REFRESH.equalsIgnoreCase(getStatus().ajax)) {
                link.setMode(TMLActionLink.MODE_AJAX_NO_PORTLET_REFRESH);
            }
           
            // F00004292
            link.setPortletmode(getPortletmode());
            String portletcontext = getPortletcontext();
            if (portletcontext != null) {
                link.setPortletContextPath(getTMLContext(), portletcontext);
            }
     
     
      this.setResult(link.getJavascriptLink(getCore(), getStatus().getRelevantForm()));
      
    }
 
  }
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

    }

    protected String buildCallActionLink(String sAction, String formID, List params, String portletMode, String portletContext) throws WGAPIException {
        TMLAction tmlAction = getTMLContext().getActionByID(sAction, getDesignDBKey());
        if (tmlAction != null) {
            TMLActionLink actionLinkObj = tmlAction.createActionLink(params, getTMLContext());
            actionLinkObj.setPortletmode(portletMode);
            if (portletContext != null) {
              actionLinkObj.setPortletContextPath(getTMLContext(), portletContext);
            }
           
            String actionLink;

            //if (formBase != null && formBase.getMode().equals(FormInfo.EDIT_MODE)) {
            //--> none editable forms should be submitted to ensure access in tml:action
            if (formID != null) {
                actionLink = actionLinkObj.getJavascriptLink(getCore(), formID);
            }
            else {
                actionLink = actionLinkObj.getJavascriptLink(getCore(), null);
            }
            return actionLink;
        }
        else {
            return null;
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

     * @return Javascript-Function call   
     * @throws WGAPIException
     */
    protected String getAjaxJSFunction(TMLAction action, List params, String ajaxMode, String portletMode, String portletContext) throws WGAPIException {
              
        TMLActionLink actionLink = action.createActionLink(params, getTMLContext());
       
        //F00004242
        if (ajaxMode != null && ajaxMode.equalsIgnoreCase(ActionBase.AJAX_MODE_NO_PORTLET_REFRESH)) {
            actionLink.setMode(TMLActionLink.MODE_AJAX_NO_PORTLET_REFRESH);
        }
       
        actionLink.setPortletmode(portletMode);
        if (portletContext != null) {
          actionLink.setPortletContextPath(getTMLContext(), portletContext);
        }
                       
        String id = (String) this.getOption(Include.OPTION_AJAX_DIVTAG_ID);       
        String strAction = actionLink.getJavascriptLink(getCore(), getStatus().getRelevantForm());
   
       
        AjaxActionDefinition actionDef = new AjaxActionDefinition(strAction, id);
       
        //F00004242
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

     * @return Javascript-Function call   
     * @throws WGAPIException
     */
    protected String getJSFunction(TMLAction action, List params, String portletMode, String portletContext) throws WGAPIException {
       
        TMLActionLink actionLink = action.createActionLink(params, getTMLContext());
        String strAction = actionLink.getJavascriptLink(getCore(), getStatus().getRelevantForm());
       
        actionLink.setPortletmode(portletMode);
        if (portletContext != null) {
          actionLink.setPortletContextPath(getTMLContext(), portletContext);
        }
       
        return "callAction('" + strAction + "')";
    }
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLActionLink

        if (tag == null) {
            return null;
        }
       
       
        TMLActionLink actionLink = action.createActionLink(params, context);
        actionLink.setPortletmode(portletMode);
        if (portletContext != null) {
            actionLink.setPortletContextPath(context, portletContext);
        }
              
        String encodedActionLink = actionLink.getEncodedString(context.getwgacore());

        // Retrieve relevant form.
        String formID = tag.getRelevantForm();

        // Inside a form we use javascript to post the action
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.