Package org.jasig.portal.utils

Examples of org.jasig.portal.utils.TableFormatter


        addDataTypes(portalDataTypes, exportPortalDataTypes, Operations.EXPORT);
       
        final Iterable<IPortalDataType> deletePortalDataTypes = dataHandlerService.getDeletePortalDataTypes();
        addDataTypes(portalDataTypes, deletePortalDataTypes, Operations.DELETE);
       
        final TableFormatter tableFormatter = new TableFormatter(
                new TableEntry<String>("Data Type", "-", "s"),
                new TableEntry<String>("Export", "-", "s"),
                new TableEntry<String>("Delete", "-", "s"));
               
        for (final Map.Entry<String, Set<Operations>> portalDataTypeEntry : portalDataTypes.entrySet()) {
            final String typeId = portalDataTypeEntry.getKey();
            final Set<Operations> ops = portalDataTypeEntry.getValue();
            tableFormatter.addRow(
                new TableEntry<String>(typeId, "-", "s"),
                new TableEntry<Boolean>(ops.contains(Operations.EXPORT), "-", "b"),
                new TableEntry<Boolean>(ops.contains(Operations.DELETE), "-", "b"));
        }
       
        tableFormatter.format(f);
    }
View Full Code Here


    }
   
    public static void format(Iterable<? extends IPortalData> data, Logger l) {
        final Formatter f = new Formatter(new AppendableLogger(l, LogLevel.INFO));
       
        final TableFormatter tableFormatter = new TableFormatter(
                new TableEntry<String>("sysid", "-", "s"),
                new TableEntry<String>("Description", "-", "s"));
       
        for (final IPortalData it : data) {
            final String dataId = it.getDataId();
           
            String dataTitle = it.getDataTitle();
            if (dataTitle == null || dataTitle.equals(dataId)) {
                dataTitle = "";
            }

            tableFormatter.addRow(
                    new TableEntry<String>(dataId, "-", "s"),
                    new TableEntry<String>(dataTitle, "-", "s"));
        }
       
        tableFormatter.format(f);
       
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.utils.TableFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.