protected boolean checkSecurityConstraint(PortletDefinition portlet, ContentFragment fragment) { if (fragment.getType().equals(Fragment.PORTLET)) { if (accessController != null) { return accessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW); } } return true; }
protected boolean checkSecurityConstraint(PortletDefinition portlet, ContentFragment fragment) { if (fragment.getType().equals(ContentFragment.PORTLET)) { if (accessController != null) // TODO: MASK_EVENT { return accessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW); } } return true; }
/** * Get layout fragment type. * * @param f fragment * @return fragment type */ private static String getType( Object f ) { return ( ( f instanceof ContentFragment ) ? ((ContentFragment) f).getType() : ((Fragment) f).getType() ); }
public String dumpFragments( String debug ) { StringBuffer out = new StringBuffer(); out.append( "PortletPlacementContext - " ); if ( debug != null ) out.append( debug ).append( " - " ); out.append( "container: " ).append( this.layoutContainerFragment == null ? "<null>" : ( this.layoutContainerFragment.getId() + " / " + this.layoutContainerFragment.getType() ) ).append( " column-count=" ).append( this.numberOfColumns ).append( eol ); for (int ix = 0; ix < this.columnsList.length; ix++) { ArrayList column = this.columnsList[ix]; out.append( " column " ).append( ix ).append( eol ); Iterator frags = column.iterator(); while ( frags.hasNext() ) { ContentFragment f = (ContentFragment)frags.next(); out.append( " frag " ).append( f == null ? "<null>" : ( f.getId() + " / " + f.getType() ) ).append( eol ); } } return out.toString(); } public ContentFragment debugFragments( String debug )
protected boolean checkSecurityConstraint( PortletDefinition portlet, ContentFragment fragment, SecurityAccessController accessController, String action) { if (fragment.getType().equals(ContentFragment.PORTLET)) { if (accessController != null) { return accessController .checkPortletAccess(portlet, JetspeedActions .getContainerActionMask(action)); } } return true; }
public String toString() { return child.getType() + " col=" + childCol + " row=" + childRow + " id=" + child.getId() + " parent-id=" + parent.getId() ; } }
/** * Returns the parent layout content fragment of the content fragment specified by the fragmentId. * @param contentFragment the seed content fragment where searching starts from. * @param fragmentId the fragment id of the content fragment, of which the parent fragment is looked for. * @return */ private ContentFragment getParentFragment(ContentFragment contentFragment, String fragmentId) { for (ContentFragment child : (List<ContentFragment>) contentFragment.getFragments()) { if (fragmentId.equals(child.getId())) { return contentFragment; } else if (ContentFragment.LAYOUT.equals(child.getType())) { ContentFragment parent = getParentFragment(child, fragmentId); if (parent != null) { return parent; } } } return null; }
if (decoration == null) if (fragment.getType().equals(ContentFragment.LAYOUT))
boolean isLayout = fragment.getType().equals( ContentFragment.LAYOUT ); if ( isLayout ) String errMsg = "Cannot locate default desktop " + fragment.getType() + " decoration " + ( defaultDecoration == null ? "null" : ("\"" + defaultDecoration + "\"") ) + " (decoration " + ( defaultDecoration == null ? "null" : ("\"" + decorationName + "\"") ) + " specified for page could either not be located or does not support desktop). No desktop compatible " + fragment.getType() + " decoration is available."; log.error( errMsg );
boolean isPortlet = ( ! isRootLayout && fragment.getType().equals( ContentFragment.PORTLET ) );
if (portletContent.isComplete() || !Fragment.PORTLET.equals(fragment.getType()))
protected void init( ContentFragment container, ContentFragment excludeFragment ) throws PortletPlacementException { if ( container == null ) { container = page.getRootFragment(); if ( container == null ) throw new PortletPlacementException( "PortletPlacementContext cannot acquire root layout fragment from page" ); } if ( ! "layout".equals( container.getType() ) ) { throw new PortletPlacementException( "PortletPlacementContext specified container fragment (" + container.getId() + ") is not a layout fragment, but is type: " + container.getType() ); } this.layoutContainerFragment = container; int columnCount = PortletPlacementMetadataAccess.getColumnCountAndSizes( container, registry, null ); if ( columnCount <= 0 ) { throw new PortletPlacementException( "PortletPlacementContext cannot detemine number of columns in layout fragment (" + container.getId() + ")" ); } this.numberOfColumns = columnCount; initProcessLayoutContainerFragment( excludeFragment ); //debugFragments( "init" ); }
public ContentFragmentBean(final ContentFragment contentFragment) { id = contentFragment.getId(); type = contentFragment.getType(); name = contentFragment.getName(); locked = contentFragment.isLocked(); decorator = contentFragment.getDecorator(); mode = contentFragment.getMode(); state = contentFragment.getState(); properties = contentFragment.getPropertiesMap(); Collection<ContentFragment> childContentFragments = contentFragment.getFragments(); if (childContentFragments != null && !childContentFragments.isEmpty()) { ArrayList<ContentFragmentBean> childContentFragmentBeanList = new ArrayList<ContentFragmentBean>(); for (ContentFragment childContentFragment : childContentFragments) { childContentFragmentBeanList.add(new ContentFragmentBean(childContentFragment)); } contentFragmentBeans = childContentFragmentBeanList; } }
Properties config = ((DecorationFactoryImpl) decorationFactory).getConfiguration(decoration.getName(), fragment.getType()); ((BaseDecoration) decoration).init(config, validator, pathResolverCache);
if (child.getType().equals(ContentFragment.PORTLET))
if (fragment.getType().equals(Fragment.PORTLET))
String fragmentType = f.getType(); String decorator = f.getDecorator(); if (decorator == null)
actions = getPageModes(requestContext, window, supports, currentMode, currentState, pageActionAccess, decoration, isAjaxRequest); else if ( !Fragment.LAYOUT.equals(fragment.getType()) )