Examples of TMLPortlet


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

        }
        
    }

    private void fireSessionIsNewPortletEvent() throws WGAPIException {       
        TMLPortlet portlet = getTMLContext().getportlet();
        if (portlet != null) {
            portlet.fireevent(de.innovationgate.wgpublisher.webtml.utils.PortletEvent.SESSION_IS_NEW_EVENT);
        } else {
            String sessionIsNewEvent = de.innovationgate.wgpublisher.webtml.utils.PortletEvent.SESSION_IS_NEW_EVENT.toJavaScriptObject();
            String encodedEvent = Base64.encodeWeb(sessionIsNewEvent.getBytes());
            try {
                getTMLContext().redirectto(getTMLContext().getrequest().getContextPath() + "/fireSystemEvent.jsp?event="  + encodedEvent);
View Full Code Here

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

     
      attValue = this.getPortletmode();
      if (attValue != null) {
        List modesToTest = WGUtils.deserializeCollection(attValue.toLowerCase(), ",", true);
        HttpSession session = this.pageContext.getSession();
        TMLPortlet portlet = context.getportlet();
                if (portlet == null) {
                    addWarning("Portlet mode was tested although no portlet was registered", false);
                    return false;
                }
               
                String portletMode  = portlet.getmode();
        if (!modesToTest.contains(portletMode.toLowerCase())) {
          return false;
        }
      }
View Full Code Here

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

            return FormBase.getFieldValue(doc, _context, _form.getforminfo(), fieldname, meta, defaultvalue, useRelation);           
        } else if (source.equals("profile")) {
            TMLUserProfile profile = _context.getprofile();
            return FormBase.getFieldValue(profile,  _context, _form.getforminfo(), fieldname, meta, defaultvalue);
        } else if (source.equals("portlet")) {
            TMLPortlet portlet = _context.getportlet();
            return FormBase.getFieldValue(portlet,  _context, _form.getforminfo(), fieldname, meta, defaultvalue);
        } else if (source.equals("none")) {
            if (defaultvalue != null) {
                return Collections.singletonList(defaultvalue);
            }
View Full Code Here

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

        String name = getOnevent();
        if (name == null) {
            throw new TMLException("Event name was not specified", true);
        }
       
        TMLPortlet portlet = getTMLContext().getportlet();
        if (portlet == null) {
            throw new TMLException("Personalisation is not available", true);
        }
       
        // Test if an event of that name has been issued since last run
View Full Code Here

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

    private void preparePortletInclusion() throws TMLException, WGAPIException {
       
        Status status = (Status) getStatus();
       
        String type;
        TMLPortlet parentPortlet = getTMLContext().getportlet();
        if (parentPortlet == null) {
            if (getTMLContext().isbotrequest()) {
                throw new TMLSilentCancelException();
            }
            else {
                throw new TMLException("Current user has no portlet registration");
            }
        }
       
        String pKey = getKey();
        String pName = getName();

        //  If no key direcly given try to fetch via portlet name
        if (pKey == null && pName != null) {
            pKey = parentPortlet.getPortletKeyForName(pName);
        }
       
        // Fetch registration info if key provided
        WGPortlet pReg = null;
        if (pKey != null) {
            pReg = parentPortlet.getPortletRegistration(pKey);
        }

        // If reg not retrievable and auto registration info available try auto registration, else cancel
        if (pReg == null) {
            if (pName != null && status.ref != null) {
                pKey = parentPortlet.registerportletforname(pName, status.designdb, status.ref, false);
                pReg = parentPortlet.getPortletRegistration(pKey);
            }
            else {
                if (pName != null) {
                    throw new TMLException("Portlet name not registered: " + pName, true);
                }
                else if (pKey != null) {
                    throw new TMLException("Portlet key not registered: " + pKey, true);
                }
                else {
                    throw new TMLException("No portlet key provided.", true);
                }
            }
        }

        // Check if registration matchtes the autoregister TML. If not, reregister with the given TML.
        else if (status.ref != null) {
       
                // If the registration has no design database specified we take the current design db (which is always equal)
                if (pReg.getDesignDb() == null) {
                    pReg.setDesignDb(status.designdb);
                }
           
               if (!WGUtils.nullSafeEquals(status.ref, pReg.getDesign(), true) ||
                   (!WGUtils.nullSafeEquals(status.designdb, pReg.getDesignDb(), true))) {
                     pKey = parentPortlet.registerportletforname(pName, status.designdb, status.ref, true);
                     pReg = parentPortlet.getPortletRegistration(pKey);
               }
              
        }
       
        // Prepare environment
        status.setOption(Base.OPTION_PORTLET_NAMESPACE, pKey, null);
        if (pReg.getDesignDb() != null) {
            status.designdb = pReg.getDesignDb();
        }
        status.ref = getTMLContext().resolveDesignReference(pReg.getDesign());
       
        // Update portlet event index information
        TMLPortlet childPortlet = getTMLContext().getportlet();       
        childPortlet.prepareEventProcessing(this);
       
        // set child tag context to portlet context if set
        TMLContext portletContext = childPortlet.getcontext();
        if (portletContext != null) {
          setChildTagContext(portletContext);
        }
       
        // if ajax enabled
View Full Code Here

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

        return;
      }
      result = profile.itemlist(itemName);
    }
    else if (type.equals("portlet")) {
      TMLPortlet portlet = tmlContext.getportlet();
      if (portlet == null) {
        this.addWarning("Current user has no portlet registration", true);
        return;
      }
      result = portlet.itemlist(itemName);
    }
        else if (type.equals("tmlform")) {
            TMLForm form = tmlContext.gettmlform();
            if (form == null) {
                addWarning("There is no current WebTML form at this position in the current request");
View Full Code Here

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

                TMLUserProfile profile = tmlContext.getprofile();
                return FormBase.getFieldValue(profile, tmlContext, formInfo, fieldname, meta, defaultvalue);
            }
           
            else if (source.equals("portlet")) {
                TMLPortlet portlet = tmlContext.getportlet();
                return FormBase.getFieldValue(portlet, tmlContext, formInfo, fieldname, meta, defaultvalue);
            }
           
            else if (source.equals("none") || source.equals("newcontent")) {
                if (defaultvalue != null) {
View Full Code Here

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

    public String getVar() {
       
        // Retrieve portlet variable name + prefix, if present
        String pvar = getPvar();
        if (pvar != null && getTMLContext() != null) {
            TMLPortlet portlet;
            try {
                portlet = getTMLContext().getportlet();
            }
            catch (WGAPIException e) {
                log.error("Exception retrieving portlet variable name", e);
                return null;
            }
            if (portlet != null && !portlet.isroot()) {
                return portlet.getVarPrefix() + pvar;
            }
        }
       
        return this.getTagAttributeValue("var", var, null);
    }
View Full Code Here

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

    public String getSessionvar() {
       
//      Retrieve portlet variable name + prefix, if present
        String pvar = getPsessionvar();
        if (pvar != null && getTMLContext() != null) {
            TMLPortlet portlet;
            try {
                portlet = getTMLContext().getportlet();
            }
            catch (WGAPIException e) {
                log.error("Exception retrieving portlet variable name", e);
                return null;
            }
            if (portlet != null && !portlet.isroot()) {
                return portlet.getVarPrefix() + pvar;
            }
        }
       
       
        return this.getTagAttributeValue("sessionvar", sessionvar, null);
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.