Hello
I decompiled the CollectionListRenderer and created my own collection render with a standard layout on top.
So first of all I decompiled. I created a java project, uploaded the par and mapped the collection renderer with my java class. Next I copied the default layoutset with all it's subcomponents and made it use my collection renderer.
But when I preview my layoutset, I get some errors. I get the following message from debug:
The given configuration was not used, because the alias is not defined or points to an invalid java class
The logs tell me the following:
#1.5 #005056BA19F0005F00000026000017FC000457B7A3CB09A2#1222346145711#com.sapportals.wcm.rendering.base.AbstractFactory#sap.com/irj#com.sapportals.wcm.rendering.base.AbstractFactory#Guest#0##n/a##d48fceb08a3f11ddab1f005056ba19f0#Thread[ConfigurationEventDispatcher,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Fatal##Plain###Could not create renderer with alias KenG_CollectionListRenderer and classname be.kindengezin.wcm.rendering.collection.cm.CollectionListRenderer:java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at com.sapportals.wcm.crt.CrtClassLoaderRegistry.forName(CrtClassLoaderRegistry.java:349) at com.sapportals.wcm.rendering.base.AbstractFactory.createLayoutObject(AbstractFactory.java:204) at com.sapportals.wcm.rendering.base.AbstractFactory.initialize(AbstractFactory.java:271) at com.sapportals.wcm.rendering.base.AbstractFactory.configEvent(AbstractFactory.java:471) at com.sapportals.config.event.ConfigEventService.dispatchEvent(ConfigEventService.java:227) at com.sapportals.config.event.ConfigEventService.configEvent(ConfigEventService.java:112) at com.sapportals.config.event.ConfigEventDispatcher.callConfigListeners(ConfigEventDispatcher.java:308) at com.sapportals.config.event.ConfigEventDispatcher.flushEvents(ConfigEventDispatcher.java:251) at com.sapportals.config.event.ConfigEventDispatcher.run(ConfigEventDispatcher.java:110)
I have a portalapp.xml:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"></property>
</application-config>
<components></components>
<services>
<service name="RFServiceWrapper">
<service-config>
<property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"></property>
<property name="startup" value="true"></property>
</service-config>
</service>
</services>
</application>
And My service wrapper:
- IRFServiceWrapper
package com.sap.netweaver.rf.wrapper;
import com.sapportals.portal.prt.service.IService;
public interface IRFServiceWrapper extends IService{
public static final String KEY = "be.kindengezin.CollectionRenderer.CollectionListRenderer";
}
- RFServiceWrapper
package com.sap.netweaver.rf.wrapper;
import com.sapportals.portal.prt.service.IServiceContext;
import com.sapportals.portal.prt.service.IServiceConfiguration;
import com.sapportals.portal.prt.service.IService;
import com.sapportals.wcm.crt.CrtClassLoaderRegistry;
public class RFServiceWrapper implements IRFServiceWrapper{
private IServiceContext mm_serviceContext;
/**
* Generic init method of the service. Will be called by the portal runtime.
* @param serviceContext
*/
public void init(IServiceContext serviceContext){
mm_serviceContext = serviceContext;
CrtClassLoaderRegistry.addClassLoader(this.getKey(), this.getClass().getClassLoader());
}
/**
* This method is called after all services in the portal runtime have already been initialized.
*/
public void afterInit(){
}
/**
* configure the service : @param configuration
*/
public void configure(IServiceConfiguration configuration){
}
/**
* This method is called by the portal runtime when the service is destroyed.
*/
public void destroy(){
}
/**
* This method is called by the portal runtime when the service is released.
*/
public void release(){
}
/**
* @return the context of the service, which was previously set by the portal runtime
*/
public IServiceContext getContext(){
return mm_serviceContext;
}
/**
* This method should return a string that is unique to this service amongst all
* other services deployed in the portal runtime.
* @return a unique key of the service
*/
public String getKey(){
return KEY;
}
}
And to finish my CollectionListRenderer (which was simply decompiled). Of course I added the needed jar files to the build path (through "add external JARs...").
package be.kindengezin.wcm.rendering.collection.cm;
import com.sap.tc.logging.Location;
import com.sap.tc.logging.LogController;
import com.sapportals.htmlb.Component;
import com.sapportals.htmlb.FormLayout;
import com.sapportals.htmlb.FormLayoutCell;
import com.sapportals.htmlb.FormLayoutRow;
import com.sapportals.htmlb.HTMLFragment;
import com.sapportals.htmlb.enum.CellVAlign;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.rendering.IPageContext;
import com.sapportals.wcm.WcmException;
import com.sapportals.wcm.control.util.EmptyComponent;
import com.sapportals.wcm.control.util.property.IPropertyColumn;
import com.sapportals.wcm.control.util.property.IPropertyPosition;
import com.sapportals.wcm.control.util.property.IPropertyWithModifiers;
import com.sapportals.wcm.control.util.property.IPropertyWithModifiersList;
import com.sapportals.wcm.control.util.property.PropertyColumnFactory;
import com.sapportals.wcm.rendering.base.ILayoutObject;
import com.sapportals.wcm.rendering.base.IProxy;
import com.sapportals.wcm.rendering.base.IRendererStatus;
import com.sapportals.wcm.rendering.collection.LightCollectionRenderer;
import com.sapportals.wcm.rendering.collection.cm.PropertyColumnRenderer;
import com.sapportals.wcm.rendering.collection.cm.PropertyHeaderRenderer;
import com.sapportals.wcm.rendering.resource.IResourceRenderer;
import com.sapportals.wcm.rendering.util.HtmlRendererUtil;
import com.sapportals.wcm.repository.IPropertyName;
import com.sapportals.wcm.repository.IPropertyNameList;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.IResourceContext;
import com.sapportals.wcm.repository.IResourceFactory;
import com.sapportals.wcm.repository.IResourceList;
import com.sapportals.wcm.repository.PropertyName;
import com.sapportals.wcm.repository.ResourceException;
import com.sapportals.wcm.repository.ResourceFactory;
import com.sapportals.wcm.repository.service.IRepositoryServiceFactory;
import com.sapportals.wcm.repository.service.layout.customizing.ICollectionRendererParameterNameConst;
import com.sapportals.wcm.repository.service.layout.customizing.IParameterName;
import com.sapportals.wcm.repository.service.layout.customizing.IParameters;
import com.sapportals.wcm.repository.service.layout.customizing.IResourceRendererParameterNameConst;
import com.sapportals.wcm.service.propertyconfig.IMetaModel;
import com.sapportals.wcm.service.propertyconfig.IMetaName;
import com.sapportals.wcm.service.propertyconfig.IMetaNameList;
import com.sapportals.wcm.service.propertyconfig.IPropertyConfigurationService;
import com.sapportals.wcm.util.logging.LoggingFormatter;
import com.sapportals.wcm.util.profiler.IProfiler;
import com.sapportals.wcm.util.profiler.IProfiler.Level;
import com.sapportals.wcm.util.profiler.Profiler;
import com.sapportals.wdf.WdfException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
public class CollectionListRenderer extends LightCollectionRenderer
{
private static final String PROFILER_PATH_UI_RENDER = "/KM/FLEXUI/RENDER/UI";
private static final String PROFILER_PATH_UI_RENDER_ROW = "/KM/FLEXUI/RENDER/UI/ROW ";
private static final String PROFILER_PATH_UI_RENDER_GETPROPS = "/KM/FLEXUI/RENDER/UI/GETPROPS";
private static IProfiler s_profiler = Profiler.getInstance();
private static Location log = Location.getLocation(CollectionListRenderer.class.getName());
private static int PAGER_LINKS_DEFAULT = 5;
private static final CellVAlign VERTICAL_ALIGN = HtmlRendererUtil.FLEXUI_VERTICAL_ALIGN;
private int MaxNumberOfRows = 10;
private int noOfColumns = 0;
private static IPropertyName[] DEFAULT_PROP_NAMES = new PropertyName[3];
private IPropertyPosition[] propertiesPositions;
private static final String NEXT_LINE_START_COLUMN = "col";
private static final String NEXT_LINE_METANAME = "metaName";
private static final String NEXT_LINE_METANAME_MODIFIERS = "metaNameModifiers";
private boolean debug = false;
private boolean isManualOrdered = false;
public CollectionListRenderer()
{
initParameterSettings();
super.set508enabled(true);
}
private void initParameterSettings()
{
IParameterName[] supportedParameters =
{
ICollectionRendererParameterNameConst.BREADCRUMBSTYLE,
ICollectionRendererParameterNameConst.BREADCRUMBVISIBILITYSTYLE,
ICollectionRendererParameterNameConst.SHOWFOLDERTITLE,
ICollectionRendererParameterNameConst.SHOWFILESSTYLE,
ICollectionRendererParameterNameConst.SORT_ENABLED,
ICollectionRendererParameterNameConst.LINKSSTYLE,
ICollectionRendererParameterNameConst.SHOWFOLDERSSTYLE,
ICollectionRendererParameterNameConst.SHOW_HIDDEN,
ICollectionRendererParameterNameConst.COLUMNS,
IResourceRendererParameterNameConst.ICONSTYLE,
ICollectionRendererParameterNameConst.ROWS,
ICollectionRendererParameterNameConst.ROWSPACING,
ICollectionRendererParameterNameConst.COLUMNSPACING,
ICollectionRendererParameterNameConst.MASSACTIONSTYLE,
ICollectionRendererParameterNameConst.UI_GROUP_MASS,
IResourceRendererParameterNameConst.ITEMACTIONSTYLE,
ICollectionRendererParameterNameConst.ITEMSELECTIONMODE,
ICollectionRendererParameterNameConst.ROWBACKGROUNDSTYLE,
ICollectionRendererParameterNameConst.PROPERTYCOLUMNS,
ICollectionRendererParameterNameConst.BACKGROUNDIMAGEPATH,
ICollectionRendererParameterNameConst.BACKGROUNDIMAGESTYLE,
ICollectionRendererParameterNameConst.SORT_PROPERTY,
ICollectionRendererParameterNameConst.COMPONENTS,
ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE,
ICollectionRendererParameterNameConst.SORT_ORDER,
ICollectionRendererParameterNameConst.COLLECTION_ACTIONSTYLE,
ICollectionRendererParameterNameConst.UI_GROUP_COLLECTION,
ICollectionRendererParameterNameConst.RESOURCE_LIST_FILTER,
ICollectionRendererParameterNameConst.RESIZEHEIGHTSTYLE,
ICollectionRendererParameterNameConst.RESIZEWIDHTSTYLE,
ICollectionRendererParameterNameConst.FILTEREXTENSION,
ICollectionRendererParameterNameConst.FILTERMIMETYPE,
ICollectionRendererParameterNameConst.FILTERRESOURCETYPE,
IResourceRendererParameterNameConst.UI_GROUP_RESOURCE,
ICollectionRendererParameterNameConst.PAGER_LINK_COUNT,
ICollectionRendererParameterNameConst.EMPTY_COLLECTION_FILE,
ICollectionRendererParameterNameConst.EMPTY_COLLECTION_KEY,
ICollectionRendererParameterNameConst.EMPTY_COLLECTION_STYLE };
super.setSupportedParameters(supportedParameters);
IParameters parameters = super.getParameters();
parameters.setParameter(ICollectionRendererParameterNameConst.BREADCRUMBSTYLE, "horizontal");
parameters.setParameter(ICollectionRendererParameterNameConst.BREADCRUMBVISIBILITYSTYLE, "standard");
parameters.setParameter(ICollectionRendererParameterNameConst.SHOWFILESSTYLE, "all");
parameters.setParameter(ICollectionRendererParameterNameConst.LINKSSTYLE, "all");
parameters.setParameter(ICollectionRendererParameterNameConst.SHOWFOLDERSSTYLE, "all");
parameters.setParameter(ICollectionRendererParameterNameConst.MASSACTIONSTYLE, "off");
parameters.setParameter(IResourceRendererParameterNameConst.ITEMACTIONSTYLE, "hover");
parameters.setParameter(ICollectionRendererParameterNameConst.SHOWFOLDERTITLE, false);
parameters.setParameter(ICollectionRendererParameterNameConst.GRIDORDERSTYLE, "columnmajor");
parameters.setParameter(ICollectionRendererParameterNameConst.ROWS, this.isManualOrdered);
parameters.setParameter(ICollectionRendererParameterNameConst.ROWSPACING, 0);
parameters.setParameter(ICollectionRendererParameterNameConst.SORT_ENABLED, true);
parameters.setParameter(ICollectionRendererParameterNameConst.COLUMNSPACING, 0);
parameters.setParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "off");
parameters.setParameter(ICollectionRendererParameterNameConst.ROWBACKGROUNDSTYLE, "TRANSPARENT");
parameters.setParameter(ICollectionRendererParameterNameConst.COLLECTION_ACTIONSTYLE, "hover");
parameters.setParameter(ICollectionRendererParameterNameConst.PROPERTYCOLUMNS, "rnd:icon(noTitle/noColumnSpacing),rnd:displayname(contentLink)");
parameters.setParameter(ICollectionRendererParameterNameConst.RESOURCE_LIST_FILTER, "default");
parameters.setParameter(ICollectionRendererParameterNameConst.SHOW_HIDDEN, false);
parameters.setParameter(ICollectionRendererParameterNameConst.RESIZEHEIGHTSTYLE, "compact");
parameters.setParameter(ICollectionRendererParameterNameConst.RESIZEWIDHTSTYLE, "compact");
parameters.setParameter(ICollectionRendererParameterNameConst.PAGER_LINK_COUNT, PAGER_LINKS_DEFAULT);
parameters.setParameter(ICollectionRendererParameterNameConst.EMPTY_COLLECTION_STYLE, "off");
}
public int renderListHeader(FormLayout grid, int row) throws WcmException
{
if (super.isExactlyValue(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "off"))
{
return row;
}
IPropertyPosition position = null;
IPropertyColumn[] iterColumns = getColumnsList();
boolean existsResource = super.getResourceList().size() != 0;
String propertyHeaderColumnStyle = super.getParameters().getParameter(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "Table Title Color");
String headerClassStyle = HtmlRendererUtil.getHeaderClassStyle(propertyHeaderColumnStyle);
if (headerClassStyle == null)
{
headerClassStyle = "";
}
FormLayoutCell cell = null;
if (existsResource)
{
cell = grid.addComponent(row, 1, new HTMLFragment(""));
cell.setStyle(headerClassStyle);
}
int rowSpan = 0;
int columnSpan = 0;
int line = 1;
int lineNew = 0;
int column = 1;
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
{
++column;
}
int startRow = row;
boolean rowHasTitle = false;
this.propertiesPositions = new IPropertyPosition[iterColumns.length];
PropertyHeaderRenderer sortHeader = new PropertyHeaderRenderer(super.getProxy(), this, super.getBundleHandler(), getChildCountMetaName(super.getParentCollection()), this.isManualOrdered, super.getIRS().getSortDefintion(), super.getResourceContext().getLocale());
IMetaName metaName = null;
for (int i = 0;(i < iterColumns.length) && (existsResource); ++i)
if (iterColumns<i> != null)
{
rowSpan = 0;
columnSpan = 0;
position = PropertyColumnFactory.getInstance().getPosition(iterColumns<i>);
if (position != null)
{
lineNew = position.getRow();
if (line != lineNew)
{
column = position.getColumn();
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
++column;
line = lineNew;
if (rowHasTitle)
{
row = row + 1;
rowHasTitle = false;
}
}
rowSpan = position.getSpanRow();
columnSpan = position.getSpanColumn();
}
this.propertiesPositions<i> = PropertyColumnFactory.getInstance().getPropertyPosition(row, rowSpan, column, columnSpan);
boolean is508Required = false;
try
{
is508Required = super.getProxy().getDynamicPage().getPageContext().requiresSection508Rendering();
}
catch (Exception ex)
{
log.errorT("Could not retrieve 508 mode for proxy <" + super.getProxy() + ">: " + LoggingFormatter.extractCallstack(ex));
}
metaName = PropertyHeaderRenderer.getMetaNameForTitle(iterColumns<i>, is508Required);
if (metaName != null)
rowHasTitle = true;
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.SORT_ENABLED, true)))
{
sortHeader.setSortEnabledParameter(false);
}
if (metaName != null)
{
if (columnSpan != 0)
{
cell = grid.addComponent(row, 1, sortHeader.createSortLink(metaName));
cell.setColspan(columnSpan);
}
else
{
cell = grid.addComponent(row, column, sortHeader.createSortLink(metaName));
}
String[] padding = HtmlRendererUtil.getPropertyPaddingValues(iterColumns<i>, metaName);
cell.setHorizontalAlignment(PropertyColumnFactory.getInstance().getHAlign(iterColumns<i>));
cell.setVerticalAlignment(PropertyColumnFactory.getInstance().getVAlign(iterColumns<i>));
if (padding != null)
{
cell.setPaddingTop(padding[0]);
cell.setPaddingRight(padding[1]);
cell.setPaddingBottom(padding[2]);
cell.setPaddingLeft(padding[3]);
}
}
++column;
if (columnSpan != 0)
column = column + columnSpan;
if ((!(iterColumns<i>.contains("noColumnSpacing"))) && (column < this.noOfColumns))
{
cell = grid.addComponent(row, column, EmptyComponent.render());
if (!("0".equals(super.getColumnSpacing())))
cell.setWidth(super.getColumnSpacing());
cell.setVerticalAlignment(VERTICAL_ALIGN);
++column;
}
}
if (!(rowHasTitle));
setClassStyleForm(headerClassStyle, grid, startRow, --row, this.noOfColumns);
return (++row);
}
public int renderListFooter(FormLayout grid, int row) throws WcmException
{
FormLayoutCell cell;
boolean existsResource = super.getResourceList().size() != 0;
if (!(super.isExactlyValue(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "off")))
{
String propertyHeaderColumnStyle = super.getParameters().getParameter(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "Table Title Color");
String headerClassStyle = HtmlRendererUtil.getHeaderClassStyle(propertyHeaderColumnStyle);
if (headerClassStyle == null)
{
headerClassStyle = "";
}
cell = null;
}
return row;
}
public ILayoutObject getNewInstance()
{
return super.initNewInstance(new CollectionListRenderer());
}
private String getChildCountMetaName(IResource res) throws WcmException
{
if (res == null)
{
return null;
}
IResourceRenderer resourceRenderer = super.getRenderer(res);
String par = resourceRenderer.getParameters().getParameter(IResourceRendererParameterNameConst.SHOWCHILDCOUNTSTYLE);
if (par == null)
{
return null;
}
String resultMetaNameID = null;
if (par.equals("folders/files"))
resultMetaNameID = "rnd:childcount_both";
else if (par.equals("sum"))
resultMetaNameID = "rnd:childcount_sum";
else if (par.equals("only files"))
resultMetaNameID = "rnd:childcount_files";
else if (par.equals("only folders"))
resultMetaNameID = "rnd:childcount_folders";
if (resultMetaNameID != null)
{
IMetaName metaName = getPropertyConfigurationService().getMetaModel().searchById(resultMetaNameID);
if (metaName != null)
return getEncodedSortProperty(metaName);
}
return null;
}
private String getEncodedSortProperty(IMetaName metaName)
{
if (metaName.getComposedOfMetaNames() != null)
{
IMetaNameList metaList = metaName.getComposedOfMetaNames();
if (metaList.contains(metaName))
return metaName.getId();
if (metaList.size() == 1)
{
IMetaName composedMetaName = metaList.get(0);
return composedMetaName.getId();
}
return metaName.getId();
}
return metaName.getId();
}
public static Vector getIMetaNameTypeText(IPropertyColumn propertyColumn, int col)
{
Hashtable metaNameHash = null;
Vector metaNameVector = null;
IMetaName currentMetaName = null;
IPropertyWithModifiersList propertyWithModifiers = propertyColumn.getPropertyWithModifier();
for (int i = 0; i < propertyWithModifiers.size(); ++i)
{
currentMetaName = propertyWithModifiers.get(i).getMetaName();
if ((currentMetaName != null) && ("Text".equals(currentMetaName.getType())) && (propertyWithModifiers.size() != 1))
{
metaNameHash = new Hashtable();
metaNameHash.put("metaName", currentMetaName);
metaNameHash.put("col", Integer.toString(col));
if (propertyWithModifiers.get(i).getConfigModifierList() != null)
metaNameHash.put("metaNameModifiers", propertyWithModifiers.get(i));
if (metaNameVector == null)
metaNameVector = new Vector();
metaNameVector.add(metaNameHash);
}
}
return metaNameVector;
}
private static boolean[] isNextLineColumnNeeded(IPropertyColumn[] propertyColumns)
{
boolean[] result = new boolean[propertyColumns.length];
IMetaName currentMetaName = null;
for (int j = 0; j < propertyColumns.length; ++j)
{
IPropertyColumn propertyColumn = propertyColumns[j];
result[j] = false;
IPropertyWithModifiersList propertyWithModifiers = propertyColumn.getPropertyWithModifier();
for (int i = 0; i < propertyWithModifiers.size(); ++i)
{
currentMetaName = propertyWithModifiers.get(i).getMetaName();
if ((currentMetaName != null) && ("Text".equals(currentMetaName.getType())) && (propertyWithModifiers.size() != 1))
{
if (log.beDebug())
log.debugT("Found meta name <" + currentMetaName + "> in property column <" + propertyColumn + "> that defines we need a new line column");
result[j] = true;
}
}
}
return result;
}
private IPropertyConfigurationService getPropertyConfigurationService() throws WcmException
{
return ((IPropertyConfigurationService) ResourceFactory.getInstance().getServiceFactory().getService("PropertyConfigurationService"));
}
public final void setColumnsList(IPropertyColumn[] list) throws WcmException
{
super.getIRS().setPropertyColumns(list);
}
public IPropertyColumn[] getColumnsList() throws WcmException
{
return super.getIRS().getPropertyColumns();
}
private IPropertyColumn[] createCollectionColumns()
{
String columnsString = super.getParameters().getParameter(ICollectionRendererParameterNameConst.PROPERTYCOLUMNS, "rnd:icon(noTitle/noColumnSpacing),rnd:displayname(contentLink)");
return PropertyColumnFactory.getInstance().parseProperty(columnsString);
}
// ERROR
//public Component renderUI() throws WcmException { // Byte code:
// 0: getstatic 192 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:s_profiler Lcom/sapportals/wcm/util/profiler/IProfiler;
// 3: ldc 193
// 5: getstatic 194 com/sapportals/wcm/util/profiler/IProfiler$Level:MEDIUM Lcom/sapportals/wcm/util/profiler/IProfiler$Level;
// 8: invokeinterface 195 3 0
// 13: aload_0
// 14: invokevirtual 86 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getProxy ()Lcom/sapportals/wcm/rendering/base/IProxy;
// 17: invokeinterface 196 1 0
// 22: ifeq +7 -> 29
// 25: aload_0
// 26: invokevirtual 197 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:writeDebugInformation ()V
// 29: aload_0
// 30: aload_0
// 31: invokespecial 198 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:createCollectionColumns ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 34: invokevirtual 199 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:setColumnsList ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;)V
// 37: new 200 com/sapportals/htmlb/FormLayout
// 40: dup
// 41: invokespecial 201 com/sapportals/htmlb/FormLayout:<init> ()V
// 44: astore_1
// 45: aload_1
// 46: ldc 133
// 48: ldc 133
// 50: ldc 133
// 52: ldc 133
// 54: invokevirtual 202 com/sapportals/htmlb/FormLayout:setMargin (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
// 57: aload_1
// 58: ldc 76
// 60: invokevirtual 203 com/sapportals/htmlb/FormLayout:setWidth (Ljava/lang/String;)V
// 63: aconst_null
// 64: astore_2
// 65: aload_1
// 66: aload_0
// 67: getfield 9 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:debug Z
// 70: invokevirtual 204 com/sapportals/htmlb/FormLayout:setDebugMode (Z)V
// 73: iconst_1
// 74: istore_3
// 75: aload_0
// 76: invokevirtual 205 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:isVisible ()Z
// 79: ifne +12 -> 91
// 82: aload_1
// 83: astore 4
// 85: jsr +733 -> 818
// 88: aload 4
// 90: areturn
// 91: aload_0
// 92: getstatic 16 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:SHOWFOLDERTITLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 95: iconst_0
// 96: invokevirtual 206 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameter (Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;Z)Z
// 99: ifeq +35 -> 134
// 102: aload_1
// 103: iload_3
// 104: iconst_1
// 105: aload_0
// 106: invokevirtual 207 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:renderFolderTitle ()Lcom/sapportals/htmlb/Component;
// 109: invokevirtual 79 com/sapportals/htmlb/FormLayout:addComponent (IILcom/sapportals/htmlb/Component;)Lcom/sapportals/htmlb/FormLayoutCell;
// 112: astore_2
// 113: aload_2
// 114: bipush 10
// 116: invokevirtual 120 com/sapportals/htmlb/FormLayoutCell:setColspan (I)V
// 119: aload_2
// 120: ldc 208
// 122: invokevirtual 126 com/sapportals/htmlb/FormLayoutCell:setPaddingTop (Ljava/lang/String;)V
// 125: aload_2
// 126: ldc 209
// 128: invokevirtual 128 com/sapportals/htmlb/FormLayoutCell:setPaddingBottom (Ljava/lang/String;)V
// 131: iinc 3 1
// 134: aload_0
// 135: invokevirtual 71 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getResourceList ()Lcom/sapportals/wcm/repository/IResourceList;
// 138: astore 4
// 140: aload_0
// 141: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 144: getstatic 51 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:EMPTY_COLLECTION_STYLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 147: ldc 58
// 149: invokeinterface 210 3 0
// 154: ifne +56 -> 210
// 157: aload 4
// 159: ifnull +51 -> 210
// 162: aload 4
// 164: invokeinterface 72 1 0
// 169: ifne +41 -> 210
// 172: aload_1
// 173: iload_3
// 174: iconst_1
// 175: new 211 com/sapportals/wcm/rendering/readymades/EmptyCollectionInfo
// 178: dup
// 179: aload_0
// 180: invokevirtual 86 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getProxy ()Lcom/sapportals/wcm/rendering/base/IProxy;
// 183: aload_0
// 184: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 187: invokespecial 212 com/sapportals/wcm/rendering/readymades/EmptyCollectionInfo:<init> (Lcom/sapportals/wcm/rendering/base/IProxy;Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;)V
// 190: invokevirtual 79 com/sapportals/htmlb/FormLayout:addComponent (IILcom/sapportals/htmlb/Component;)Lcom/sapportals/htmlb/FormLayoutCell;
// 193: astore_2
// 194: aload_2
// 195: bipush 10
// 197: invokevirtual 120 com/sapportals/htmlb/FormLayoutCell:setColspan (I)V
// 200: aload_2
// 201: getstatic 213 com/sapportals/htmlb/enum/CellHAlign:LEFT Lcom/sapportals/htmlb/enum/CellHAlign;
// 204: invokevirtual 123 com/sapportals/htmlb/FormLayoutCell:setHorizontalAlignment (Lcom/sapportals/htmlb/enum/CellHAlign;)V
// 207: iinc 3 1
// 210: aload_0
// 211: aload_0
// 212: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 215: aload_0
// 216: getfield 7 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:isManualOrdered Z
// 219: invokestatic 214 com/sapportals/wcm/control/util/property/PropertyColumnFactory:getNoOfColumn ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;I)I
// 222: putfield 8 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:noOfColumns I
// 225: iconst_1
// 226: istore 5
// 228: aload_0
// 229: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 232: getstatic 30 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:ITEMSELECTIONMODE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 235: ldc 81
// 237: invokeinterface 74 3 0
// 242: ldc 58
// 244: invokevirtual 82 java/lang/String:equals (Ljava/lang/Object;)Z
// 247: ifne +16 -> 263
// 250: iinc 5 1
// 253: aload_0
// 254: dup
// 255: getfield 8 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:noOfColumns I
// 258: iconst_1
// 259: iadd
// 260: putfield 8 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:noOfColumns I
// 263: aload_0
// 264: invokevirtual 88 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParentCollection ()Lcom/sapportals/wcm/repository/ICollection;
// 267: ifnull +25 -> 292
// 270: new 215 com/sapportals/wcm/control/util/FolderSettings
// 273: dup
// 274: aload_0
// 275: invokevirtual 88 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParentCollection ()Lcom/sapportals/wcm/repository/ICollection;
// 278: invokespecial 216 com/sapportals/wcm/control/util/FolderSettings:<init> (Lcom/sapportals/wcm/repository/ICollection;)V
// 281: astore 6
// 283: aload_0
// 284: aload 6
// 286: invokevirtual 217 com/sapportals/wcm/control/util/FolderSettings:getOrderedFlag ()Z
// 289: putfield 10 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:isManualOrdered Z
// 292: aload_0
// 293: aload_1
// 294: iload_3
// 295: invokevirtual 218 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:renderListHeader (Lcom/sapportals/htmlb/FormLayout;I)I
// 298: istore_3
// 299: aload_0
// 300: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 303: getstatic 43 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:RESIZEWIDHTSTYLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 306: ldc 67
// 308: invokeinterface 74 3 0
// 313: ldc 219
// 315: invokevirtual 82 java/lang/String:equals (Ljava/lang/Object;)Z
// 318: istore 6
// 320: aload_0
// 321: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 324: getstatic 42 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:RESIZEHEIGHTSTYLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 327: ldc 67
// 329: invokeinterface 74 3 0
// 334: ldc 219
// 336: invokevirtual 82 java/lang/String:equals (Ljava/lang/Object;)Z
// 339: istore 7
// 341: aload_0
// 342: invokevirtual 220 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getStartRow ()I
// 345: aload_0
// 346: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 349: getstatic 24 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:ROWS Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 352: aload_0
// 353: getfield 7 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:isManualOrdered Z
// 356: invokeinterface 221 3 0
// 361: iadd
// 362: istore 8
// 364: iload 8
// 366: aload 4
// 368: invokeinterface 72 1 0
// 373: if_icmple +12 -> 385
// 376: aload 4
// 378: invokeinterface 72 1 0
// 383: istore 8
// 385: iconst_0
// 386: istore 9
// 388: iload 7
// 390: ifeq +15 -> 405
// 393: iload 8
// 395: ifeq +10 -> 405
// 398: bipush 100
// 400: iload 8
// 402: idiv
// 403: istore 9
// 405: aload 4
// 407: aload_0
// 408: invokevirtual 220 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getStartRow ()I
// 411: iload 8
// 413: invokeinterface 222 3 0
// 418: astore 10
// 420: aload 10
// 422: invokeinterface 223 1 0
// 427: astore 11
// 429: aconst_null
// 430: astore 12
// 432: iconst_1
// 433: istore 13
// 435: ldc 76
// 437: astore 14
// 439: aload_0
// 440: getstatic 31 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:ROWBACKGROUNDSTYLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 443: ldc 224
// 445: invokevirtual 69 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:isExactlyValue (Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;Ljava/lang/Object;)Z
// 448: istore 15
// 450: aload_0
// 451: getstatic 31 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:ROWBACKGROUNDSTYLE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 454: ldc 225
// 456: invokevirtual 69 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:isExactlyValue (Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;Ljava/lang/Object;)Z
// 459: istore 16
// 461: iload 15
// 463: ifne +8 -> 471
// 466: iload 16
// 468: ifeq +16 -> 484
// 471: aload_1
// 472: iload_3
// 473: iconst_1
// 474: invokestatic 226 com/sapportals/wcm/rendering/util/HtmlRendererUtil:importStyles ()Lcom/sapportals/htmlb/HTMLFragment;
// 477: invokevirtual 79 com/sapportals/htmlb/FormLayout:addComponent (IILcom/sapportals/htmlb/Component;)Lcom/sapportals/htmlb/FormLayoutCell;
// 480: pop
// 481: iinc 3 1
// 484: aload_0
// 485: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 488: ifnull +285 -> 773
// 491: invokestatic 95 com/sapportals/wcm/control/util/property/PropertyColumnFactory:getInstance ()Lcom/sapportals/wcm/control/util/property/PropertyColumnFactory;
// 494: aload_0
// 495: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 498: invokevirtual 227 com/sapportals/wcm/control/util/property/PropertyColumnFactory:getPropertyNameList ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;)Lcom/sapportals/wcm/repository/IPropertyNameList;
// 501: astore 17
// 503: iconst_0
// 504: istore 18
// 506: goto +29 -> 535
// 509: getstatic 228 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:DEFAULT_PROP_NAMES [Lcom/sapportals/wcm/repository/IPropertyName;
// 512: iload 18
// 514: aaload
// 515: ifnull +17 -> 532
// 518: aload 17
// 520: getstatic 228 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:DEFAULT_PROP_NAMES [Lcom/sapportals/wcm/repository/IPropertyName;
// 523: iload 18
// 525: aaload
// 526: invokeinterface 229 2 0
// 531: pop
// 532: iinc 18 1
// 535: iload 18
// 537: getstatic 228 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:DEFAULT_PROP_NAMES [Lcom/sapportals/wcm/repository/IPropertyName;
// 540: arraylength
// 541: if_icmplt -32 -> 509
// 544: getstatic 192 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:s_profiler Lcom/sapportals/wcm/util/profiler/IProfiler;
// 547: ldc 230
// 549: getstatic 194 com/sapportals/wcm/util/profiler/IProfiler$Level:MEDIUM Lcom/sapportals/wcm/util/profiler/IProfiler$Level;
// 552: invokeinterface 195 3 0
// 557: aload_0
// 558: invokevirtual 86 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getProxy ()Lcom/sapportals/wcm/rendering/base/IProxy;
// 561: invokeinterface 231 1 0
// 566: aload 10
// 568: aload 17
// 570: invokevirtual 232 com/sapportals/wcm/rendering/base/ResourcePropertyAmalgamation:readProperties (Lcom/sapportals/wcm/repository/IResourceList;Lcom/sapportals/wcm/repository/IPropertyNameList;)V
// 573: jsr +14 -> 587
// 576: goto +26 -> 602
// 579: astore 19
// 581: jsr +6 -> 587
// 584: aload 19
// 586: athrow
// 587: astore 20
// 589: getstatic 192 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:s_profiler Lcom/sapportals/wcm/util/profiler/IProfiler;
// 592: ldc 230
// 594: invokeinterface 233 2 0
// 599: pop2
// 600: ret 20
// 602: aload_0
// 603: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 606: invokestatic 234 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getPositionArray ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;)[Lcom/sapportals/wcm/control/util/property/IPropertyPosition;
// 609: astore 19
// 611: aload_0
// 612: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 615: invokestatic 235 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:isNextLineColumnNeeded ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;)[Z
// 618: astore 20
// 620: aload_0
// 621: invokevirtual 53 com/sapportals/wcm/rendering/collection/LightCollectionRenderer:getParameters ()Lcom/sapportals/wcm/repository/service/layout/customizing/IParameters;
// 624: getstatic 30 com/sapportals/wcm/repository/service/layout/customizing/ICollectionRendererParameterNameConst:ITEMSELECTIONMODE Lcom/sapportals/wcm/repository/service/layout/customizing/IParameterName;
// 627: ldc 81
// 629: invokeinterface 74 3 0
// 634: ldc 58
// 636: invokevirtual 82 java/lang/String:equals (Ljava/lang/Object;)Z
// 639: ifne +7 -> 646
// 642: iconst_1
// 643: goto +4 -> 647
// 646: iconst_0
// 647: istore 21
// 649: aload_0
// 650: invokevirtual 70 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getColumnsList ()[Lcom/sapportals/wcm/control/util/property/IPropertyColumn;
// 653: iload 21
// 655: invokestatic 236 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:getPaddingList ([Lcom/sapportals/wcm/control/util/property/IPropertyColumn;Z)Ljava/util/List;
// 658: astore 22
// 660: goto +103 -> 763
// 663: aload 11
// 665: invokeinterface 237 1 0
// 670: astore 12
// 672: iload 15
// 674: ifeq +16 -> 690
// 677: ldc 238
// 679: astore 14
// 681: iload 13
// 683: ifne +7 -> 690
// 686: ldc 239
// 688: astore 14
// 690: aload_0
// 691: aload_1
// 692: iload_3
// 693: iconst_1
// 694: aload 12
// 696: aload 14
// 698: iload 9
// 700: aload 17
// 702: aload 19
// 704: aload 20
// 706: aload 22
// 708: invokespecial 240 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:renderFormRow (Lcom/sapportals/htmlb/FormLayout;IILcom/sapportals/wcm/repository/IResource;Ljava/lang/String;ILcom/sapportals/wcm/repository/IPropertyNameList;[Lcom/sapportals/wcm/control/util/property/IPropertyPosition;[ZLjava/util/List;)I
// 711: istore_3
// 712: iload 16
// 714: ifeq +37 -> 751
// 717: aload 11
// 719: invokeinterface 241 1 0
// 724: ifeq +27 -> 751
// 727: aload_1
// 728: iload_3
// 729: iconst_1
// 730: ldc 238
// 732: iconst_1
// 733: invokestatic 242 com/sapportals/wcm/rendering/util/HtmlRendererUtil:renderLineSeparator (Ljava/lang/String;I)Lcom/sapportals/htmlb/Component;
// 736: invokevirtual 79 com/sapportals/htmlb/FormLayout:addComponent (IILcom/sapportals/htmlb/Component;)Lcom/sapportals/htmlb/FormLayoutCell;
// 739: astore_2
// 740: aload_2
// 741: aload_0
// 742: getfield 8 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:noOfColumns I
// 745: invokevirtual 120 com/sapportals/htmlb/FormLayoutCell:setColspan (I)V
// 748: iinc 3 1
// 751: iload 13
// 753: ifne +7 -> 760
// 756: iconst_1
// 757: goto +4 -> 761
// 760: iconst_0
// 761: istore 13
// 763: aload 11
// 765: invokeinterface 241 1 0
// 770: ifne -107 -> 663
// 773: aload_0
// 774: aload_1
// 775: iload_3
// 776: invokevirtual 243 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:renderListFooter (Lcom/sapportals/htmlb/FormLayout;I)I
// 779: istore_3
// 780: iload 6
// 782: ifeq +9 -> 791
// 785: aload_1
// 786: ldc 244
// 788: invokevirtual 203 com/sapportals/htmlb/FormLayout:setWidth (Ljava/lang/String;)V
// 791: aload_1
// 792: astore 17
// 794: jsr +24 -> 818
// 797: aload 17
// 799: areturn
// 800: astore_1
// 801: new 245 WcmException
// 804: dup
// 805: aload_1
// 806: invokespecial 246 WcmException:<init> (Ljava/lang/Throwable;)V
// 809: athrow
// 810: astore 23
// 812: jsr +6 -> 818
// 815: aload 23
// 817: athrow
// 818: astore 24
// 820: getstatic 192 com/sapportals/wcm/rendering/collection/cm/ST_CollectionListRenderer:s_profiler Lcom/sapportals/wcm/util/profiler/IProfiler;
// 823: ldc 193
// 825: invokeinterface 233 2 0
// 830: pop2
// 831: ret 24
//
// Exception table:
// from to target type
// 557 579 579 finally
// 13 800 800 java/lang/Exception
// 13 810 810 finally }
private static List getPaddingList(IPropertyColumn[] columnsList, boolean selectionActive)
{
List result = new ArrayList();
for (int i = 0; i < columnsList.length; ++i)
{
String[] padding = null;
try
{
padding = PropertyColumnRenderer.getPropertyColumnArrayPadding(columnsList<i>, selectionActive);
}
catch (WdfException e)
{
log.errorT("Could not parse padding for column <" + columnsList<i> + "> " + LoggingFormatter.beautify(e));
String[] paddingHulp = { "0", "0", "0", "0" };
padding = paddingHulp;
}
result.add(padding);
}
return result;
}
private static IPropertyPosition[] getPositionArray(IPropertyColumn[] columns)
{
IPropertyPosition[] result = new IPropertyPosition[columns.length];
for (int i = 0; i < columns.length; ++i)
result<i> = PropertyColumnFactory.getInstance().getPosition(columns<i>);
if (log.beDebug())
log.debugT("Calculated property position array <" + result + "> for property column array <" + columns + ">");
return result;
}
private int renderFormRow(FormLayout grid, int row, int column, IResource res, String classStyle, int rowHeightPercent, IPropertyNameList propertynamelist, IPropertyPosition[] positions, boolean[] nextColumns, List paddings) throws WcmException
{
s_profiler.start("/KM/FLEXUI/RENDER/UI/ROW ", IProfiler.Level.MEDIUM);
try
{
boolean emptyRow = true;
try
{
Vector nextLine = new Vector();
Vector nextLineColumn = new Vector();
Hashtable nextLineElement = new Hashtable();
FormLayoutCell cell = null;
int nextLineCol = 0;
int line = 1;
int startRow = row;
boolean selectionActive = false;
IPropertyPosition position = null;
IResourceRenderer renderer = super.getRenderer(res);
renderer.setPropertyNameList(propertynamelist);
String[] padding = null;
Component comp = new HTMLFragment(" ");
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
{
comp = super.renderItemSelectionMode(res);
cell = grid.addComponent(row, column, comp);
cell.setVerticalAlignment(VERTICAL_ALIGN);
cell.setPaddingRight("2");
cell.setPaddingLeft("3");
selectionActive = true;
++column;
}
int columnSpan = 0;
int rowSpan = 0;
IMetaName metaName = null;
for (int i = 0; i < getColumnsList().length; ++i)
{
try
{
columnSpan = 0;
position = positions<i>;
if (position != null)
{
int lineNew = position.getRow();
if (line != lineNew)
{
column = position.getColumn();
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
++column;
line = lineNew;
if (!(emptyRow))
++row;
emptyRow = true;
}
columnSpan = position.getSpanColumn();
rowSpan = position.getSpanRow();
}
comp = PropertyColumnRenderer.renderPropertyColumn(renderer, res, getColumnsList()<i>, false, super.getProxy());
emptyRow = (emptyRow) && (((comp == null) || (comp instanceof EmptyComponent)));
if (comp != null)
{
if (columnSpan != 0)
{
cell = grid.addComponent(row, column, comp);
cell.setColspan(columnSpan);
}
else
cell = grid.addComponent(row, column, comp);
if (rowSpan != 0)
{
cell.setRowspan(rowSpan);
}
cell.setVerticalAlignment(PropertyColumnFactory.getInstance().getVAlign(getColumnsList()<i>));
cell.setHorizontalAlignment(PropertyColumnFactory.getInstance().getHAlign(getColumnsList()<i>));
padding = (String[]) paddings.get(i);
if (padding != null)
{
cell.setPaddingTop(padding[0]);
cell.setPaddingRight(padding[1]);
cell.setPaddingBottom(padding[2]);
cell.setPaddingLeft(padding[3]);
}
selectionActive = false;
}
if (nextColumns<i> != false)
{
nextLineColumn = getIMetaNameTypeText(getColumnsList()<i>, column);
nextLine.addAll(nextLineColumn);
}
++column;
}
catch (WcmException wcmEx)
{
log.debugT("Could not rendere row for resource <" + res + "> & columns <" + getColumnsList()<i> + ">" + LoggingFormatter.extractCallstack(wcmEx));
if (columnSpan != 0)
{
cell = grid.addComponent(row, column, EmptyComponent.render());
cell.setColspan(columnSpan);
}
else
cell = grid.addComponent(row, column, EmptyComponent.render());
++column;
}
if (columnSpan != 0)
{
column = column + columnSpan;
}
if ((!(getColumnsList()<i>.contains("noColumnSpacing"))) && (column < this.noOfColumns))
{
cell = grid.addComponent(row, column, EmptyComponent.render());
if (!("0".equals(super.getColumnSpacing())))
{
cell.setWidth(super.getColumnSpacing());
}
++column;
}
}
boolean emptyComponent = true;
for (int k = 0; k < nextLine.size(); ++k)
{
nextLineElement = (Hashtable) nextLine.elementAt(k);
if (nextLineElement != null)
{
IPropertyWithModifiers currProp = (IPropertyWithModifiers) nextLineElement.get("metaNameModifiers");
nextLineCol = Integer.parseInt((String) nextLineElement.get("col"));
metaName = (IMetaName) nextLineElement.get("metaName");
renderer.getParameters().setParameter(IResourceRendererParameterNameConst.PROPERTY_MODIFIERS, PropertyColumnFactory.getInstance().getModifierString(currProp.getModifierList()));
comp = PropertyColumnRenderer.renderMetaProperty(renderer, metaName, false, true);
emptyComponent = false;
if ((comp != null) && (comp instanceof EmptyComponent))
emptyComponent = true;
if (!(emptyComponent))
{
if (!(emptyRow));
cell = grid.addComponent(++row, nextLineCol, comp);
cell.setColspan(column);
emptyRow = false;
}
}
}
int rowSpace = 0;
try
{
rowSpace = Integer.parseInt(super.getRowSpacing());
}
catch (NumberFormatException nfEx)
{
log.debugT("Could not get an Integer from <" + super.getRowSpacing() + ">; " + LoggingFormatter.extractCallstack(nfEx));
rowSpace = 0;
}
int endRow = row;
if (emptyRow)
endRow = row - 1;
if (rowSpace != 0)
{
String paddingStyle = String.valueOf(rowSpace);
if (startRow != endRow)
{
setHeightPercentageForm(rowHeightPercent, paddingStyle, 1, grid, startRow, this.noOfColumns);
setHeightPercentageForm(rowHeightPercent, paddingStyle, 1, grid, endRow, this.noOfColumns);
}
else
{
setHeightPercentageForm(rowHeightPercent, paddingStyle, 0, grid, endRow, this.noOfColumns);
}
}
if (!("".equals(classStyle)))
{
setClassStyleForm(classStyle, grid, startRow, row, this.noOfColumns);
}
}
catch (Exception e)
{
throw new WcmException(e);
}
if (!(emptyRow))
++row;
}
finally
{
s_profiler.stop("/KM/FLEXUI/RENDER/UI/ROW ");
}
return row;
}
private void setHeightPercentageForm(int rowHeightPercent, String padding, int paddingStyle, FormLayout grid, int row, int col)
{
FormLayoutCell cell = null;
FormLayoutRow rows = grid.getRow(row);
for (int j = 1; j <= col; ++j)
{
cell = rows.getCell(j);
if (cell != null)
{
if (rowHeightPercent != 0)
cell.setWidth(""";height="" + String.valueOf(rowHeightPercent) + "%"");
if (paddingStyle == 1)
cell.setPaddingTop(padding);
else if (paddingStyle == -1)
cell.setPaddingBottom(padding);
else
{
cell.setPaddingTop(padding);
cell.setPaddingBottom(padding);
}
}
}
}
private void setClassStyleForm(String classStyle, FormLayout grid, int startRow, int endRow, int col)
{
FormLayoutCell cell = null;
FormLayoutRow currentRow = null;
int rowSpan = 0;
int noCol = col;
boolean hasRowSpan = false;
for (int i = startRow; i <= endRow; ++i)
{
currentRow = grid.getRow(i);
if (currentRow != null)
{
if (hasRowSpan)
{
noCol = col - 1;
hasRowSpan = --rowSpan > 0;
}
else
noCol = col;
for (int j = 1; j <= noCol; ++j)
{
cell = currentRow.getCell(j);
if ((cell != null) && (cell.getRowspan() > 1))
{
hasRowSpan = true;
rowSpan = cell.getRowspan() - 1;
}
if (cell != null)
cell.setStyle(classStyle);
else
{
cell = grid.addComponent(i, j, EmptyComponent.render());
cell.setStyle(classStyle);
}
}
}
}
}
public HeaderItem[][] genetateMatrixHeader() throws WcmException
{
if (super.isExactlyValue(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "off"))
{
return null;
}
IPropertyPosition position = null;
IPropertyColumn[] iterColumns = getColumnsList();
boolean existsResource = super.getResourceList().size() != 0;
if (!(existsResource))
{
return null;
}
HeaderItem[][] headerMatrix = new HeaderItem[10][20];
int currentRow = 0;
int currentColumn = 0;
int currentRowSpan = 0;
int currentColumnSpan = 0;
int nextCol = 0;
int maxRow = 0;
int maxCol = 0;
boolean is508Required = false;
try
{
is508Required = super.getProxy().getDynamicPage().getPageContext().requiresSection508Rendering();
}
catch (Exception ex)
{
log.errorT("Could not retrieve 508 mode for proxy <" + super.getProxy() + ">: " + LoggingFormatter.extractCallstack(ex));
}
IMetaName metaName = null;
for (int i = 0;(i < iterColumns.length) && (existsResource); ++i)
{
if (iterColumns<i> != null)
{
position = PropertyColumnFactory.getInstance().getPosition(iterColumns<i>);
if (position != null)
{
if (currentRow != position.getRow() - 1)
nextCol = 0;
currentRow = position.getRow() - 1;
currentColumn = position.getColumn() - 1 + nextCol;
currentRowSpan = position.getSpanRow();
currentColumnSpan = position.getSpanColumn();
}
else
{
currentRowSpan = 0;
currentColumnSpan = 0;
}
}
metaName = PropertyHeaderRenderer.getMetaNameForTitle(iterColumns<i>, is508Required);
if (metaName != null)
{
headerMatrix[currentRow][currentColumn] = new HeaderItem(this, currentRowSpan, currentColumnSpan, metaName, iterColumns<i>);
nextCol = 1;
maxRow = (maxRow > currentRow) ? maxRow : currentRow;
maxCol = (maxCol > currentColumn) ? maxCol : currentColumn;
}
++currentColumn;
if (currentColumnSpan != 0)
currentColumn = currentColumn + currentColumnSpan;
if (!(iterColumns<i>.contains("noColumnSpacing")))
++currentColumn;
}
++maxRow;
++maxCol;
if ((maxRow > 0) || (maxCol > 0))
{
HeaderItem[][] resultMatrix = new HeaderItem[maxRow][maxCol];
for (int i = 0; i < maxRow; ++i)
for (int k = 0; k < maxCol; ++k)
resultMatrix<i>[k] = headerMatrix<i>[k];
return resultMatrix;
}
return null;
}
public int renderListHeader1(FormLayout grid, int row) throws WcmException
{
if (super.isExactlyValue(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "off"))
return row;
HeaderItem[][] header = genetateMatrixHeader();
if (header == null)
{
return row;
}
String propertyHeaderColumnStyle = super.getParameters().getParameter(ICollectionRendererParameterNameConst.PROPERTY_COLUMN_HEADER_STYLE, "Table Title Color");
String headerClassStyle = HtmlRendererUtil.getHeaderClassStyle(propertyHeaderColumnStyle);
if (headerClassStyle == null)
{
headerClassStyle = "";
}
FormLayoutCell cell = null;
int columnSpan = 0;
int column = 1;
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
{
++column;
}
int startRow = row;
HeaderItem headerItem = null;
PropertyHeaderRenderer sortHeader = new PropertyHeaderRenderer(super.getProxy(), this, super.getBundleHandler(), getChildCountMetaName(super.getParentCollection()), this.isManualOrdered, super.getIRS().getSortDefintion(), super.getResourceContext().getLocale());
IMetaName metaName = null;
int colHeader = 0;
for (int i = 0; i < header.length; ++i)
{
row = row + i;
if (!(super.getParameters().getParameter(ICollectionRendererParameterNameConst.ITEMSELECTIONMODE, "multiple").equals("off")))
colHeader = 1;
else
{
colHeader = 0;
}
for (int k = 0; k < header[0].length; ++k)
{
headerItem = header<i>[k];
if (headerItem != null)
{
boolean is508Required = false;
try
{
is508Required = super.getProxy().getDynamicPage().getPageContext().requiresSection508Rendering();
}
catch (Exception ex)
{
log.errorT("Could not retrieve 508 mode for proxy <" + super.getProxy() + ">: " + LoggingFormatter.extractCallstack(ex));
}
metaName = headerItem.getLabelMetaName();
if (headerItem.getColSpan() != 0)
{
cell = grid.addComponent(row, k + colHeader + 1, sortHeader.createSortLink(metaName));
cell.setColspan(headerItem.getColSpan());
}
else
{
cell = grid.addComponent(row, k + colHeader + 1, sortHeader.createSortLink(metaName));
}
String[] padding = HtmlRendererUtil.getPropertyPaddingValues(headerItem.getPropertyColumn(), metaName);
cell.setHorizontalAlignment(PropertyColumnFactory.getInstance().getHAlign(headerItem.getPropertyColumn()));
cell.setVerticalAlignment(PropertyColumnFactory.getInstance().getVAlign(headerItem.getPropertyColumn()));
if (padding != null)
{
cell.setPaddingTop(padding[0]);
cell.setPaddingRight(padding[1]);
cell.setPaddingBottom(padding[2]);
cell.setPaddingLeft(padding[3]);
}
if (columnSpan != 0)
colHeader = colHeader + columnSpan;
}
}
}
setClassStyleForm(headerClassStyle, grid, startRow, row, this.noOfColumns);
return (++row);
}
static {
try
{
DEFAULT_PROP_NAMES[0] = PropertyName.getPN("http://sapportals.com/xmlns/cm", "readonly");
DEFAULT_PROP_NAMES[1] = PropertyName.createCreatedBy();
DEFAULT_PROP_NAMES[2] = PropertyName.createLastModifiedBy();
}
catch (ResourceException e)
{
log.errorT("Could not set default property name" + LoggingFormatter.beautify(e));
}
}
protected class HeaderItem
{
private int rowSpan;
private int colSpan;
private IMetaName labelMetaName;
private IPropertyColumn column;
private boolean processed;
private final CollectionListRenderer mythis;
public HeaderItem(CollectionListRenderer this$0)
{
this.mythis = this$0;
this.rowSpan = 0;
this.colSpan = 0;
this.labelMetaName = null;
this.column = null;
this.processed = false;
}
public HeaderItem(CollectionListRenderer this$0, int rowSpan, int colSpan, IMetaName metaName, IPropertyColumn column)
{
this.mythis = this$0;
this.rowSpan = 0;
this.colSpan = 0;
this.labelMetaName = null;
this.column = null;
this.processed = false;
this.rowSpan = rowSpan;
this.colSpan = colSpan;
this.labelMetaName = metaName;
this.column = column;
}
public void setRowSpan(int row)
{
this.rowSpan = row;
}
public int getRowSpan()
{
return this.rowSpan;
}
public void setColSpan(int col)
{
this.colSpan = col;
}
public int getColSpan()
{
return this.colSpan;
}
public void setLabelMetaName(IMetaName column)
{
this.labelMetaName = column;
}
public IMetaName getLabelMetaName()
{
return this.labelMetaName;
}
public void setPropertyColumn(IPropertyColumn column)
{
this.column = column;
}
public IPropertyColumn getPropertyColumn()
{
return this.column;
}
public String toString()
{
return "Item: RowSpan=" + this.rowSpan + "; ColSpan=" + this.colSpan + "; PropertyColumn=" + getLabelMetaName();
}
}
}
Thanks for help!
Christof