public String getPortletUniqueName() { if(this.appName != null && this.portletName != null) { return this.appName+"::"+this.portletName; } else if(fragment != null) { return fragment.getName(); } else { return null; } }
/** * Get layout fragment name. * * @param f fragment * @return fragment name */ private static String getName( Object f ) { return ( ( f instanceof ContentFragment ) ? ((ContentFragment) f).getName() : ((Fragment) f).getName() ); }
public JetuiPage(ContentPage page) { String jetspeedLayout = page.getRootFragment().getName(); if (jetspeedLayout.indexOf("Two") > -1) { numberOfColumns = 2; } else if (jetspeedLayout.indexOf("Three") > -1) { numberOfColumns = 3; } columns = new Vector<ContentFragment>(numberOfColumns); buildColumns(page.getRootFragment()); }
protected boolean isDuplicateFragment(ContentFragment fragment, String portletId) { if(fragment != null) { // Get the name of this fragment String fragmentName = fragment.getName(); if(fragmentName.equals(portletId)) { // Duplicate was found return true; } else { // Process the child fragments if found List<ContentFragment> childFragments = fragment.getFragments(); if(childFragments != null) { for(int i = 0; i < childFragments.size(); i++) { // Recursively call this method again to process the child fragments if(isDuplicateFragment(childFragments.get(i),portletId) == true) { // No need to continue to loop if a duplicate was found return true; } } } } } // We will only get here if no duplicates were found return false; } }
private PortletWindow createPortletWindow(ContentFragment fragment) { PortletWindow window = null; PortletDefinition pd = rcc.getPortletRegistry().getPortletDefinitionByUniqueName(fragment.getName(), true); if (pd != null) { window = new PortletWindowImpl(this, fragment, pd); } else { // invalid window: create one anyway so that this error condition is only "recorded" once for this request window = new PortletWindowImpl(this, fragment); fragment.overrideRenderedContent("Failed to retrieve Portlet Definition for " + fragment.getName()); log.error(fragment.getOverriddenContent()); } portletWindows.put(window.getWindowId(), window); return window; }
throws PortletEntityNotGeneratedException PortletDefinition pd = registry.getPortletDefinitionByUniqueName(fragment.getName()); String entityKey = generateEntityKey(fragment); PortletEntity portletEntity = null; + fragment.getName()); String msg = "Failed to retrieve Portlet Definition for " + fragment.getName(); logger.warn(msg); portletEntity = new PortletEntityImpl(fragment);
/** * <p> * updatePortletEntity * </p> * * Updates portlet definition associated with the portlet * entity to match the fragment configuration * * @param portletEntity * @param fragment * @throws PortletEntityNotStoredException */ public void updatePortletEntity(PortletEntity portletEntity, ContentFragment fragment) throws PortletEntityNotStoredException { // validate portlet entity id if (!fragment.getId().equals(portletEntity.getId().toString())) { throw new PortletEntityNotStoredException("Fragment and PortletEntity ids do not match, update skipped: " + fragment.getId() + " != " + portletEntity.getId() ); } // update portlet definition from fragment PortletDefinition pd = registry.getPortletDefinitionByUniqueName(fragment.getName()); if (pd != null) { ((PortletEntityImpl)portletEntity).setPortletDefinition(pd); } else { throw new PortletEntityNotStoredException("Fragment PortletDefinition not found: " + fragment.getName() ); } }
String portletName = frag.getName(); if ( portletName != null && portletName.length() > 0 )
PortletDefinition layoutPortletDef = portletRegistry.getPortletDefinitionByUniqueName(layoutFragment.getName(), true); InitParam initParam = layoutPortletDef.getInitParam("sizes");
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; } }
if(fragment != null && !portletUniqueName.equals(fragment.getName())) parentPortletDef = registry.getPortletDefinitionByUniqueName(fragment.getName()); portletEntity.setPortletDefinition(parentPortletDef); storePortletEntity(portletEntity); parentPortletDef = registry.getPortletDefinitionByUniqueName(fragment.getName()); if ( parentPortletDef != null)
log.debug("Rendering portlet fragment: [[name, " + f.getName() + "], [id, " + f.getId() + "]]");
statistics.logPortletAccess(requestContext, fragment.getName(), PortalStatistics.HTTP_OK, end - start);
portletUniqueName = fragment.getName(); window = createPortletWindow(fragment); registerInstantWindow(window.getWindowId(), portletUniqueName);
if (!window.isValid()) throw new Exception("Failed to retrieve Portlet Definition for: "+ fragment.getId() + ", " + fragment.getName());
if (maximized == null) String jetspeedLayout = rootFragment.getName();