Verify the requested portlet window corresponds to a node in the user's layout and return the
corresponding layout node id
192910
protected String verifyPortletWindowId(
            HttpServletRequest request, IPortletWindowId portletWindowId) {
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
        final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
        final IUserLayoutManager userLayoutManager = preferencesManager.getUserLayoutManager();

        final IPortletWindow portletWindow =
                this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
        final IPortletWindowId delegationParentWindowId = portletWindow.getDelegationParentId();
        if (delegationParentWindowId != null) {
            return verifyPortletWindowId(request, delegationParentWindowId);
        }

        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final String channelSubscribeId = portletEntity.getLayoutNodeId();
        final IUserLayoutNodeDescription node = userLayoutManager.getNode(channelSubscribeId);
        if (node == null) {
            throw new IllegalArgumentException(
                    "No layout node exists for id "
                            + channelSubscribeId
                            + " of window "
                            + portletWindowId);
        }

        return node.getId();
    }
1090573
def get_layout(self):
        
        if self.request.is_ajax():
            layout = ['modal', ]
        else:
            layout = ['static_page', ]

        if self.workflow_class.wizard:
            layout += ['wizard', ]

        return layout
453426
@Override
    public PortletDelegationDispatcher createRequestDispatcher(
            PortletRequest portletRequest, IPortletDefinitionId delegatePortletDefinitionId) {
        final HttpServletRequest request =
                this.portalRequestUtils.getPortletHttpRequest(portletRequest);

        final String windowID = portletRequest.getWindowID();
        final IPortletWindowId parentPortletWindowId =
                this.portletWindowRegistry.getPortletWindowId(request, windowID);

        final IPortletEntity delegatePortletEntity =
                this.portletEntityRegistry.getOrCreateDelegatePortletEntity(
                        request, parentPortletWindowId, delegatePortletDefinitionId);
        final IPortletEntityId delegatePortletEntityId = delegatePortletEntity.getPortletEntityId();

        final IPortletWindow delegatePortletWindow =
                this.portletWindowRegistry.createDelegatePortletWindow(
                        request, delegatePortletEntityId, parentPortletWindowId);

        final IPerson person = this.personManager.getPerson(request);
        final int userId = person.getID();

        return new PortletDelegationDispatcherImpl(
                delegatePortletWindow,
                userId,
                portalRequestUtils,
                personManager,
                portletRenderer,
                portalUrlProvider,
                portletDelegationManager);
    }
130208
def verify_role!(node, role)
      current_role = node.info['role']
      if current_role.to_sym != role
        raise InvalidNodeRoleError.new(address_for(node), role, current_role)
      end
      role
    end
102327
public static String getClientWindowId(FacesContext context) {
		String result = null;
		final String clientWindowIdCounterKey = "com.sun.faces.util.ClientWindowCounterKey";
		Map<Object, Object> contextAttrs = context.getAttributes();
		Integer counter = (Integer) contextAttrs.get(clientWindowIdCounterKey);
		if (null == counter) {
			counter = Integer.valueOf(0);
		}

		char sep = UINamingContainer.getSeparatorChar(context);
		result = context.getViewRoot().getContainerClientId(context) + sep + ResponseStateManager.CLIENT_WINDOW_PARAM
				+ sep + counter;
		contextAttrs.put(clientWindowIdCounterKey, ++counter);

		return result;
	}
