public ContentPageBean(final ContentPage contentPage) { id = contentPage.getId(); name = contentPage.getName(); path = contentPage.getPath(); title = contentPage.getTitle(); shortTitle = contentPage.getShortTitle(); url = contentPage.getUrl(); skin = contentPage.getSkin(); ContentFragment rootFragment = contentPage.getRootFragment(); if (rootFragment != null) { rootFragmentBean = new ContentFragmentBean(rootFragment); } }
public boolean checkAccess(RequestContext context, String action) { ContentPage page = context.getPage(); try { page.checkAccess(action); } catch (Exception e) { Principal principal = context.getRequest().getUserPrincipal(); String userName = this.guest; if (principal != null) userName = principal.getName(); log.warn("Insufficient access to page " + page.getPath() + " by user " + userName); return false; } return true; } }
protected Map<String, PortletWindowBaseNavigationalState> getWindowStates(ContentPage page) { PageState pageState = pageStates.get(page.getId()); return pageState != null ? pageState.windowStates : null; } }
pageDecoratorName = page.getDefaultDecorator( LAYOUT ); putSecurityInformation( resultMap, page.getPageOrTemplate() ); //TODO: REVIEW: RANDY else if (page.getRootFragment() instanceof ContentFragment) retrieveFragmentSpecialProperties( requestContext, page.getRootFragment(), fragSizes, portletIcons ); throw new Exception( "root layout not found for page: " + page.getId() );
page.overrideDefaultDecorator(decoratorName, Fragment.LAYOUT); themeContentCacheKey = cache.createCacheKey(requestContext, page.getId()); CacheElement themeCacheElem = cache.get(themeContentCacheKey); boolean solo = isSoloMode(requestContext); SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() ); initDepthFragmentDecorations(requestContext, theme, page.getRootFragment(), pageActionAccess, isAjaxRequest, ((DecorationFactoryImpl) decorationFactory).getResourceValidator(), if ( fragments == null || fragments.size() == 0 ) ContentFragment rootFragment = page.getRootFragment(); initDepthFragments(requestContext, theme, rootFragment, pageActionAccess, isAjaxRequest, fragments); themeContentCacheKey = cache.createCacheKey(requestContext, page.getId()); cache.remove(themeContentCacheKey); themeContentCacheKey = cache.createCacheKey(requestContext, page.getId()); requestContext.setSessionAttribute(themeCacheKey, theme);
public List<KeyValue<String, HeadElement>> getMergedHeadElements() ContentFragment root = page.getRootFragment(); List<KeyValue<String, HeadElement>> headElements = getPortletWindow(root).getHeadElements(); Map<String,String> instantWindows = pages.get(page.getId());
Map<String,String> instantWindows = pages.get(getPage().getId()); ContentFragment fragment = getPage().getFragmentByFragmentId(windowId); if (fragment != null) { portletUniqueName = fragment.getName();
public boolean checkAccess(RequestContext context, String action) { ContentPage page = context.getPage(); String path = page.getPath(); if (path == null) return false; if (path.indexOf(Folder.ROLE_FOLDER) > -1 || path.indexOf(Folder.GROUP_FOLDER) > -1) { if (action.equals(JetspeedActions.VIEW)) return true; return false; } return true; }
BaseFragmentsElement pageOrTemplate = getPageOrTemplate(contentPage.getPageOrTemplate().getPath()); BaseFragmentElement rootFragment = pageOrTemplate.getRootFragment(); if (!(rootFragment instanceof Fragment))
public boolean createNewPageOnEdit(RequestContext context) { if ( ! this.enableCreateUserPagesFromRolesOnEdit ) return false ; ContentPage contentPage = context.getPage(); String pagePath = contentPage.getPath(); try { if ( isPageQualifiedForCreateNewPageOnEdit( pagePath ) ) { // create user home pages String pageName = contentPage.getName(); pageManager.createUserHomePagesFromRoles(context.getSubject()); // update request context with new profiler valve invocation pageLocatingValve.invoke(context, null); } } catch (Exception e) { // already logged error return false; } return true; } }
if (fragment == null) page.addPortlet(event.getPortletType(), event.getPortletName()); page.addFragmentAtRowColumn(fragment, coordinate.getY(), coordinate.getX());
protected boolean checkEditPage(ContentPage page) { boolean allowed = false; try { page.checkAccess(JetspeedActions.EDIT); allowed = true; } catch (SecurityException se) {} return allowed; } }
public String toString() { if (fragment != null) { return "event_target="+fragment.getId()+",event_type_code="+ eventType + ",orginial_coordinate="+ originalCoordinate+",new_coordinate="+ newCoordinate; } else if (page != null) { return "event_target="+page.getId()+",event_type_code="+ eventType + ",portlet_type="+ portletType+",portlet_name="+ portletName; } else { return "event_type_code="+ eventType; } } }
public boolean isPageQualifiedForCreateNewPageOnEdit(RequestContext context) { if ( ! this.enableCreateUserPagesFromRolesOnEdit || context == null ) return false ; return isPageQualifiedForCreateNewPageOnEdit( context.getPage().getPath() ); }
BaseFragmentsElement pageOrTemplate = getPageOrTemplate(contentPage.getPageOrTemplate().getPath()); BaseFragmentElement rootFragment = pageOrTemplate.getRootFragment(); if (!(rootFragment instanceof Fragment))
page.checkAccess(JetspeedActions.CONFIG); page.checkAccess(JetspeedActions.EDIT_DEFAULTS);
public String createSessionKey(RequestContext context) { boolean isAjaxRequest = (context == null); String mode = isAjaxRequest ? "-d-" : "-p-"; String user = context.getRequest().getRemoteUser(); if (user == null) user = "guest"; return user + mode + context.getPage().getId(); }
if (path == null) page = requestContext.getPage().getPageOrTemplate();
public String createSessionKey(RequestContext context) { boolean isAjaxRequest = (context == null); String mode = isAjaxRequest ? "-d-" : "-p-"; String user = context.getRequest().getRemoteUser(); if (user == null) user = "guest"; return user + mode + context.getPage().getId(); }