com.hcl.domino.data.CollectionColumn Maven / Gradle / Ivy
/*
* ==========================================================================
* Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ )
* All rights reserved.
* ==========================================================================
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at .
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
* ==========================================================================
*/
package com.hcl.domino.data;
import java.util.Optional;
import java.util.Set;
import com.hcl.domino.design.CollectionDesignElement;
import com.hcl.domino.design.format.CalendarType;
import com.hcl.domino.design.format.DateComponentOrder;
import com.hcl.domino.design.format.DateShowFormat;
import com.hcl.domino.design.format.DateShowSpecial;
import com.hcl.domino.design.format.DayFormat;
import com.hcl.domino.design.format.MonthFormat;
import com.hcl.domino.design.format.NarrowViewPosition;
import com.hcl.domino.design.format.NumberDisplayFormat;
import com.hcl.domino.design.format.TileViewerPosition;
import com.hcl.domino.design.format.TimeShowFormat;
import com.hcl.domino.design.format.TimeZoneFormat;
import com.hcl.domino.design.format.ViewColumnFormat;
import com.hcl.domino.design.format.WeekFormat;
import com.hcl.domino.design.format.YearFormat;
import com.hcl.domino.richtext.records.CDResource;
public interface CollectionColumn {
interface SortConfiguration {
/**
* @return an {@link Optional} describing the UNID of the view to switch to when
* resorting, or an empty one if this is unset
*/
Optional getResortToViewUnid();
/**
* Changes the UNID of the view to switch to when resorting
*
* @param unid UNID or null
* @return this sort configuration
*/
SortConfiguration setResortToViewUnid(String unid);
int getSecondResortColumnIndex();
SortConfiguration setSecondResortColumnIndex(int idx);
boolean isCategory();
/**
* Toggles the category attribute
*
* @param b new value
* @return this instance
*/
SortConfiguration setCategory(boolean b);
boolean isDeferResortIndexing();
SortConfiguration setDeferResortIndexing(boolean b);
boolean isResortAscending();
SortConfiguration setResortAscending(boolean b);
boolean isResortDescending();
SortConfiguration setResortDescending(boolean b);
boolean isResortToView();
SortConfiguration setResortToView(boolean b);
boolean isSecondaryResort();
SortConfiguration setSecondaryResort(boolean b);
boolean isSecondaryResortDescending();
SortConfiguration setSecondaryResortDescending(boolean b);
boolean isSorted();
SortConfiguration setSorted(boolean b);
boolean isSortedDescending();
SortConfiguration setSortedDescending(boolean b);
boolean isSortPermuted();
SortConfiguration setSortPermuted(boolean b);
/**
* Determines whether sorting by this column should be case-sensitive.
*
* @return {@code true} if sorting should be case-sensitive;
* {@code false} otherwise
* @since 1.0.42
*/
boolean isCaseSensitive();
SortConfiguration setCaseSensitive(boolean b);
/**
* Determines whether sorting by this column should be accent-sensitive.
*
* @return {@code true} if sorting should be accent-sensitive;
* {@code false} otherwise
* @since 1.0.42
*/
boolean isAccentSensitive();
SortConfiguration setAccentSensitive(boolean b);
/**
* Determines whether categories in this column should be flat in Notes V5 and later.
*
* @return {@code true} if categories should be flat when supported;
* {@code false} otherwise
* @since 1.0.42
*/
boolean isCategorizationFlat();
SortConfiguration setCategorizationFlat(boolean b);
/**
* Determines whether sorting in this column should ignore common linguistic prefixes,
* e.g. "the" in English.
*
* @return {@code true} if sorting should ignore prefixes;
* {@code false} otherwise
* @since 1.0.42
*/
boolean isIgnorePrefixes();
SortConfiguration setIgnorePrefixes(boolean b);
}
/**
* Represents the formatting options for this column when it contains a numeric
* value.
*
* @author Jesse Gallagher
* @since 1.0.32
*/
interface NumberSettings {
/**
* Retrieves the format used to display numerical values.
*
* @return a {@link NumberDisplayFormat} instance
*/
NumberDisplayFormat getFormat();
NumberSettings setFormat(NumberDisplayFormat format);
/**
* Determines whether the column should display numbers with varying decimal
* places instead of using the value from {@link #getFixedDecimalPlaces()}.
*
* @return {@code true} if number values should be displayed with varying decimal
* places; {@code false} otherwise
*/
boolean isVaryingDecimal();
NumberSettings setVaryingDecimal(boolean b);
/**
* Retrieves the number of places to display for decimal values when appropriate
* and {@link #isVaryingDecimal()} is {@code false}.
*
* @return the fixed decimal length
*/
int getFixedDecimalPlaces();
NumberSettings setFixedDecimalPlaces(int b);
/**
* Determines whether numbers should be displayed with custom symbols defined here
* instead of what the client has configured.
*
* @return {@code true} if column settings for symbols and separators should
* override client settings; {@code false} otherwise
*/
boolean isOverrideClientLocale();
NumberSettings setOverrideClientLocale(boolean b);
/**
* Retrieves the decimal symbol to use when {@link #isOverrideClientLocale()} is
* {@code true}.
*
* @return the column-specific decimal symbol
*/
String getDecimalSymbol();
NumberSettings setDecimalSymbol(String s);
/**
* Retrieves the thousands separator to use when {@link #isOverrideClientLocale()}
* is {@code true}.
*
* @return the column-specific thousands separator
*/
String getThousandsSeparator();
NumberSettings setThousandsSeparator(String s);
/**
* Determines whether negative values in this column should be displayed with
* parentheses when negative instead of with a negation symbol.
*
* @return {@code true} to use parentheses around negative values;
* {@code false} to use the default behavior
*/
boolean isUseParenthesesWhenNegative();
NumberSettings setUseParenthesesWhenNegative(boolean b);
/**
* Determines whether thousands groups should be punctuated when displayed.
*
* @return {@code true} to add punctuation for displayed thousands;
* {@code false} to use the default behavior
*/
boolean isPunctuateThousands();
NumberSettings setPunctuateThousands(boolean b);
/**
* Retrieves the ISO code for currency values in this column to use when
* {@link #getFormat()} is {@link NumberDisplayFormat#CURRENCY CURRENCY} and
* {@link #isOverrideClientLocale()} is {@code true}.
*
* @return an ISO currency code
*/
long getCurrencyIsoCode();
NumberSettings setCurrencyIsoCode(long code);
/**
* Determines whether values in the column should be displayed with a custom
* currency symbol when {@link #getFormat()} is
* {@link NumberDisplayFormat#CURRENCY CURRENCY} and
* {@link #isOverrideClientLocale()} is {@code true}.
*
* @return whether to use a custom currency symbol
*/
boolean isUseCustomCurrencySymbol();
NumberSettings setUseCustomCurrencySymbol(boolean b);
/**
* Retrieves the currency symbol to use when {@link #getFormat()} is
* {@link NumberDisplayFormat#CURRENCY CURRENCY},
* {@link #isOverrideClientLocale()} is {@code true}, and
* {@link #isUseCustomCurrencySymbol()} is {@code true}.
*
* @return the column-specific currency symbol
*/
String getCurrencySymbol();
NumberSettings setCurrencySymbol(String s);
/**
* Determines whether the currency symbol specified in {@link #getCurrencySymbol()}
* should be appended to the end of the number instead of affixed to the start.
*
* @return {@code true} if the currency symbol in use should be postfixed;
* {@code false} otherwise
*/
boolean isCurrencySymbolPostfix();
NumberSettings setCurrencySymbolPostfix(boolean b);
/**
* Determines whether the currency display should use a space in between the number
* and the currency symbol.
*
* @return {@code true} if currency display should include a space next to the number;
* {@code false} otherwise
*/
boolean isUseSpaceNextToNumber();
NumberSettings setUseSpaceNextToNumber(boolean b);
}
/**
* Represents the formatting options for this column when it contains a date/time
* value.
*
* @author Jesse Gallagher
* @since 1.0.32
*/
interface DateTimeSettings {
/**
* Determines whether dates and times should be displayed with custom symbols
* defined here instead of what the client has configured.
*
* @return {@code true} if column settings for dates and times should
* override client settings; {@code false} otherwise
*/
boolean isOverrideClientLocale();
/**
* Determines whether dates, when shown, should be displayed in abbreviated format.
*
* This setting overrides all other date/time settings.
*
* @return {@code true} if dates should be shown in abbreviated format;
* {@code false} otherwise
*/
boolean isDisplayAbbreviatedDate();
/**
* Determines whether the date portion of a date/time value should be displayed.
*
* @return {@code true} if date portions of date/time values should be displayed;
* {@code false} otherwise
*/
boolean isDisplayDate();
/**
* Determines which components of a date value should be shown when {@link #isDisplayDate()}
* is {@code true}.
*
* @return a {@link DateShowFormat} instance
*/
DateShowFormat getDateShowFormat();
/**
* Determines the special behaviors enabled for displaying dates when
* {@link #isDisplayDate()} is {@code true}.
*
* @return a {@link Set} of {@link DateShowSpecial} instances
*/
Set getDateShowBehavior();
/**
* Determines the calendar type to use when for displaying dates when
* {@link #isDisplayDate()} is {@code true}.
*
* @return a {@link CalendarType} instance
*/
CalendarType getCalendarType();
/**
* Determines the display order of date components when {@link #isDisplayDate()}
* is {@code true}.
*
* @return a {@link DateComponentOrder} instance
*/
DateComponentOrder getDateComponentOrder();
/**
* Retrieves the first separator to use when displaying dates when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return the first date separator
*/
String getCustomDateSeparator1();
/**
* Retrieves the second separator to use when displaying dates when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return the second date separator
*/
String getCustomDateSeparator2();
/**
* Retrieves the third separator to use when displaying dates when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return the third date separator
*/
String getCustomDateSeparator3();
/**
* Retrieves the day format to use when when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return a {@link DayFormat} instance
*/
DayFormat getDayFormat();
/**
* Retrieves the month format to use when when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return a {@link MonthFormat} instance
*/
MonthFormat getMonthFormat();
/**
* Retrieves the year format to use when when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return a {@link YearFormat} instance
*/
YearFormat getYearFormat();
/**
* Retrieves the weekday format to use when when {@link #isDisplayDate()}
* and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return a {@link WeekFormat} instance
*/
WeekFormat getWeekdayFormat();
/**
* Determines whether the time portion of a date/time value should be displayed.
*
* @return {@code true} if time portions of date/time values should be displayed;
* {@code false} otherwise
*/
boolean isDisplayTime();
/**
* Determines which components of a time value should be shown when {@link #isDisplayTime()}
* is {@code true}.
*
* @return a {@link TimeShowFormat} instance
*/
TimeShowFormat getTimeShowFormat();
/**
* Determines the format for displaying the time zone or adjusting the time to local when
* {@link #isDisplayTime()} is {@code true}.
*
* @return a {@link TimeZoneFormat} instance
*/
TimeZoneFormat getTimeZoneFormat();
/**
* Determines whether time values should be shown in 24-hour format regardless of the user's
* locale when {@link #isDisplayTime()} and {@link #isOverrideClientLocale()} are {@code true}.
*
* @return {@code true} if times should be shown in 24-hour format;
* {@code false} otherwise
*/
boolean isTime24HourFormat();
/**
* Retrieves the separator to use when displaying times when {@link #isDisplayTime()} and
* {@link #isOverrideClientLocale()} are {@code true}.
*
* @return the time separator
*/
String getCustomTimeSeparator();
}
/**
* Represents the formatting options for this column when it contains a name
* value.
*
* @author Jesse Gallagher
* @since 1.0.32
*/
interface NamesSettings {
/**
* Determines whether text values in the column should be treated as names.
*
* @return {@code true} if column text values should be considered names;
* {@code false} otherwise
*/
boolean isNamesValue();
/**
* Determines whether the column should display online-presence information
* when available.
*
* @return {@code true} if available online-presence information should be displayed;
* {@code false} otherwise
*/
boolean isShowOnlineStatus();
/**
* Retrieves the item name of the column that contains the online-presence
* name, if not this one.
*
* @return an {@link Optional} describing the item name of the column containing
* the online-presence name, or an empty one if this is not specified
*/
Optional getNameColumnName();
/**
* Retrieves the orientation of the online-presence icon when {@link #isShowOnlineStatus()}
* is {@code true}.
*
* @return an {@link OnlinePresenceOrientation} instance
*/
OnlinePresenceOrientation getPresenceIconOrientation();
}
/**
* Represents display options for this column when it is displayed within a
* Composite Application.
*
* @author Jesse Gallagher
* @since 1.0.32
*/
interface CompositeApplicationSettings {
/**
* Retrieves the positioning behavior when the view is considered narrow.
*
* @return a {@link NarrowViewPosition} instance
*/
NarrowViewPosition getNarrowViewPosition();
/**
* Determines whether the second row under this column should be justified when
* {@link #getNarrowViewPosition()} is {@link NarrowViewPosition#KEEP_ON_TOP KEEP_ON_TOP}.
*
* @return {@code true} if the second row should be justified;
* {@code false} otherwise
*/
boolean isJustifySecondRow();
/**
* Retrieves the value sequence number used when {@link #getNarrowViewPosition()} is
* {@link NarrowViewPosition#WRAP WRAP} or {@link NarrowViewPosition#HIDE HIDE}.
*
* @return the sequence number for displaying column data in narrow views
*/
int getSequenceNumber();
/**
* Retrieves the positioning behavior when the view is presented in the Tile Viewer.
*
* @return a {@link TileViewerPosition} instance
*/
TileViewerPosition getTileViewerPosition();
/**
* Retrieves the column index for displaying this column when the view is presented in
* the Tile Viewer.
*
* @return the display index for Tile Viewer mode
*/
int getTileLineNumber();
/**
* Retrieves the composite property that this field is published as.
*
* @return the composite property name
*/
String getCompositeProperty();
}
enum TotalType {
None, Total, Average, AveragePerSubcategory,
PercentOfParentCategory, Percent
}
/**
* Represents the orientation of the icon for columns that display online-
* presence information.
*
* @author Jesse Gallagher
* @since 1.0.32
*/
enum OnlinePresenceOrientation {
TOP, MIDDLE, BOTTOM
}
int getColumnValuesIndex();
/**
* Retrieves the display width of this column.
*
* Note: this value reflects the storage mechanism, which differs from the
* display in Designer.
* The stored value is the count of 1/8 average character widths to go by, while
* Designer adjusts
* this by full characters. Accordingly, this value will be about 8 times larger
* than the value
* shown in Designer.
*
*
* @return the display width of this column, in units of 1/8 of the average
* character width
* @since 1.0.28
*/
int getDisplayWidth();
/**
* Sets the display width of this column.
*
* Note: this value reflects the storage mechanism, which differs from the
* display in Designer.
* The stored value is the count of 1/8 average character widths to go by, while
* Designer adjusts
* this by full characters. Accordingly, this value will be about 8 times larger
* than the value
* shown in Designer.
*
*
* @param width new width
* @return this instance
*/
CollectionColumn setDisplayWidth(int width);
/**
* Retrieves the custom attributes set on this column.
*
* @return the attributes string for the column
* @since 1.0.32
*/
String getExtraAttributes();
CollectionColumn setExtraAttributes(String attr);
String getFormula();
CollectionColumn setFormula(String formula);
/**
* Retrieves the hide-when formula for the column.
*
* Note: this formula may or may not be used; use {@link #isUseHideWhen()} to
* determine
* whether it is enabled.
*
*
* @return the hide-when formula specified for the column.
* @since 1.0.27
*/
String getHideWhenFormula();
CollectionColumn setHideWhenFormula(String formula);
String getItemName();
/**
* Changes the programmatic column name
*
* @param itemName new name
* @return this column
* @since 1.2.4
*/
CollectionColumn setItemName(String itemName);
/**
* @return the delimiter to use when displaying multiple values
* @since 1.0.27
*/
ViewColumnFormat.ListDelimiter getListDisplayDelimiter();
CollectionColumn setListDisplayDelimiter(ViewColumnFormat.ListDelimiter delimiter);
int getPosition();
/**
* @return a {@link SortConfiguration} instance representing the settings of
* this column
* @since 1.0.27
*/
SortConfiguration getSortConfiguration();
String getTitle();
CollectionColumn setTitle(String title);
/**
* @return the total-row value to compute
* @since 1.0.27
*/
TotalType getTotalType();
CollectionColumn setTotalType(TotalType type);
boolean isConstant();
/**
* Determines whether the column should be extended to use available
* window width, regardless of whether it is the last in the view or folder.
*
* @return {@code true} if this column should be extended to the window width;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isExtendToWindowWidth();
CollectionColumn setExtendToWindowWidth(boolean b);
boolean isHidden();
/**
* Determines whether the column should be hidden from mobile clients
* specifically.
*
* @return {@code true} if the column should be hidden from mobile clients;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isHiddenFromMobile();
CollectionColumn setHiddenFromMobile(boolean b);
/**
* Determines whether column should be hidden from Notes clients below
* version 6.
*
* @return {@code true} if the column should be hidden from pre-V6 clients;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isHiddenInPreV6();
CollectionColumn setHiddenInPreV6(boolean b);
/**
* Determines whether a column's non-total rows should be hidden.
*
* @return {@code true} if a column's non-total rows should be hidden;
* {@code false} otherwise
*/
boolean isHideDetailRows();
CollectionColumn setHideDetailRows(boolean b);
/**
* Determines whether the column's values should be shown as icons, either
* as indexed values to stock icons or string names of image resources.
*
* @return {@code true} if the column's values represent icons;
* {@code false} otherwise
*/
boolean isIcon();
CollectionColumn setIcon(boolean b);
/**
* Determines whether the column should be resizable by the user in the UI.
*
* @return {@code true} if the column is user-resizable;
* {@code false} otherwise
*/
boolean isResizable();
CollectionColumn setResizable(boolean b);
/**
* Determines whether the column should be evaluated for response documents only.
*
* @return {@code true} if this column should apply to response documents only;
* {@code false} otherwise
*/
boolean isResponsesOnly();
CollectionColumn setResponsesOnly(boolean b);
/**
* Determines whether this column is marked as being displayed as links when rendered
* on the web.
*
* @return {@code true} if column values should be shown as links on the web;
* {@code false} otherwise
*/
boolean isShowAsLinks();
CollectionColumn setShowAsLinks(boolean b);
boolean isShowTwistie();
CollectionColumn setShowTwistie(boolean b);
/**
* @return {@code true} if the column's hide-when formula should be used;
* {@code false} otherwise
* @since 1.0.27
*/
boolean isUseHideWhen();
CollectionColumn setUseHideWhen(boolean b);
/**
* @return {@code true} if the column is defined by a shared column;
* {@code false} otherwise
* @since 1.0.29
*/
boolean isSharedColumn();
CollectionColumn setSharedColumn(boolean b);
/**
* @return an {@link Optional} describing the name of the shared-column
* design element that defines this column, or an empty one if
* this column is not a shared column
* @since 1.0.29
*/
Optional getSharedColumnName();
CollectionColumn setSharedColumnName(String name);
/**
* @return {@code true} if this column is marked as containing a name
* value; {@code false} otherwise
* @since 1.0.29
*/
boolean isNameColumn();
CollectionColumn setNameColumn(boolean b);
/**
* @return an {@link Optional} describing the name of the column containing
* the distinguished name to use for online presence, or an empty
* one if this is not specified
* @since 1.0.29
*/
Optional getOnlinePresenceNameColumn();
CollectionColumn setOnlinePresenceNameColumn(String name);
/**
* Retrieves the image resource used for the expand/collapse twistie, if
* configured.
*
* Note: this may return a value even when the twistie is not enabled.
* Use {@link #isShowTwistie()} to determine whether this value is used.
*
* @return 1.0.32
*/
Optional getTwistieImage();
CollectionColumn setTwistieImage(CDResource res);
/**
* Convenience function that sets the twistie image to a named image
*
* @param name name of image resource
* @return this instance
*/
CollectionColumn setTwistieImageName(String name);
/**
* Removes the twistie image
*
* @return this instance
*/
public CollectionColumn clearTwistieImage();
/**
* Determines whether the column is marked as being user-editable.
*
* @return {@code true} if the column is user-editable;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isUserEditable();
CollectionColumn setUserEditable(boolean b);
/**
* Determines whether the column's values should be treated as specifying the
* color for subsequent columns.
*
* @return {@code true} if this column's values represent color;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isColor();
CollectionColumn setColor(boolean b);
/**
* Determines whether the column represents a color value definable by the user
* via a profile document.
*
* @return {@code true} if this column is a user-definable color column;
* {@code false} otherwise
* @since 1.0.32
* @see CollectionDesignElement#getColumnProfileDocName()
* @see CollectionDesignElement#getUserDefinableNonFallbackColumns()
*/
boolean isUserDefinableColor();
/**
* Determines whether the column title should be hidden even when it is specified.
*
* @return {@code true} if the column title should be hidden;
* {@code false} otherwise
* @since 1.0.32
*/
boolean isHideTitle();
CollectionColumn setHideTitle(boolean b);
/**
* Retrieves the font information for entry rows in this column.
*
* @return a {@link NotesFont} instance
* @since 1.0.32
*/
NotesFont getRowFont();
/**
* Retrieves the font information for the column header.
*
* @return a {@link NotesFont} instance
* @since 1.0.32
*/
NotesFont getHeaderFont();
/**
* Retrieves a view of the column's settings to use when displaying number
* values.
*
* @return a {@link NumberSettings} instance
* @since 1.0.32
*/
NumberSettings getNumberSettings();
/**
* Retrieves a view of the column's settings to use when displaying date/time
* values.
*
* @return a {@link DateTimeSettings} instance
* @since 1.0.32
*/
DateTimeSettings getDateTimeSettings();
/**
* Retrieves a view of the column's settings to use when displaying names
* values.
*
* @return a {@link NamesSettings} instance
* @since 1.0.32
*/
NamesSettings getNamesSettings();
/**
* Retrieves a view of the column's settings to use when the view is displayed
* in a Composite Application.
*
* @return a {@link CompositeApplicationSettings} instance
* @since 1.0.32
*/
CompositeApplicationSettings getCompositeApplicationSettings();
/**
* Copies the format of the specified column
*
* @param otherCol column to copy column format
* @return this instance
* @since 1.5.7
*/
CollectionColumn copyColumnFormatFrom(CollectionColumn otherCol);
}