/** * Semi-shallow clone. */ public MidPointUserProfilePrincipal clone() { MidPointUserProfilePrincipal clone = new MidPointUserProfilePrincipal(this.getUser()); copyValues(clone); return clone; }
public boolean isFeatureVisible(String identifier, BooleanSupplier automaticPredicate) { UserInterfaceElementVisibilityType visibility = getFeatureVisibility(identifier); return isVisible(visibility, automaticPredicate); }
public boolean isFeatureVisible(String identifier) { return isFeatureVisible(identifier, null); }
@Override public MidPointUserProfilePrincipal getPrincipal(PrismObject<UserType> user, AuthorizationTransformer authorizationLimiter, OperationResult result) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { MidPointUserProfilePrincipal principal = userProfileService.getPrincipal(user); addFakeAuthorization(principal); return principal; }
public <O extends ObjectType> CompiledObjectCollectionView findObjectViewByViewName(Class<O> compileTimeClass, String viewName){ if (compileTimeClass == null || StringUtils.isEmpty(viewName)){ return null; } List<CompiledObjectCollectionView> objectViews = findAllApplicableObjectCollectionViews(compileTimeClass); if (objectViews == null) { return null; } for (CompiledObjectCollectionView view : objectViews){ if (viewName.equals(view.getViewIdentifier())){ return view; } } return null; }
private CompiledObjectCollectionView findOrCreateMatchingView(CompiledUserProfile composite, GuiObjectListViewType objectListViewType) { QName objectType = objectListViewType.getType(); String viewIdentifier = determineViewIdentifier(objectListViewType); CompiledObjectCollectionView existingView = composite.findObjectCollectionView(objectType, viewIdentifier); if (existingView == null) { existingView = new CompiledObjectCollectionView(objectType, viewIdentifier); composite.getObjectCollectionViews().add(existingView); } return existingView; }
private boolean matches(CompiledObjectCollectionView view) throws ObjectNotFoundException, SchemaException { if (identifier != null) { if (!identifier.equals(view.getViewIdentifier())) { return false; } } // TODO: more criteria return true; }
public UserInterfaceFeatureType findFeature(String identifier) { return findFeature(features, identifier); }
public ObjectFilter getFilter() { return view.getFilter(); }
@NotNull public CompiledUserProfile getCompiledUserProfile() { if (compiledUserProfile == null) { compiledUserProfile = new CompiledUserProfile(); } return compiledUserProfile; }
@Override public void updateUser(MidPointPrincipal principal) { userProfileService.updateUser(principal); }
@Override public MidPointUserProfilePrincipal getPrincipalByOid(String oid) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { MidPointUserProfilePrincipal principal = userProfileService.getPrincipalByOid(oid); addFakeAuthorization(principal); return principal; } };
@Override public <F extends FocusType, O extends ObjectType> PrismObject<F> resolveOwner(PrismObject<O> object) throws CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { return userProfileService.resolveOwner(object); }
public <O extends ObjectType> GuiObjectDetailsPageType findObjectDetailsConfiguration(Class<O> compileTimeClass) { if (objectDetails == null) { return null; } return findObjectConfiguration(objectDetails.getObjectDetailsPage(), compileTimeClass); }
private void compileAdditionalPanels(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) { GuiObjectListViewAdditionalPanelsType newAdditionalPanels = objectListViewType.getAdditionalPanels(); if (newAdditionalPanels == null) { return; } // TODO: later: merge additional panel definitions existingView.setAdditionalPanels(newAdditionalPanels); }
private void compileDistinct(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) { DistinctSearchOptionType newDistinct = objectListViewType.getDistinct(); if (newDistinct == null) { return; } existingView.setDistinct(newDistinct); }
private void compileSearchBox(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) { SearchBoxConfigurationType newSearchBoxConfig = objectListViewType.getSearchBoxConfiguration(); if (newSearchBoxConfig == null) { return; } // TODO: merge existingView.setSearchBoxConfiguration(newSearchBoxConfig); }
private void compileSorting(CompiledObjectCollectionView existingView, GuiObjectListViewType objectListViewType) { Boolean newDisableSorting = objectListViewType.isDisableSorting(); if (newDisableSorting != null) { existingView.setDisableSorting(newDisableSorting); } }
@Override public MidPointUserProfilePrincipal getPrincipal(String username) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { MidPointUserProfilePrincipal principal = userProfileService.getPrincipal(username); addFakeAuthorization(principal); return principal; }
public UserInterfaceElementVisibilityType getFeatureVisibility(String identifier) { UserInterfaceFeatureType feature = findFeature(identifier); if (feature == null) { return UserInterfaceElementVisibilityType.AUTOMATIC; } UserInterfaceElementVisibilityType visibility = feature.getVisibility(); if (visibility == null) { return UserInterfaceElementVisibilityType.AUTOMATIC; } return visibility; }