342527
function(v) {
				return (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check "nodeType" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox.
			}
160905
function makeViewportGetter_(dimension, inner, client) {
  if (testMQ('(min-' + dimension + ':' + window[inner] + 'px)')) {
    return function getWindowDimension_() {
      return window[inner];
    };
  } else {
    var docElem = document.documentElement;
    return function getDocumentDimension_() {
      return docElem[client];
    };
  }
}
128848
@Override
    public Map<String, String> getUserInfo(PortletRequest request, PortletWindow portletWindow)
            throws PortletContainerException {

        Map<String, String> userInfo = new HashMap<String, String>();

        // check to see if a password is expected by this portlet
        if (isPasswordRequested(request, portletWindow)) {

            log.debug(
                    "Portlet named {} wants a password",
                    portletWindow.getPortletDefinition().getPortletName());

            final HttpServletRequest httpServletRequest =
                    this.portalRequestUtils.getPortletHttpRequest(request);
            final IUserInstance userInstance =
                    userInstanceManager.getUserInstance(httpServletRequest);
            final IPerson person = userInstance.getPerson();
            final ISecurityContext context = person.getSecurityContext();

            // if it is, attempt to request a password
            String password = getPassword(context);
            log.debug(password != null ? "Have a non-null password" : "password was null");
            if (this.decryptPassword && password != null) {
                log.debug("Attempting to decrypt password");
                password = stringEncryptionService.decrypt(password);
                log.debug(
                        "Password decryption complete, password is length {}",
                        password != null ? password.length() : "is null");
            }
            if (password != null) {
                userInfo.put(this.passwordKey, password);
                log.debug(
                        "Found password with length {} for portlet name {}",
                        password.length() != 0 ? "non-zero" : 0,
                        portletWindow.getPortletDefinition().getPortletName());
            }
        }
        return userInfo;
    }
743796
function _Browser_getViewportOf(id)
{
	return _Browser_withNode(id, function(node)
	{
		return {
			__$scene: {
				__$width: node.scrollWidth,
				__$height: node.scrollHeight
			},
			__$viewport: {
				__$x: node.scrollLeft,
				__$y: node.scrollTop,
				__$width: node.clientWidth,
				__$height: node.clientHeight
			}
		};
	});
}
776683
def get_current(self, layout=None, network=None, verbose=False):
        
        PARAMS={}
        response=api(url=self.__url+"/get_current", PARAMS=PARAMS, method="POST", verbose=verbose)
        return response
8824
private void ensureCurrentLayout() {
        if (!tabPane.isValid()) {
            tabPane.validate();
        }

        /*
         * If tabPane doesn't have a peer yet, the validate() call will silently
         * fail. We handle that by forcing a layout if tabPane is still invalid.
         * See bug 4237677.
         */
        if (!tabPane.isValid()) {
            TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout();

            layout.calculateLayoutInfo();
        }
    }
219841
function getInstanceFromNode(node) {
  var inst = node[internalInstanceKey];
  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText) {
      return inst;
    } else if (inst._hostNode === node) {
      return inst;
    } else {
      return null;
    }
  }
  inst = getClosestInstanceFromNode(node);
  if (inst != null && inst._hostNode === node) {
    return inst;
  } else {
    return null;
  }
}
122403
protected void initializePortletWindowData(
            HttpServletRequest request, PortletWindowData portletWindowData) {
        final IStylesheetDescriptor stylesheetDescriptor = getThemeStylesheetDescriptor(request);
        final IPortletEntityId portletEntityId = portletWindowData.getPortletEntityId();
        final IPortletEntity portletEntity =
                this.portletEntityRegistry.getPortletEntity(request, portletEntityId);
        final WindowState entityWindowState = portletEntity.getWindowState(stylesheetDescriptor);
        if (persistentWindowStates.contains(entityWindowState)) {
            portletWindowData.setWindowState(entityWindowState);
        } else if (entityWindowState != null) {
            // Set of persistent window states must have changed, nuke the old value
            this.logger.warn(
                    "PortletEntity.windowState="
                            + entityWindowState
                            + " but that state is not in the set of persistent WindowStates. PortletEntity.windowState will be set to null");
            portletEntity.setWindowState(stylesheetDescriptor, null);
            this.portletEntityRegistry.storePortletEntity(request, portletEntity);
        }
    }
788084
@Override
    public IPortletWindow convertPortletWindow(
            HttpServletRequest request, PortletWindow plutoPortletWindow) {
        Validate.notNull(request, "request can not be null");
        Validate.notNull(plutoPortletWindow, "portletWindow can not be null");

        // Conver the pluto portlet window ID into a uPortal portlet window ID
        final PortletWindowID plutoWindowId = plutoPortletWindow.getId();
        final IPortletWindowId portletWindowId;
        if (plutoWindowId instanceof IPortletWindowId) {
            portletWindowId = (IPortletWindowId) plutoWindowId;
        } else {
            portletWindowId = this.getPortletWindowId(request, plutoWindowId.getStringId());
        }

        // Do a new get to make sure the referenced data gets updated correctly
        return this.getPortletWindow(request, portletWindowId);
    }
1174554
@Override
    public String findNodeId(XPathExpression xpathExpression) throws PortalException {
        try {
            return xpathExpression.evaluate(this.layout);
        } catch (XPathExpressionException e) {
            throw new PortalException(
                    "Exception while executing XPathExpression: " + xpathExpression, e);
        }
    }
180559
function verifySpacing(node, lineOptions) {
            const actual = getPropertyWhitespace(node);

            if (actual) { // Object literal getters/setters lack colons
                report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode);
                report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode);
            }
        }
373736
function () {

		var href = window.location.href,
			items = parsedItems(),
			id, index;

		// get window 'id'
		if (href.indexOf('#') > -1) {
			id = window.location.hash.replace('#', '');
		} else {
			id = window.location.pathname.split('/').pop().replace(/\.[^/.]+$/, '');
		}

		// In case the first menu item isn't the index page.
		if (id === '') {
			id = 'index';
		}

		// find the window id in the items array
		index = (items.indexOf(id) > -1) ? items.indexOf(id) : 0;

		// set the matched item as active
		fabricator.dom.menuItems[index].classList.add('f-active');

	}