common supertype for all the types in the collections
+ *
* TODO: move to schema component
*/
public static List resolveObjectTypesToQNames(Collection> types, PrismContext prismContext) {
@@ -924,7 +916,7 @@ public static List resolveObjectTypesToQNames(Coll
return null;
}
List concreteTypes = new ArrayList<>(types.size());
- for (Class extends O> type: types) {
+ for (Class extends O> type : types) {
if (type == null || type.equals(ObjectType.class)) {
MiscUtil.addAllIfNotPresent(concreteTypes, createObjectTypeList());
} else if (type.equals(FocusType.class)) {
@@ -972,10 +964,11 @@ public static DropDownChoicePanel createEnumPanel(Class clazz,
return createEnumPanel(clazz, id, model, component, true);
}
+
public static DropDownChoicePanel createEnumPanel(Class clazz, String id,
final IModel model, final Component component, boolean allowNull) {
return createEnumPanel(clazz, id, WebComponentUtil.createReadonlyModelFromEnum(clazz),
- model, component, allowNull );
+ model, component, allowNull);
}
public static DropDownChoicePanel createEnumPanel(Class clazz, String id,
@@ -986,7 +979,7 @@ public static DropDownChoicePanel createEnumPanel(Class c
public static DropDownChoicePanel createEnumPanel(String id,
IModel> choicesList, final IModel model, final Component component, boolean allowNull, String nullValidDisplayValue) {
return new DropDownChoicePanel(id, model, choicesList, getEnumChoiceRenderer(component)
- , allowNull){
+ , allowNull) {
private static final long serialVersionUID = 1L;
@@ -998,7 +991,7 @@ protected String getNullValidDisplayValue() {
};
}
- public static IChoiceRenderer getEnumChoiceRenderer(Component component){
+ public static IChoiceRenderer getEnumChoiceRenderer(Component component) {
return new IChoiceRenderer() {
private static final long serialVersionUID = 1L;
@@ -1091,31 +1084,31 @@ public static String getEffectiveName(PrismObject obje
}
PolyString name = getValue(object, ObjectType.F_NAME, PolyString.class);
- if (name == null){
+ if (name == null) {
return null;
}
return translate ? getTranslatedPolyString(name)
: WebComponentUtil.getOrigStringFromPoly(name);
}
- public static String getTranslatedPolyString(PolyStringType value){
+ public static String getTranslatedPolyString(PolyStringType value) {
return getTranslatedPolyString(PolyString.toPolyString(value));
}
- public static String getTranslatedPolyString(PolyString value){
+ public static String getTranslatedPolyString(PolyString value) {
MidPointApplication application = MidPointApplication.get();
return getTranslatedPolyString(value, application != null ? application.getLocalizationService() : null);
}
- public static String getTranslatedPolyString(PolyString value, LocalizationService localizationService){
- if (value == null){
+ public static String getTranslatedPolyString(PolyString value, LocalizationService localizationService) {
+ if (value == null) {
return "";
}
- if (localizationService == null){
+ if (localizationService == null) {
localizationService = MidPointApplication.get().getLocalizationService();
}
String translatedValue = localizationService.translate(value, getCurrentLocale(), true);
- if (StringUtils.isNotEmpty(translatedValue)){
+ if (StringUtils.isNotEmpty(translatedValue)) {
return translatedValue;
}
return value.getOrig();
@@ -1142,13 +1135,13 @@ public static String getDisplayNameOrName(ObjectReference
}
public static String getDisplayNameOrName(ObjectReferenceType ref, PageBase pageBase,
- String operation, boolean translate) {
+ String operation, boolean translate) {
String name = getName(ref, translate);
if (StringUtils.isEmpty(name) || name.equals(ref.getOid())) {
String oid = ref.getOid();
Collection> options = SelectorOptions
.createCollection(GetOperationOptions.createNoFetch());
- Class type = ref.getType() != null ? (Class)qnameToClass(pageBase.getPrismContext(), ref.getType()) : (Class) ObjectType.class;
+ Class type = ref.getType() != null ? (Class) qnameToClass(pageBase.getPrismContext(), ref.getType()) : (Class) ObjectType.class;
PrismObject object = WebModelServiceUtils.loadObject(type, oid, pageBase,
pageBase.createSimpleTask(operation), new OperationResult(operation));
if (object != null) {
@@ -1159,11 +1152,12 @@ public static String getDisplayNameOrName(ObjectReference
}
public static String getEffectiveName(ObjectReferenceType ref, QName propertyName,
- PageBase pageBase, String operation) {
+ PageBase pageBase, String operation) {
return getEffectiveName(ref, propertyName, pageBase, operation, true);
}
+
public static String getEffectiveName(Referencable ref, QName propertyName,
- PageBase pageBase, String operation, boolean translate) {
+ PageBase pageBase, String operation, boolean translate) {
PrismObject object = WebModelServiceUtils.loadObject(ref, pageBase,
pageBase.createSimpleTask(operation), new OperationResult(operation));
@@ -1184,7 +1178,7 @@ public static String getName(Referencable ref, boolean translate) {
return null;
}
if (ref.getTargetName() != null) {
- if (translate){
+ if (translate) {
return getTranslatedPolyString(ref.getTargetName());
}
return getOrigStringFromPoly(ref.getTargetName());
@@ -1208,10 +1202,10 @@ public static String getName(PrismObject object, boolean translate, Localization
return null;
}
PolyString name = getValue(object, ObjectType.F_NAME, PolyString.class);
- if (name == null){
+ if (name == null) {
return null;
}
- if (translate){
+ if (translate) {
return getTranslatedPolyString(name, localizationService);
}
return name.getOrig();
@@ -1372,7 +1366,6 @@ public static String getDisplayName(PrismContainerValu
}
}
-
String escaped = org.apache.commons.lang.StringEscapeUtils.escapeHtml(displayName);
return escaped;
}
@@ -1393,7 +1386,6 @@ private static String getAcquisitionDescription(ProvenanceAcquisitionType acquis
return Channel.findChannel(acquisitionType.getChannel()).getResourceKey(); //TODO NPE
}
-
public static QName normalizeRelation(QName relation) {
return getRelationRegistry().normalizeRelation(relation);
}
@@ -1424,7 +1416,7 @@ public static String getDisplayNameOrName(Referencable ref, boolean translate) {
return null;
}
String displayName = getDisplayName(ref, translate);
- return StringUtils.isNotEmpty(displayName) ? displayName : getName(ref,translate);
+ return StringUtils.isNotEmpty(displayName) ? displayName : getName(ref, translate);
}
// () OR simply if there's no display name
@@ -1437,7 +1429,7 @@ public static String getDisplayName(ObjectReferenceType ref) {
}
public static String getDisplayName(Referencable ref, boolean translate) {
- if (translate){
+ if (translate) {
return getTranslatedPolyString(ObjectTypeUtil.getDisplayName(ref));
} else {
return PolyString.getOrig(ObjectTypeUtil.getDisplayName(ref));
@@ -1453,10 +1445,10 @@ public static String getDisplayName(PrismObject object, boolean translate) {
}
public static String getDisplayName(PrismObject object, boolean translate, LocalizationService localizationService) {
- if (object == null){
- return "";
+ if (object == null) {
+ return "";
}
- if (translate){
+ if (translate) {
if (localizationService == null) {
return getTranslatedPolyString(ObjectTypeUtil.getDisplayName(object));
} else {
@@ -1639,12 +1631,12 @@ public static List getSelectedData(Table table) {
return selected;
}
- public static void clearProviderCache(IDataProvider provider){
- if (provider == null){
+ public static void clearProviderCache(IDataProvider provider) {
+ if (provider == null) {
return;
}
- if (provider instanceof BaseSortableDataProvider){
- ((BaseSortableDataProvider)provider).clearCache();
+ if (provider instanceof BaseSortableDataProvider) {
+ ((BaseSortableDataProvider) provider).clearCache();
}
if (provider instanceof SelectableBeanObjectDataProvider) {
((SelectableBeanObjectDataProvider) provider).clearSelectedObjects();
@@ -1735,18 +1727,18 @@ public static String getLongDateTimeFormattedValue(Date date, PageBase pageBase)
return getLocalizedDate(date, longDateTimeFormat);
}
- public static String getShortDateTimeFormat(PageBase pageBase){
+ public static String getShortDateTimeFormat(PageBase pageBase) {
AdminGuiConfigurationDisplayFormatsType displayFormats = pageBase.getCompiledGuiProfile().getDisplayFormats();
- if (displayFormats == null || StringUtils.isEmpty(displayFormats.getShortDateTimeFormat())){
+ if (displayFormats == null || StringUtils.isEmpty(displayFormats.getShortDateTimeFormat())) {
return DateLabelComponent.SHORT_MEDIUM_STYLE;
} else {
return displayFormats.getShortDateTimeFormat();
}
}
- public static String getLongDateTimeFormat(PageBase pageBase){
+ public static String getLongDateTimeFormat(PageBase pageBase) {
AdminGuiConfigurationDisplayFormatsType displayFormats = pageBase.getCompiledGuiProfile().getDisplayFormats();
- if (displayFormats == null || StringUtils.isEmpty(displayFormats.getLongDateTimeFormat())){
+ if (displayFormats == null || StringUtils.isEmpty(displayFormats.getLongDateTimeFormat())) {
return DateLabelComponent.LONG_MEDIUM_STYLE;
} else {
return displayFormats.getLongDateTimeFormat();
@@ -1931,11 +1923,7 @@ public static boolean isOfKind(QName relation, RelationKindType kind) {
}
protected static RelationRegistry getRelationRegistry() {
- if (staticallyProvidedRelationRegistry != null) {
- return staticallyProvidedRelationRegistry;
- } else {
- return MidPointApplication.get().getRelationRegistry();
- }
+ return MidPointApplication.get().getRelationRegistry();
}
public static boolean isManagerRelation(QName relation) {
@@ -2027,15 +2015,15 @@ public static String createUserIcon(PrismObject object) {
String additionalStyle;
// getIconEnabledDisabled(object);
// if (additionalStyle == null) {
- // Set manager and end-user icon only as a last resort. All other
- // colors have priority.
- if (isManager) {
- additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_MANAGER;
- } else if (isEndUser) {
- additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_END_USER;
- } else {
- additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_NORMAL;
- }
+ // Set manager and end-user icon only as a last resort. All other
+ // colors have priority.
+ if (isManager) {
+ additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_MANAGER;
+ } else if (isEndUser) {
+ additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_END_USER;
+ } else {
+ additionalStyle = GuiStyleConstants.CLASS_ICON_STYLE_NORMAL;
+ }
// }
return GuiStyleConstants.CLASS_OBJECT_USER_ICON + " " + additionalStyle;
}
@@ -2059,7 +2047,7 @@ public static String createServiceIcon() {
return getObjectNormalIconStyle(GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON);
}
- private static String getObjectNormalIconStyle(String baseIcon){
+ private static String getObjectNormalIconStyle(String baseIcon) {
return baseIcon + " " + GuiStyleConstants.CLASS_ICON_STYLE_NORMAL;
}
@@ -2139,7 +2127,7 @@ public static String createObjectColletionIcon() {
return getObjectNormalIconStyle(GuiStyleConstants.CLASS_OBJECT_COLLECTION_ICON);
}
- public static ObjectFilter evaluateExpressionsInFilter(ObjectFilter objectFilter, OperationResult result, PageBase pageBase){
+ public static ObjectFilter evaluateExpressionsInFilter(ObjectFilter objectFilter, OperationResult result, PageBase pageBase) {
try {
ExpressionVariables variables = new ExpressionVariables();
return ExpressionUtil.evaluateFilterExpressions(objectFilter, variables, MiscSchemaUtil.getExpressionProfile(),
@@ -2147,7 +2135,7 @@ public static ObjectFilter evaluateExpressionsInFilter(ObjectFilter objectFilter
pageBase.createSimpleTask(result.getOperation()), result);
} catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | CommunicationException |
ConfigurationException | SecurityViolationException ex) {
- result.recordPartialError("Unable to evaluate filter exception, " , ex);
+ result.recordPartialError("Unable to evaluate filter exception, ", ex);
pageBase.error("Unable to evaluate filter exception, " + ex.getMessage());
}
return objectFilter;
@@ -2165,7 +2153,6 @@ public static void initNewObjectWithReference
initNewObjectWithReference(pageBase, assignmentHolder, newReferences);
}
-
public static void initNewObjectWithReference(PageBase pageBase, AHT assignmentHolder, List newReferences) throws SchemaException {
if (newReferences != null) {
newReferences.stream().forEach(ref -> {
@@ -2188,7 +2175,7 @@ public static void initNewObjectWithReference
}
public static String createErrorIcon(OperationResult result) {
- if (result == null){
+ if (result == null) {
return "";
}
OperationResultStatus status = result.getStatus();
@@ -2229,7 +2216,6 @@ public static PrismContext getPrismContext(Component component) {
return ((MidPointApplication) component.getApplication()).getPrismContext();
}
-
public static List getChannelList() {
List channels = new ArrayList<>();
@@ -2258,8 +2244,7 @@ public static List getMatchingRuleList() {
public static String createHumanReadableByteCount(long bytes) {
int unit = 1024;
- if (bytes < unit)
- return bytes + "B";
+ if (bytes < unit) { return bytes + "B"; }
int exp = (int) (Math.log(bytes) / Math.log(unit));
char pre = "KMGTPE".charAt(exp - 1);
return String.format("%.1f%sB", bytes / Math.pow(unit, exp), pre);
@@ -2348,7 +2333,7 @@ public static void dispatchToObjectDetailsPage(PrismObject obj, Component compon
public static void dispatchToObjectDetailsPage(PrismObject obj, boolean isNewObject, Component component) {
Class newObjectPageClass = isNewObject ? getNewlyCreatedObjectPage(obj.getCompileTimeClass()) : getObjectDetailsPage(obj.getCompileTimeClass());
if (newObjectPageClass == null) {
- throw new IllegalArgumentException("Cannot determine details page for "+obj.getCompileTimeClass());
+ throw new IllegalArgumentException("Cannot determine details page for " + obj.getCompileTimeClass());
}
Constructor constructor;
@@ -2386,7 +2371,7 @@ public static void dispatchToObjectDetailsPage(Class extends ObjectType> objec
if (page != null) {
((PageBase) component.getPage()).navigateToNext(page, parameters);
} else if (failIfUnsupported) {
- throw new SystemException("Cannot determine details page for "+objectClass);
+ throw new SystemException("Cannot determine details page for " + objectClass);
}
}
@@ -2541,25 +2526,25 @@ public static Integer getIntegerParameter(PageParameters params, String key) {
return value.toInteger();
}
- public static boolean isSubscriptionIdCorrect(String subscriptionId){
+ public static boolean isSubscriptionIdCorrect(String subscriptionId) {
if (StringUtils.isEmpty(subscriptionId)) {
return false;
}
- if (!NumberUtils.isDigits(subscriptionId)){
+ if (!NumberUtils.isDigits(subscriptionId)) {
return false;
}
- if (subscriptionId.length() < 11){
+ if (subscriptionId.length() < 11) {
return false;
}
String subscriptionType = subscriptionId.substring(0, 2);
boolean isTypeCorrect = false;
- for (SubscriptionType type : SubscriptionType.values()){
- if (type.getSubscriptionType().equals(subscriptionType)){
+ for (SubscriptionType type : SubscriptionType.values()) {
+ if (type.getSubscriptionType().equals(subscriptionType)) {
isTypeCorrect = true;
break;
}
}
- if (!isTypeCorrect){
+ if (!isTypeCorrect) {
return false;
}
String substring1 = subscriptionId.substring(2, 4);
@@ -2571,7 +2556,7 @@ public static boolean isSubscriptionIdCorrect(String subscriptionId){
SimpleDateFormat dateFormat = new SimpleDateFormat("yy");
String currentYear = dateFormat.format(Calendar.getInstance().getTime());
- if (Integer.parseInt(substring2) < Integer.parseInt(currentYear)){
+ if (Integer.parseInt(substring2) < Integer.parseInt(currentYear)) {
return false;
}
@@ -2589,7 +2574,7 @@ public static boolean isSubscriptionIdCorrect(String subscriptionId){
return false;
}
VerhoeffCheckDigit checkDigit = new VerhoeffCheckDigit();
- if (checkDigit.isValid(subscriptionId)){
+ if (checkDigit.isValid(subscriptionId)) {
return true;
}
return false;
@@ -2606,19 +2591,19 @@ public static void setSelectedTabFromPageParameters(TabbedPanel tabbed, PagePara
tabbed.setSelectedTab(tabIndex);
}
- public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType){
+ public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType) {
return getElementVisibility(visibilityType, new ArrayList<>());
}
- public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType, List requiredAuthorizations){
+ public static boolean getElementVisibility(UserInterfaceElementVisibilityType visibilityType, List requiredAuthorizations) {
if (UserInterfaceElementVisibilityType.HIDDEN.equals(visibilityType) ||
- UserInterfaceElementVisibilityType.VACANT.equals(visibilityType)){
+ UserInterfaceElementVisibilityType.VACANT.equals(visibilityType)) {
return false;
}
- if (UserInterfaceElementVisibilityType.VISIBLE.equals(visibilityType)){
+ if (UserInterfaceElementVisibilityType.VISIBLE.equals(visibilityType)) {
return true;
}
- if (UserInterfaceElementVisibilityType.AUTOMATIC.equals(visibilityType)){
+ if (UserInterfaceElementVisibilityType.AUTOMATIC.equals(visibilityType)) {
return WebComponentUtil.isAuthorized(requiredAuthorizations);
}
return true;
@@ -2626,7 +2611,7 @@ public static boolean getElementVisibility(UserInterfaceElementVisibilityType vi
public static IModel createAbstractRoleConfirmationMessage(String actionName,
ColumnMenuAction action, MainObjectListPanel abstractRoleTable, PageBase pageBase) {
- List selectedRoles = new ArrayList<>();
+ List selectedRoles = new ArrayList<>();
if (action.getRowModel() == null) {
selectedRoles.addAll(abstractRoleTable.getSelectedObjects());
} else {
@@ -2637,7 +2622,7 @@ public static IModel createAbstractRoleCon
for (AR selectedRole : selectedRoles) {
ObjectQuery query = pageBase.getPrismContext().queryFor(FocusType.class)
.item(FocusType.F_ROLE_MEMBERSHIP_REF)// TODO MID-3581
- .ref(ObjectTypeUtil.createObjectRef(selectedRole, pageBase.getPrismContext()).asReferenceValue())
+ .ref(ObjectTypeUtil.createObjectRef(selectedRole, pageBase.getPrismContext()).asReferenceValue())
.maxSize(1)
.build();
List> members = WebModelServiceUtils.searchObjects(FocusType.class, query, result, pageBase);
@@ -2655,16 +2640,16 @@ public static IModel createAbstractRoleCon
actionName, abstractRoleTable.getSelectedObjectsCount());
} else {
return pageBase.createStringResource(propertyKeyPrefix + ".message.confirmationMessageForSingleObject" + members,
- actionName, ((ObjectType)((SelectableBeanImpl)action.getRowModel().getObject()).getValue()).getName());
+ actionName, ((ObjectType) ((SelectableBeanImpl) action.getRowModel().getObject()).getValue()).getName());
}
}
- public static DisplayType getNewObjectDisplayTypeFromCollectionView(CompiledObjectCollectionView view, PageBase pageBase){
+ public static DisplayType getNewObjectDisplayTypeFromCollectionView(CompiledObjectCollectionView view, PageBase pageBase) {
DisplayType displayType = view != null ? view.getDisplay() : null;
- if (displayType == null){
+ if (displayType == null) {
displayType = WebComponentUtil.createDisplayType(GuiStyleConstants.CLASS_ADD_NEW_OBJECT, "green", "");
}
- if (PolyStringUtils.isEmpty(displayType.getTooltip()) && !PolyStringUtils.isEmpty(displayType.getLabel())){
+ if (PolyStringUtils.isEmpty(displayType.getTooltip()) && !PolyStringUtils.isEmpty(displayType.getLabel())) {
StringBuilder sb = new StringBuilder();
sb.append(pageBase.createStringResource("MainObjectListPanel.newObject").getString());
sb.append(" ");
@@ -2678,7 +2663,7 @@ public static DisplayType getNewObjectDisplayTypeFromCollectionView(CompiledObje
* Returns name of the collection suitable to be displayed in the menu or other labels.
* E.g. "All tasks", "Active employees".
*/
- public static PolyStringType getCollectionLabel(DisplayType viewDisplayType, CollectionRefSpecificationType collectionRefSpec ,ObjectType collectionRefTarget) {
+ public static PolyStringType getCollectionLabel(DisplayType viewDisplayType, CollectionRefSpecificationType collectionRefSpec, ObjectType collectionRefTarget) {
if (viewDisplayType != null) {
PolyStringType viewPluralLabel = viewDisplayType.getPluralLabel();
if (viewPluralLabel != null) {
@@ -2700,8 +2685,8 @@ public static PolyStringType getCollectionLabel(DisplayType viewDisplayType, Col
return null;
}
- public static ItemVisibility checkShadowActivationAndPasswordVisibility(ItemWrapper,?> itemWrapper,
- ShadowType shadowType) {
+ public static ItemVisibility checkShadowActivationAndPasswordVisibility(ItemWrapper, ?> itemWrapper,
+ ShadowType shadowType) {
ObjectReferenceType resourceRef = shadowType.getResourceRef();
if (resourceRef == null) {
//TODO: what to return if we don't have resource available?
@@ -2724,7 +2709,6 @@ public static ItemVisibility checkShadowActivationAndPasswordVisibility(ItemWrap
}
ResourceObjectTypeDefinitionType resourceObjectTypeDefinitionType = ResourceTypeUtil.findObjectTypeDefinition(resource, shadowType.getKind(), shadowType.getIntent());
-
if (SchemaConstants.PATH_ACTIVATION.equivalent(itemWrapper.getPath())) {
if (ResourceTypeUtil.isActivationCapabilityEnabled(resourceType, resourceObjectTypeDefinitionType)) {
return ItemVisibility.AUTO;
@@ -2829,7 +2813,6 @@ public static boolean isPasswordSupported(ShadowType shadowType) {
}
-
public static boolean isAssociationSupported(ShadowType shadowType) {
ObjectReferenceType resourceRef = shadowType.getResourceRef();
if (resourceRef == null) {
@@ -2858,7 +2841,7 @@ public static boolean isAssociationSupported(ShadowType shadowType) {
return CollectionUtils.isNotEmpty(ocd.getAssociationDefinitions());
}
- public static void toggleResourceMaintenance (@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase) {
+ public static void toggleResourceMaintenance(@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase) {
AdministrativeAvailabilityStatusType resourceAdministrativeAvailabilityStatus = ResourceTypeUtil.getAdministrativeAvailabilityStatus(resource.asObjectable());
AdministrativeAvailabilityStatusType finalStatus = AdministrativeAvailabilityStatusType.MAINTENANCE; // default new value for existing null
@@ -2873,10 +2856,10 @@ public static void toggleResourceMaintenance (@NotNull PrismObject
}
}
- switchResourceMaintenance (resource, operation, target, pageBase, finalStatus);
+ switchResourceMaintenance(resource, operation, target, pageBase, finalStatus);
}
- public static void switchResourceMaintenance (@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase, AdministrativeAvailabilityStatusType mode) {
+ public static void switchResourceMaintenance(@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase, AdministrativeAvailabilityStatusType mode) {
Task task = pageBase.createSimpleTask(operation);
OperationResult parentResult = new OperationResult(operation);
@@ -2887,7 +2870,7 @@ public static void switchResourceMaintenance (@NotNull PrismObject
pageBase.getModelService().executeChanges(MiscUtil.createCollection(objectDelta), null, task, parentResult);
- } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException
+ } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException
| ExpressionEvaluationException | CommunicationException | ConfigurationException
| PolicyViolationException | SecurityViolationException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Error changing resource administrative operational state", e);
@@ -2899,7 +2882,7 @@ public static void switchResourceMaintenance (@NotNull PrismObject
target.add(pageBase.getFeedbackPanel());
}
- public static void refreshResourceSchema(@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase){
+ public static void refreshResourceSchema(@NotNull PrismObject resource, String operation, AjaxRequestTarget target, PageBase pageBase) {
Task task = pageBase.createSimpleTask(operation);
OperationResult parentResult = new OperationResult(operation);
@@ -2918,7 +2901,7 @@ public static void refreshResourceSchema(@NotNull PrismObject reso
target.add(pageBase.getFeedbackPanel());
}
- public static List getCategoryRelationChoices(AreaCategoryType category, ModelServiceLocator pageBase){
+ public static List getCategoryRelationChoices(AreaCategoryType category, ModelServiceLocator pageBase) {
List relationsList = new ArrayList<>();
List defList = getRelationDefinitions(pageBase);
defList.forEach(def -> {
@@ -2946,7 +2929,7 @@ public static RelationDefinitionType getRelationDefinition(QName relation) {
}
public static List prepareAutoCompleteList(LookupTableType lookupTable, String input,
- LocalizationService localizationService){
+ LocalizationService localizationService) {
List values = new ArrayList<>();
if (lookupTable == null) {
@@ -2979,12 +2962,12 @@ public static List prepareAutoCompleteList(LookupTableType lookupTable,
return values;
}
- private static PolyString setTranslateToPolystring(LookupTableRowType row){
+ private static PolyString setTranslateToPolystring(LookupTableRowType row) {
PolyString polystring = row.getLabel().toPolyString();
return setTranslateToPolystring(polystring);
}
- private static PolyString setTranslateToPolystring(PolyString polystring){
+ private static PolyString setTranslateToPolystring(PolyString polystring) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(polystring.getOrig())) {
if (polystring.getTranslation() == null) {
PolyStringTranslationType translation = new PolyStringTranslationType();
@@ -3075,16 +3058,16 @@ private static IModel> createChoices() {
};
}
- public static Class> getPreviousPageClass(PageBase parentPage){
+ public static Class> getPreviousPageClass(PageBase parentPage) {
List breadcrumbs = parentPage.getBreadcrumbs();
- if (breadcrumbs == null || breadcrumbs.size() < 2){
+ if (breadcrumbs == null || breadcrumbs.size() < 2) {
return null;
}
Breadcrumb previousBreadcrumb = breadcrumbs.get(breadcrumbs.size() - 2);
Class> page = null;
- if (previousBreadcrumb instanceof BreadcrumbPageClass){
+ if (previousBreadcrumb instanceof BreadcrumbPageClass) {
page = ((BreadcrumbPageClass) previousBreadcrumb).getPage();
- } else if (previousBreadcrumb instanceof BreadcrumbPageInstance){
+ } else if (previousBreadcrumb instanceof BreadcrumbPageInstance) {
page = ((BreadcrumbPageInstance) previousBreadcrumb).getPage().getClass();
}
return page;
@@ -3163,19 +3146,14 @@ private Map prepareExtensionValues(Collection oids) throw
return menuItems;
}
- @SuppressWarnings("unused")
- public static RelationRegistry getStaticallyProvidedRelationRegistry() {
- return staticallyProvidedRelationRegistry;
- }
-
public static ObjectFilter getAssignableRolesFilter(PrismObject extends FocusType> focusObject, Class extends AbstractRoleType> type, AssignmentOrder assignmentOrder,
- OperationResult result, Task task, PageBase pageBase) {
+ OperationResult result, Task task, PageBase pageBase) {
return getAssignableRolesFilter(focusObject, type, null, assignmentOrder, result, task, pageBase);
}
public static ObjectFilter getAssignableRolesFilter(PrismObject extends FocusType> focusObject, Class extends AbstractRoleType> type,
- QName relation, AssignmentOrder assignmentOrder,
- OperationResult result, Task task, PageBase pageBase) {
+ QName relation, AssignmentOrder assignmentOrder,
+ OperationResult result, Task task, PageBase pageBase) {
ObjectFilter filter = null;
LOGGER.debug("Loading objects which can be assigned");
try {
@@ -3183,11 +3161,11 @@ public static ObjectFilter getAssignableRolesFilter(PrismObject extends FocusT
RoleSelectionSpecification roleSpec =
mis.getAssignableRoleSpecification(focusObject, type, assignmentOrder.getOrder(), task, result);
filter = roleSpec.getGlobalFilter();
- if (relation != null){
+ if (relation != null) {
ObjectFilter relationFilter = roleSpec.getRelationFilter(relation);
- if (filter == null){
+ if (filter == null) {
return relationFilter;
- } else if (relationFilter == null){
+ } else if (relationFilter == null) {
return filter;
} else {
return pageBase.getPrismContext().queryFactory().createOr(filter, relationFilter);
@@ -3205,24 +3183,24 @@ public static ObjectFilter getAssignableRolesFilter(PrismObject extends FocusT
return filter;
}
- public static Behavior getSubmitOnEnterKeyDownBehavior(String submitButtonAboutAttribute){
+ public static Behavior getSubmitOnEnterKeyDownBehavior(String submitButtonAboutAttribute) {
return new Behavior() {
private static final long serialVersionUID = 1L;
@Override
public void bind(Component component) {
- super.bind( component );
+ super.bind(component);
- component.add( AttributeModifier.replace( "onkeydown",
- Model.of("if(event.keyCode == 13) {$('[about=\"" + submitButtonAboutAttribute +"\"]').click();}") ) );
+ component.add(AttributeModifier.replace("onkeydown",
+ Model.of("if(event.keyCode == 13) {$('[about=\"" + submitButtonAboutAttribute + "\"]').click();}")));
}
};
}
public static List getAssignableRelationsList(PrismObject extends FocusType> focusObject, Class extends AbstractRoleType> type,
- AssignmentOrder assignmentOrder,
- OperationResult result, Task task, PageBase pageBase){
+ AssignmentOrder assignmentOrder,
+ OperationResult result, Task task, PageBase pageBase) {
List relationsList = null;
LOGGER.debug("Loading assignable relations list");
try {
@@ -3230,7 +3208,7 @@ public static List