Class WebComponentUtil

java.lang.Object
com.evolveum.midpoint.gui.api.util.WebComponentUtil

public final class WebComponentUtil extends Object
Utility class containing miscellaneous methods used mostly in Wicket components.
Author:
lazyman
  • Constructor Details

    • WebComponentUtil

      public WebComponentUtil()
  • Method Details

    • restartOnLoginPageException

      public static org.apache.wicket.RestartResponseException restartOnLoginPageException()
    • setTaskStateBeforeSave

      public static void setTaskStateBeforeSave(PrismObjectWrapper<TaskType> taskWrapper, boolean runEnabled, PageBase pageBase, org.apache.wicket.ajax.AjaxRequestTarget target)
    • createLocalizedModelForBoolean

      public static org.apache.wicket.model.IModel<String> createLocalizedModelForBoolean(Boolean object)
    • sortObjectTypeList

      public static void sortObjectTypeList(List<QName> availableValues)
    • nl2br

      public static String nl2br(String text)
    • getTypeLocalized

      public static String getTypeLocalized(ObjectReferenceType ref)
    • getReferencedObjectNames

      public static String getReferencedObjectNames(List<ObjectReferenceType> refs, boolean showTypes)
    • getReferencedObjectNames

      public static String getReferencedObjectNames(List<ObjectReferenceType> refs, boolean showTypes, boolean translate)
    • getReferencedObjectDisplayNameAndName

      public static String getReferencedObjectDisplayNameAndName(Referencable ref, boolean loadObject, PageBase pageBase)
    • getReferencedObjectDisplayNamesAndNames

      public static String getReferencedObjectDisplayNamesAndNames(List<ObjectReferenceType> refs, boolean showTypes)
    • getReferencedObjectDisplayNamesAndNames

      public static String getReferencedObjectDisplayNamesAndNames(Referencable ref, boolean showTypes)
    • getReferencedObjectDisplayNamesAndNames

      public static String getReferencedObjectDisplayNamesAndNames(Referencable ref, boolean showTypes, boolean translate)
    • loadReferencedObjectList

      public static <O extends ObjectType> List<O> loadReferencedObjectList(List<ObjectReferenceType> refList, String operation, PageAdminLTE pageBase)
    • loadReferencedObjectList

      public static <O extends ObjectType> List<O> loadReferencedObjectList(List<ObjectReferenceType> refList, String operation, com.evolveum.midpoint.task.api.Task task, PageAdminLTE pageBase)
    • addAjaxOnUpdateBehavior

      public static void addAjaxOnUpdateBehavior(org.apache.wicket.markup.html.WebMarkupContainer container)
    • resolveLocalizableMessage

      public static String resolveLocalizableMessage(LocalizableMessage localizableMessage, org.apache.wicket.Component component)
    • getAuthorizationActionForTargetClass

      @Nullable public static @Nullable String getAuthorizationActionForTargetClass(Class targetClass)
    • safeResultCleanup

      public static void safeResultCleanup(OperationResult result, Trace logger)
    • getDefaultGuiObjectListType

      @Deprecated public static CompiledObjectCollectionView getDefaultGuiObjectListType(PageBase pageBase)
      Deprecated.
      Default list view setting should never be needed. Always check setting for specific object type (and archetype).
    • getRangeValidator

      public static DateValidator getRangeValidator(org.apache.wicket.markup.html.form.Form<?> form, ItemPath path)
    • isItemVisible

      public static boolean isItemVisible(List<ItemPath> visibleItems, ItemPath itemToBeFound)
    • qnameToClass

      public static Class<?> qnameToClass(QName type)
    • qnameToClass

      public static <T extends ObjectType> Class<T> qnameToClass(QName type, Class<T> returnType)
    • classToQName

      public static <T extends ObjectType> QName classToQName(PrismContext prismContext, Class<T> clazz)
    • classToQName

      public static <T extends ObjectType> QName classToQName(Class<T> clazz)
    • containerClassToQName

      public static <T extends Containerable> QName containerClassToQName(PrismContext prismContext, Class<T> clazz)
    • anyClassToQName

      public static QName anyClassToQName(PrismContext prismContext, Class<?> clazz)
    • qnameToAnyClass

      public static Class<? extends Serializable> qnameToAnyClass(PrismContext prismContext, QName qName)
    • qnameToContainerClass

      public static <C extends Containerable> Class<C> qnameToContainerClass(PrismContext prismContext, QName type)
    • canSuspendTask

      public static boolean canSuspendTask(TaskType task, PageBase pageBase)
    • canResumeTask

      public static boolean canResumeTask(TaskType task, PageBase pageBase)
    • canRunNowTask

      public static boolean canRunNowTask(TaskType task, PageBase pageBase)
    • isRunnableTask

      public static boolean isRunnableTask(TaskType task)
      Checks user-visible state, not the technical (scheduling) state. So RUNNABLE means the task is not actually running.
    • isRunningTask

      public static boolean isRunningTask(TaskType task)
    • isWaitingTask

      public static boolean isWaitingTask(TaskType task)
      Checks user-visible state, not the technical (scheduling) state.
    • isSuspendedTask

      public static boolean isSuspendedTask(TaskType task)
      Checks user-visible state, not the technical (scheduling) state.
    • isClosedTask

      public static boolean isClosedTask(TaskType task)
      Checks user-visible state, not the technical (scheduling) state. But for closed tasks, these are equivalent.
    • isRecurringTask

      public static boolean isRecurringTask(TaskType task)
    • isReconciliation

      public static boolean isReconciliation(TaskType task)
    • isRecomputation

      public static boolean isRecomputation(TaskType task)
    • isReport

      public static boolean isReport(TaskType task)
    • isImport

      public static boolean isImport(TaskType task)
    • isLiveSync

      public static boolean isLiveSync(TaskType task)
    • isAuthorized

      public static boolean isAuthorized(String... action)
    • isAuthorized

      public static boolean isAuthorized(Collection<String> actions)
    • isAuthorized

      public static boolean isAuthorized(Class<? extends ObjectType> clazz)
    • isAuthorizedForPage

      public static boolean isAuthorizedForPage(Class<? extends PageBase> detailsPage)
    • isCertItemsMenusEnabled

      public static boolean isCertItemsMenusEnabled(ModelServiceLocator serviceLocator)
    • safeLongToInteger

      public static Integer safeLongToInteger(Long l)
    • createSupportedTargetTypeList

      public static List<QName> createSupportedTargetTypeList(QName targetTypeFromDef)
    • resolveObjectTypesToQNames

      public static <O extends ObjectType> List<QName> resolveObjectTypesToQNames(Collection<Class<? extends O>> types, PrismContext prismContext)
      Takes a collection of object types (classes) that may contain abstract types. Returns a collection that only contain concrete types.
      Type Parameters:
      O - common supertype for all the types in the collections

      TODO: move to schema component

    • createEnumResourceKey

      @Deprecated public static <T extends Enum> String createEnumResourceKey(T value)
    • createLocalizedModelForEnum

      public static <T extends Enum> org.apache.wicket.model.IModel<String> createLocalizedModelForEnum(T value, org.apache.wicket.Component comp)
    • createReadonlyModelFromEnum

      public static <T extends Enum> org.apache.wicket.model.IModel<List<T>> createReadonlyModelFromEnum(Class<T> type)
    • createSimulatedCategoryNameModel

      @Experimental public static org.apache.wicket.model.IModel<String> createSimulatedCategoryNameModel(org.apache.wicket.Component component, org.apache.wicket.model.IModel<SelectableBean<TaskType>> taskModel)
      Simulates task category using task archetype.
    • createEnumPanel

      public static <E extends Enum> DropDownChoicePanel<E> createEnumPanel(Class<E> clazz, String id, org.apache.wicket.model.IModel<E> model, org.apache.wicket.Component component)
    • createEnumPanel

      public static <E extends Enum> DropDownChoicePanel<E> createEnumPanel(Class<E> clazz, String id, org.apache.wicket.model.IModel<E> model, org.apache.wicket.Component component, boolean allowNull)
    • createEnumPanel

      public static <E extends Enum> DropDownChoicePanel<E> createEnumPanel(String id, org.apache.wicket.model.IModel<List<E>> choicesList, org.apache.wicket.model.IModel<E> model, org.apache.wicket.Component component, boolean allowNull)
    • createEnumPanel

      public static <E extends Enum> DropDownChoicePanel<E> createEnumPanel(String id, org.apache.wicket.model.IModel<List<E>> choicesList, org.apache.wicket.model.IModel<E> model, org.apache.wicket.Component component, boolean allowNull, String nullValidDisplayValue)
    • getEnumChoiceRenderer

      public static <E extends Enum<E>> org.apache.wicket.markup.html.form.IChoiceRenderer<E> getEnumChoiceRenderer(org.apache.wicket.Component component)
    • createEnumPanel

      public static DropDownChoicePanel createEnumPanel(PrismPropertyDefinition def, String id, org.apache.wicket.model.IModel model)
    • getName

      public static String getName(ObjectType object)
    • getName

      public static String getName(ObjectType object, boolean translate)
    • getEffectiveName

      public static String getEffectiveName(ObjectType object, QName propertyName)
    • getEffectiveName

      public static String getEffectiveName(ObjectType object, QName propertyName, boolean translate)
    • getEffectiveName

      public static <O extends ObjectType> String getEffectiveName(PrismObject<O> object, QName propertyName)
    • getEffectiveName

      public static <O extends ObjectType> String getEffectiveName(PrismObject<O> object, QName propertyName, boolean translate)
    • getTranslatedPolyString

      @Deprecated public static String getTranslatedPolyString(PolyStringType value)
      Deprecated.
    • getName

      public static <O extends ObjectType> String getName(ObjectReferenceType ref, PageBase pageBase, String operation)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(ObjectReferenceType ref, PageBase pageBase, String operation)
    • getDisplayNameOrName

      public static <O extends ObjectType> String getDisplayNameOrName(ObjectReferenceType ref, PageBase pageBase, String operation, boolean translate)
    • getEffectiveName

      public static String getEffectiveName(ObjectReferenceType ref, QName propertyName, PageBase pageBase, String operation)
    • getEffectiveName

      public static <O extends ObjectType> String getEffectiveName(Referencable ref, QName propertyName, PageBase pageBase, String operation, boolean translate)
    • getName

      public static String getName(ObjectReferenceType ref)
    • getName

      public static String getName(Referencable ref)
    • getName

      public static String getName(Referencable ref, boolean translate)
    • getName

      public static String getName(PrismObject object)
    • getName

      public static String getName(PrismObject object, boolean translate)
    • combineDisplay

      public static DisplayType combineDisplay(DisplayType display, DisplayType variationDisplay)
    • getItemDefinitionDisplayNameOrName

      public static String getItemDefinitionDisplayNameOrName(ItemDefinition def)
    • getItemDefinitionDisplayName

      public static String getItemDefinitionDisplayName(ItemDefinition def)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(PrismObject object)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(PrismObject object, boolean translate)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(PrismObject object, boolean translate, LocalizationService localizationService)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(Referencable ref)
    • getDisplayNameOrName

      public static String getDisplayNameOrName(Referencable ref, boolean translate)
    • getDisplayNameAndName

      public static String getDisplayNameAndName(PrismObject<?> object)
    • getDisplayNameAndName

      public static String getDisplayNameAndName(ObjectReferenceType ref)
    • getDisplayName

      public static String getDisplayName(ObjectReferenceType ref)
    • getDisplayName

      public static String getDisplayName(Referencable ref, boolean translate)
    • getDisplayName

      public static String getDisplayName(PrismObject object)
    • getDisplayName

      public static String getDisplayName(PrismObject object, boolean translate)
    • getDisplayName

      public static String getDisplayName(PrismObject object, boolean translate, LocalizationService localizationService)
    • createPolyFromOrigString

      @Contract("null -> null; !null -> !null") public static PolyStringType createPolyFromOrigString(String str)
    • createPolyFromOrigString

      @Contract("null, _ -> null; !null, _ -> !null") public static PolyStringType createPolyFromOrigString(String str, String key)
    • getOrigStringFromPoly

      public static String getOrigStringFromPoly(PolyString str)
    • getOrigStringFromPoly

      public static String getOrigStringFromPoly(PolyStringType str)
    • getOrigStringFromPolyOrEmpty

      public static String getOrigStringFromPolyOrEmpty(PolyStringType str)
    • getValue

      public static <T> T getValue(PrismContainerValue object, QName propertyName, Class<T> type)
    • getContainerValue

      public static <T> T getContainerValue(PrismContainerValue object, QName containerName)
    • getValue

      public static <T> T getValue(PrismContainer object, QName propertyName, Class<T> type)
    • encryptCredentials

      public static void encryptCredentials(ObjectDelta delta, boolean encrypt, MidPointApplication app)
    • encryptCredentials

      public static void encryptCredentials(ObjectDelta delta, boolean encrypt, ModelServiceLocator serviceLocator)
    • encryptProtectedString

      public static void encryptProtectedString(ProtectedStringType string, boolean encrypt, ModelServiceLocator serviceLocator)
    • encryptCredentials

      public static void encryptCredentials(PrismObject object, boolean encrypt, MidPointApplication app)
    • encryptCredentials

      public static void encryptCredentials(PrismObject object, boolean encrypt, ModelServiceLocator serviceLocator)
    • encryptProtectedString

      public static void encryptProtectedString(ProtectedStringType string, boolean encrypt, MidPointApplication app)
    • getSelectedData

      public static <T extends Selectable> List<T> getSelectedData(Table table)
    • clearProviderCache

      public static void clearProviderCache(org.apache.wicket.markup.repeater.data.IDataProvider provider)
    • showResultInPage

      public static boolean showResultInPage(OperationResult result)
    • formatDate

      public static String formatDate(XMLGregorianCalendar calendar)
    • formatDate

      public static String formatDate(Date date)
    • formatDate

      public static String formatDate(String format, Date date)
    • getLocalizedDatePattern

      public static String getLocalizedDatePattern(String style)
    • getCurrentLocale

      public static Locale getCurrentLocale()
    • getLocalizedDate

      public static String getLocalizedDate(XMLGregorianCalendar date, String style)
    • getLocalizedDate

      public static String getLocalizedDate(Date date, String style)
    • getShortDateTimeFormattedValue

      public static String getShortDateTimeFormattedValue(XMLGregorianCalendar date, PageBase pageBase)
    • getShortDateTimeFormattedValue

      public static String getShortDateTimeFormattedValue(Date date, PageBase pageBase)
    • getLongDateTimeFormattedValue

      public static String getLongDateTimeFormattedValue(XMLGregorianCalendar date, PageBase pageBase)
    • getLongDateTimeFormattedValue

      public static String getLongDateTimeFormattedValue(Date date, PageBase pageBase)
    • getShortDateTimeFormat

      public static String getShortDateTimeFormat(PageBase pageBase)
    • getLongDateTimeFormat

      public static String getLongDateTimeFormat(PageBase pageBase)
    • isActivationEnabled

      public static Boolean isActivationEnabled(PrismObject object, ItemPath propertyName)
    • isSuccessOrHandledError

      public static boolean isSuccessOrHandledError(OperationResult result)
    • isSuccessOrHandledError

      public static boolean isSuccessOrHandledError(OperationResultType resultType)
    • isSuccessOrHandledErrorOrWarning

      public static boolean isSuccessOrHandledErrorOrWarning(OperationResult result)
    • isTemplateCategory

      public static boolean isTemplateCategory(@NotNull @NotNull ResourceType resource)
    • evaluateExpressionsInFilter

      public static ObjectFilter evaluateExpressionsInFilter(ObjectFilter objectFilter, VariablesMap variables, OperationResult result, PageBase pageBase)
    • evaluateExpressionsInFilter

      public static ObjectFilter evaluateExpressionsInFilter(ObjectFilter objectFilter, OperationResult result, PageBase pageBase)
    • refreshFeedbacks

      public static void refreshFeedbacks(org.apache.wicket.MarkupContainer component, org.apache.wicket.ajax.AjaxRequestTarget target)
    • revive

      public static void revive(LoadableModel<?> loadableModel, PrismContext prismContext) throws SchemaException
      Throws:
      SchemaException
    • reviveObject

      public static void reviveObject(Object object, PrismContext prismContext) throws SchemaException
      Throws:
      SchemaException
    • getPrismContext

      public static PrismContext getPrismContext(org.apache.wicket.Component component)
    • getChannelList

      public static List<String> getChannelList()
    • getMatchingRuleList

      public static List<QName> getMatchingRuleList()
    • createHumanReadableByteCount

      public static String createHumanReadableByteCount(long bytes)
    • setCurrentPage

      public static void setCurrentPage(Table table, ObjectPaging paging)
    • getPageBase

      public static PageBase getPageBase(org.apache.wicket.Component component)
    • getPage

      public static <P extends PageAdminLTE> P getPage(org.apache.wicket.Component component, Class<P> pageClass)
    • debugHandler

      public static String debugHandler(org.apache.wicket.request.IRequestHandler handler)
    • joinPath

      public static ItemPath joinPath(ItemPath path1, ItemPath path2)
    • getPanelIdentifierFromParams

      public static String getPanelIdentifierFromParams(org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
    • createTabPanel

      @NotNull public static @NotNull TabbedPanel<org.apache.wicket.extensions.markup.html.tabs.ITab> createTabPanel(String id, PageBase parentPage, List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs, TabbedPanel.RightSideItemProvider provider)
    • createTabPanel

      @NotNull public static @NotNull TabbedPanel<org.apache.wicket.extensions.markup.html.tabs.ITab> createTabPanel(String id, PageBase parentPage, List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs, TabbedPanel.RightSideItemProvider provider, String tabChangeParameter)
    • createHelp

      public static org.apache.wicket.Component createHelp(String id)
    • exceptionToString

      public static String exceptionToString(String message, Exception e)
    • visibleIfFalse

      public static org.apache.wicket.behavior.Behavior visibleIfFalse(NonEmptyModel<Boolean> model)
    • enabledIfFalse

      public static org.apache.wicket.behavior.Behavior enabledIfFalse(NonEmptyModel<Boolean> model)
    • getStringParameter

      public static String getStringParameter(org.apache.wicket.request.mapper.parameter.PageParameters params, String key)
    • getIntegerParameter

      public static Integer getIntegerParameter(org.apache.wicket.request.mapper.parameter.PageParameters params, String key)
    • getElementVisibility

      public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType)
    • getElementVisibility

      public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType, List<String> requiredAuthorizations)
    • createAbstractRoleConfirmationMessage

      public static <AR extends AbstractRoleType> org.apache.wicket.model.IModel<String> createAbstractRoleConfirmationMessage(String actionName, ColumnMenuAction action, MainObjectListPanel<AR> abstractRoleTable, PageBase pageBase)
    • getCollectionLabel

      public static PolyStringType getCollectionLabel(DisplayType viewDisplayType)
      Returns name of the collection suitable to be displayed in the menu or other labels. E.g. "All tasks", "Active employees".
    • saveObjectLifeCycle

      public static void saveObjectLifeCycle(@NotNull @NotNull PrismObject resource, String operation, org.apache.wicket.ajax.AjaxRequestTarget target, PageBase pageBase)
    • saveLifeCycleStateOnPath

      public static void saveLifeCycleStateOnPath(@NotNull @NotNull PrismObject resource, ItemPath pathToProperty, org.apache.wicket.ajax.AjaxRequestTarget target, com.evolveum.midpoint.task.api.Task task, OperationResult parentResult, PageBase pageBase)
    • prepareAutoCompleteList

      public static List<String> prepareAutoCompleteList(LookupTableType lookupTable, String input)
    • createTriStateCombo

      public static org.apache.wicket.markup.html.form.DropDownChoice<Boolean> createTriStateCombo(String id, org.apache.wicket.model.IModel<Boolean> model)
    • isAllNulls

      public static boolean isAllNulls(Iterable<?> array)
    • getPreviousPageClass

      public static Class<?> getPreviousPageClass(PageBase parentPage)
    • createMenuItemsFromActions

      @NotNull public static @NotNull List<InlineMenuItem> createMenuItemsFromActions(@NotNull @NotNull List<GuiActionType> actions, String operation, PageBase pageBase, @NotNull @NotNull Supplier<Collection<? extends ObjectType>> selectedObjectsSupplier)
    • getAssignableRolesFilter

      public static ObjectFilter getAssignableRolesFilter(PrismObject<? extends FocusType> focusObject, Class<? extends AbstractRoleType> type, WebComponentUtil.AssignmentOrder assignmentOrder, OperationResult result, com.evolveum.midpoint.task.api.Task task, PageBase pageBase)
    • getAssignableRolesFilter

      public static ObjectFilter getAssignableRolesFilter(PrismObject<? extends FocusType> focusObject, Class<? extends AbstractRoleType> type, QName relation, WebComponentUtil.AssignmentOrder assignmentOrder, OperationResult result, com.evolveum.midpoint.task.api.Task task, PageBase pageBase)
    • getAccessibleForAssignmentObjectsFilter

      public static ObjectFilter getAccessibleForAssignmentObjectsFilter(OperationResult result, com.evolveum.midpoint.task.api.Task task, PageBase pageBase)
    • getSubmitOnEnterKeyDownBehavior

      @Deprecated public static org.apache.wicket.behavior.Behavior getSubmitOnEnterKeyDownBehavior(String submitButtonAboutAttribute)
      Deprecated.
      This seems to be just invalid piece of JS code. die() function not really defined, and there's no use of about="XXX" attribute in html for jquery to find.
    • getBlurOnEnterKeyDownBehavior

      public static org.apache.wicket.behavior.Behavior getBlurOnEnterKeyDownBehavior()
    • preventSubmitOnEnterKeyDownBehavior

      public static org.apache.wicket.behavior.Behavior preventSubmitOnEnterKeyDownBehavior()
    • getAssignableRelationsList

      public static List<QName> getAssignableRelationsList(PrismObject<? extends FocusType> focusObject, Class<? extends AbstractRoleType> type, WebComponentUtil.AssignmentOrder assignmentOrder, OperationResult result, com.evolveum.midpoint.task.api.Task task, PageBase pageBase)
    • getReferenceObjectTextValue

      public static String getReferenceObjectTextValue(ObjectReferenceType ref, PrismReferenceDefinition referenceDef, PageBase pageBase)
    • formatDurationWordsForLocal

      public static String formatDurationWordsForLocal(long durationMillis, boolean suppressLeadingZeroElements, boolean suppressTrailingZeroElements)
    • formatDurationWordsForLocal

      @Deprecated public static String formatDurationWordsForLocal(long durationMillis, boolean suppressLeadingZeroElements, boolean suppressTrailingZeroElements, org.apache.wicket.Component comp)
      Deprecated.
      uses the one without "comp" parameter
      Parameters:
      durationMillis -
      suppressLeadingZeroElements -
      suppressTrailingZeroElements -
      comp -
      Returns:
    • getArchetypeSpecification

      public static <O extends ObjectType> ArchetypePolicyType getArchetypeSpecification(PrismObject<O> object, ModelServiceLocator locator)
    • createCompositeIconForObject

      public static <O extends ObjectType> CompositedIcon createCompositeIconForObject(O obj, OperationResult result, PageBase pageBase)
    • createIconForResourceObjectType

      public static String createIconForResourceObjectType(ResourceObjectTypeDefinitionType objectType)
    • createAccountIcon

      public static CompositedIcon createAccountIcon(ShadowType shadow, PageBase pageBase, boolean isColumn)
    • getAssignmentRelationIconBuilder

      @Contract("_,_,_,null -> null") public static CompositedIconBuilder getAssignmentRelationIconBuilder(PageBase pageBase, AssignmentObjectRelation relationSpec, IconType relationIcon, IconType actionButtonIcon)
    • getIconUrlModel

      public static org.apache.wicket.model.IModel<String> getIconUrlModel(IconType icon)
    • deleteSyncTokenPerformed

      public static void deleteSyncTokenPerformed(org.apache.wicket.ajax.AjaxRequestTarget target, ResourceType resourceType, PageBase pageBase)
    • divideAssignmentRelationsByRelationValue

      public static List<AssignmentObjectRelation> divideAssignmentRelationsByRelationValue(List<AssignmentObjectRelation> initialRelationsList)
      The idea is to divide the list of AssignmentObjectRelation objects in such way that each AssignmentObjectRelation in the list will contain not more than 1 relation. This will simplify creating of a new_assignment_button on some panels
    • divideAssignmentRelationsByAllValues

      public static List<AssignmentObjectRelation> divideAssignmentRelationsByAllValues(List<AssignmentObjectRelation> initialAssignmentRelationsList)
    • divideAssignmentRelationsByAllValues

      public static List<AssignmentObjectRelation> divideAssignmentRelationsByAllValues(List<AssignmentObjectRelation> initialAssignmentRelationsList, boolean addDefaultObjectRelations)
      The idea is to divide the list of AssignmentObjectRelation objects in such way that each AssignmentObjectRelation in the list will contain not more than 1 relation, not more than 1 object type and not more than one archetype reference. This will simplify creating of a new_assignment_button
    • assignmentObjectRelationAlreadyExists

      public static boolean assignmentObjectRelationAlreadyExists(List<AssignmentObjectRelation> list, AssignmentObjectRelation relation)
      it's expected that the list of AssignmentObjectRelation will be pre-prepared in such manner that each AssignmentObjectRelation in the list will contain only one object type, one relation and one archetypeRef. This methods compares only the first items in these lists
      Parameters:
      list -
      relation -
      Returns:
    • sortDropDownChoices

      public static <T> List<T> sortDropDownChoices(org.apache.wicket.model.IModel<? extends List<? extends T>> choicesModel, org.apache.wicket.markup.html.form.IChoiceRenderer<T> renderer)
    • createVisualizationDto

      public static VisualizationDto createVisualizationDto(CaseWorkItemType caseWorkItem, PageBase pageBase, String operation)
    • computeTriggers

      public static List<EvaluatedTriggerGroupDto> computeTriggers(ApprovalContextType wfc, Integer stage)
    • createVisualizationDto

      public static VisualizationDto createVisualizationDto(CaseType caseObject, PageBase pageBase, String operation)
    • createVisualizationDtoForManualCase

      public static VisualizationDto createVisualizationDtoForManualCase(CaseType caseObject, PageBase pageBase, String operation)
    • workItemApproveActionPerformed

      public static void workItemApproveActionPerformed(org.apache.wicket.ajax.AjaxRequestTarget target, CaseWorkItemType workItem, org.apache.wicket.Component formPanel, PrismObject<UserType> powerDonor, boolean approved, OperationResult result, PageBase pageBase)
    • caseOutcomeUriToPresentation

      public static OperationResultStatusPresentationProperties caseOutcomeUriToPresentation(String outcome)
    • caseOutcomeUriToIcon

      public static ApprovalOutcomeIcon caseOutcomeUriToIcon(String outcome)
    • createMetadataOrdering

      public static List<ObjectOrdering> createMetadataOrdering(org.apache.wicket.extensions.markup.html.repeater.util.SortParam<String> sortParam, String metadataProperty, PrismContext prismContext)
    • claimWorkItemActionPerformed

      public static void claimWorkItemActionPerformed(CaseWorkItemType workItemToClaim, String operation, org.apache.wicket.ajax.AjaxRequestTarget target, PageBase pageBase)
    • releaseWorkItemActionPerformed

      public static void releaseWorkItemActionPerformed(CaseWorkItemType workItemToClaim, String operation, org.apache.wicket.ajax.AjaxRequestTarget target, PageBase pageBase)
    • assumePowerOfAttorneyIfRequested

      public static void assumePowerOfAttorneyIfRequested(OperationResult result, PrismObject<UserType> powerDonor, PageBase pageBase)
    • dropPowerOfAttorneyIfRequested

      public static void dropPowerOfAttorneyIfRequested(OperationResult result, PrismObject<UserType> powerDonor, PageBase pageBase)
    • runUnderPowerOfAttorneyIfNeeded

      public static <T> T runUnderPowerOfAttorneyIfNeeded(CheckedProducer<T> producer, PrismObject<? extends FocusType> powerDonor, PageBase pageBase, com.evolveum.midpoint.task.api.Task task, OperationResult result) throws CommonException
      Throws:
      CommonException
    • computeChangesCategorizationList

      @NotNull public static @NotNull List<VisualizationDto> computeChangesCategorizationList(com.evolveum.midpoint.wf.api.ChangesByState changesByState, ObjectReferenceType objectRef, ModelInteractionService modelInteractionService, PrismContext prismContext, com.evolveum.midpoint.task.api.Task opTask, OperationResult thisOpResult) throws SchemaException, ExpressionEvaluationException
      Throws:
      SchemaException
      ExpressionEvaluationException
    • getMidpointCustomSystemName

      public static String getMidpointCustomSystemName(PageAdminLTE pageBase, String defaultSystemNameKey)
    • getObjectListPageStorageKey

      public static String getObjectListPageStorageKey(String additionalKeyValue)
    • getObjectFromAddDeltaForCase

      public static AssignmentHolderType getObjectFromAddDeltaForCase(CaseType aCase)
    • getPendingObjectFromAddCase

      public static <O extends ObjectType> PrismObject<O> getPendingObjectFromAddCase(CaseType aCase, Class<O> expectedType, String expectedOid)
      Resolves and validates a pending object from an ADD-related case.
      Returns:
      the matching object, or null if it cannot be resolved
    • isResourceRelatedTask

      public static boolean isResourceRelatedTask(TaskType task)
    • isRefreshEnabled

      public static boolean isRefreshEnabled(PageBase pageBase, QName type)
    • xgc2long

      public static Long xgc2long(XMLGregorianCalendar gc)
    • getSimpleChannel

      public static String getSimpleChannel(String chanelUri)
    • getIntentsForKind

      public static Collection<String> getIntentsForKind(PrismObject<ResourceType> resource, ShadowKindType kind)
    • resolveSelfPage

      public static Class<? extends PageBase> resolveSelfPage()
    • findLookupTable

      public static <I extends Item<?, ?>> PrismObject<LookupTableType> findLookupTable(ItemDefinition<I> definition, PageBase page)
    • findLookupTable

      public static PrismObject<LookupTableType> findLookupTable(PrismReferenceValue valueEnumerationRef, PageBase page)
    • hasAnyArchetypeAssignment

      public static <AH extends AssignmentHolderType> boolean hasAnyArchetypeAssignment(AH assignmentHolder)
    • isArchetypeAssignment

      public static boolean isArchetypeAssignment(AssignmentType assignmentType)
    • isDelegationAssignment

      public static boolean isDelegationAssignment(AssignmentType assignmentType)
    • hasArchetypeAssignment

      public static <AH extends AssignmentHolderType> boolean hasArchetypeAssignment(AH assignmentHolder, String archetypeOid)
    • getLocale

      @Deprecated public static <F extends FocusType> Locale getLocale()
    • getCollator

      public static Collator getCollator()
    • createCreateReportIcon

      public static CompositedIcon createCreateReportIcon()
    • getCollectionViewByObject

      public static CompiledObjectCollectionView getCollectionViewByObject(AssignmentHolderType assignmentHolder, PageBase pageBase)
    • getPasswordCredentialsPolicy

      public static CredentialsPolicyType getPasswordCredentialsPolicy(PrismObject<? extends FocusType> focus, PageAdminLTE parentPage, com.evolveum.midpoint.task.api.Task task)
    • getPasswordValuePolicy

      public static ValuePolicyType getPasswordValuePolicy(CredentialsPolicyType credentialsPolicy, String operation, PageAdminLTE parentPage)
    • getTimestampAsLong

      @Contract("_,true->!null") public static Long getTimestampAsLong(XMLGregorianCalendar cal, boolean currentIfNull)
    • getTaskProgressDescription

      public static String getTaskProgressDescription(TaskInformation taskInformation, boolean longForm, PageBase pageBase)
    • getAllowedValues

      public static List<DisplayableValue<?>> getAllowedValues(SearchFilterParameterType parameter, ModelServiceLocator modelServiceLocator)
    • getAllowedValues

      public static List<DisplayableValue<?>> getAllowedValues(ExpressionType expression, ModelServiceLocator modelServiceLocator)
    • getCollectionNameParameterValueAsString

      public static String getCollectionNameParameterValueAsString(PageBase pageBase)
    • getCollectionNameParameterValue

      public static org.apache.wicket.util.string.StringValue getCollectionNameParameterValue(PageAdminLTE parentPage)
    • getPrincipalUserObjectListView

      public static <C extends Containerable> GuiObjectListViewType getPrincipalUserObjectListView(PageAdminLTE parentPage, FocusType principalFocus, @NotNull @NotNull Class<C> viewType, boolean createIfNotExist, String defaultIdentifier)
    • createDropDownChoices

      public static <T> DropDownChoicePanel createDropDownChoices(String id, org.apache.wicket.model.IModel<DisplayableValue<T>> model, org.apache.wicket.model.IModel<List<DisplayableValue<T>>> choices, boolean allowNull)
    • createMainButtonLayerIcon

      public static Map<IconCssStyle,IconType> createMainButtonLayerIcon(DisplayType mainButtonDisplayType)
    • addNewArchetype

      public static <T extends AssignmentHolderType> void addNewArchetype(PrismObjectWrapper<T> object, String archetypeOid, org.apache.wicket.ajax.AjaxRequestTarget target, PageBase pageBase)
    • isImportReport

      public static boolean isImportReport(ReportType report)
    • createMappingDescription

      public static org.apache.wicket.model.IModel<String> createMappingDescription(org.apache.wicket.model.IModel<PrismContainerValueWrapper<MappingType>> model)
    • createPanel

      public static <T extends ObjectType> org.apache.wicket.Component createPanel(Class<? extends org.apache.wicket.markup.html.panel.Panel> panelClass, String markupId, ObjectDetailsModels<T> objectDetailsModels, ContainerPanelConfigurationType panelConfig)
    • instantiateAction

      public static <C extends Containerable, AGA extends AbstractGuiAction<C>> AbstractGuiAction<C> instantiateAction(Class<? extends AbstractGuiAction<C>> actionClass)
    • instantiateAction

      public static <C extends Containerable> AbstractGuiAction<C> instantiateAction(Class<? extends AbstractGuiAction<C>> actionClass, GuiActionType guiActionType)
    • findResource

      public static PrismObject<ResourceType> findResource(PrismPropertyWrapper itemWrapper, PrismPropertyPanelContext panelCtx)
    • getContainerConfiguration

      public static ContainerPanelConfigurationType getContainerConfiguration(GuiObjectDetailsPageType pageConfig, String panelType)
    • getSummaryPanelSpecification

      @Deprecated public static <O extends ObjectType> SummaryPanelSpecificationType getSummaryPanelSpecification(Class<O> type, CompiledGuiProfile compiledGuiProfile)
      Deprecated.
      only for 'old' object details pages. Should be removed after only new design will be present.
    • addDisabledClassBehavior

      public static void addDisabledClassBehavior(org.apache.wicket.Component comp)
    • getCompiledGuiProfile

      public static CompiledGuiProfile getCompiledGuiProfile(org.apache.wicket.Page page)
    • getCompiledGuiProfile

      public static CompiledGuiProfile getCompiledGuiProfile()
    • createJpegPhotoResource

      public static <T extends FocusType> org.apache.wicket.request.resource.IResource createJpegPhotoResource(ObjectReferenceType ref, PageBase pageBase)
    • createJpegPhotoResource

      public static <T extends FocusType> org.apache.wicket.request.resource.IResource createJpegPhotoResource(PrismObject<T> object)
    • createJpegPhotoResource

      public static org.apache.wicket.request.resource.IResource createJpegPhotoResource(FocusType focus)
    • getMidPointSkin

      public static AdminLTESkin getMidPointSkin()
    • createToastForUpdateObject

      public static void createToastForUpdateObject(org.apache.wicket.ajax.AjaxRequestTarget target, Class<? extends ObjectType> type)
    • createToastForCreateObject

      public static void createToastForCreateObject(org.apache.wicket.ajax.AjaxRequestTarget target, Class<? extends ObjectType> type)
    • createToastForCreateObjectSubmittedForApproval

      public static void createToastForCreateObjectSubmittedForApproval(org.apache.wicket.ajax.AjaxRequestTarget target, Class<? extends ObjectType> type)
    • isOperationSubmittedForApproval

      public static boolean isOperationSubmittedForApproval(OperationResult result)
      Checks whether the operation was submitted for workflow approval. An in-progress status alone is not approval-specific. The workflow approval path additionally stores the root approval case OID in the operation result, which distinguishes it from other currently supported asynchronous operations.
    • createToastForUpdateObject

      public static void createToastForUpdateObject(org.apache.wicket.ajax.AjaxRequestTarget target, QName type)
    • createToastForCreateObject

      public static void createToastForCreateObject(org.apache.wicket.ajax.AjaxRequestTarget target, QName type)
    • getLabelForType

      public static <O extends ObjectType> String getLabelForType(Class<O> type, boolean startsWithUppercase)
    • showToastForRecordedButUnsavedChanges

      public static void showToastForRecordedButUnsavedChanges(org.apache.wicket.ajax.AjaxRequestTarget target, PrismContainerValueWrapper value)
    • showToastForRecordedButUnsavedChanges

      public static void showToastForRecordedButUnsavedChanges(org.apache.wicket.ajax.AjaxRequestTarget target, PrismPropertyWrapper property)
    • translateMessage

      @Deprecated public static String translateMessage(LocalizableMessage msg)
      Deprecated.
    • getCompiledObjectCollectionView

      public static CompiledObjectCollectionView getCompiledObjectCollectionView(GuiObjectListViewType listViewType, ContainerPanelConfigurationType config, PageBase pageBase)
    • getPath

      public static ItemPath getPath(GuiObjectColumnType column)
    • hasPopupableParent

      public static boolean hasPopupableParent(@NotNull @NotNull org.apache.wicket.Component component)
    • isEnabledExperimentalFeatures

      public static boolean isEnabledExperimentalFeatures()
    • isDarkModeEnabled

      public static boolean isDarkModeEnabled()
    • loadLookupTable

      public static LookupTableType loadLookupTable(String lookupTableOid, PageAdminLTE parentPage)
    • getArchetypeOidsListByHolderType

      public static <O extends AssignmentHolderType> List<String> getArchetypeOidsListByHolderType(Class<O> holderType, PageBase pageBase)
    • getContainerDefinitionModel

      public static <C extends Containerable> LoadableModel<PrismContainerDefinition<C>> getContainerDefinitionModel(Class<C> clazz)
    • createPhotoOrDefaultImagePanel

      public static org.apache.wicket.Component createPhotoOrDefaultImagePanel(String id, org.apache.wicket.request.resource.IResource photo, IconType defaultIcon)
    • createMarkList

      public static String createMarkList(List<ObjectReferenceType> markRefs, PageBase page)
    • createMarkList

      public static <O extends ObjectType> String createMarkList(O object, PageBase page)
    • translateTriggerUri

      public static String translateTriggerUri(String uri, ModelServiceLocator locator)
    • getLabelForItemValue

      public static String getLabelForItemValue(PrismValueWrapper valueWrapper, PageBase pageBase)