This page shows resource schema. The resource schema defines object classes that the connector can manage, e.g. accounts, groups, organizational units and so on. The schema defines a set of attributes for each object class. The schema is presented here in read-only form so you can inspect it and familiarize yourself with the data model that the resource provides.
The resource schema presented at this page is usually retrieved from the resource and automatically generated by system. Resource schema defines what the resource can do, i.e. what object classes it defines and what attributes are used in the object classes. Therefore the schema is read-only. It is not a configuration. It does not defines how system uses the object classes and attributes. That is configured in next steps of the wizard.
詳細については、同期設定のWikiページを参照してください。
ResourceWizard.saveAndVisualize=保存と可視化
ResourceWizard.visualize=可視化
@@ -2889,7 +2889,7 @@ SchemaHandlingStep.association.tooltip.direction=アソシエーションの方
SchemaHandlingStep.association.tooltip.explicitRefIntegrity=明示的な参照整合性。falseに設定すると、システムはリソースが参照整合性を実装していると見なします。例えば、 システムは、アカウントの名前が変更され、システムが何もする必要がない場合に、リソースが自動的にアソシエーションIDを更新すると想定します。trueに設定すると、システムは明示的に参照整合性を取ります。この場合、システムは、アカウントの名前が変更されると、アソシエーション属性を明示的に更新します。
SchemaHandlingStep.association.tooltip.intent=アソシエーションの対象オブジェクト・タイプの用途。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクト・タイプを識別します。 グループ、特権、ロールなど
SchemaHandlingStep.association.tooltip.kind=アソシエーションの対象オブジェクト・タイプの種類。 これは通常”エンタイトルメント”です。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクトタイプを識別します。例えば、 グループ、特権、ロールなど。
-SchemaHandlingStep.association.tooltip.valueAttribute=Name of the attribute that is the source of a value for the association. The value of this attribute will be taken and stored into the association attribute to form an association. This is usually an attribute that contains an identifier or name such as "uid", "id", "name", etc. In subject-to-object associations this is an attribute of an object (e.g. group). In object-to-subject associations this is an attribute of a subject (e.g. account).
+SchemaHandlingStep.association.tooltip.valueAttribute=アソシエーションの値のソースとなる属性の名前。この属性の値が取得され、アソシエーションを形成するためにアソシエーション属性に格納されます。これは通常、 "uid"、 "id"、 "name"などの識別子または名前を含む属性です。サブジェクトとオブジェクトのアソシエーションでは、これはオブジェクトの属性です(グループなど)。オブジェクトとサブジェクトのアソシエーションでは、これはサブジェクトの属性です(例:アカウント)。
SchemaHandlingStep.attribute.label.attributeName=属性名
SchemaHandlingStep.attribute.label.attributeNamespace=属性名前空間
SchemaHandlingStep.attribute.tooltip.allow=オンにすると、元のリソーススキーマにない属性を指定できます。これは、完全なリソーススキーマを提供せず、いくつかの属性を隠すような不完全なコネクターを修正するために使用できます。
@@ -2973,7 +2973,7 @@ SchemaHandlingStep.tooltip.default=trueに設定した場合、この定義は
SchemaHandlingStep.tooltip.dependency=Dependencies are object types that has to be processed before this object types is processed. I.e. this object type depends on them. The object types on which this object type depends will be provisioned before this object type. Dependencies are used to impose ordering into provisioning operations.
SchemaHandlingStep.tooltip.filterClause=TODO: SchemaHandlingStep.tooltip.filterClause
SchemaHandlingStep.tooltip.intent=用途は、システムがオブジェクトに対して何をすべきかを指定します。用途は、同じ種類のオブジェクトをいくつかのカテゴリに分類します。 用途が異なるオブジェクトは、システムによって異なる方法で処理される可能性があります。
-SchemaHandlingStep.tooltip.iteration=Iteratively find values for unique attributes such as identifiers. Identity Manager will try several times to find a unique value for such attributes.
+SchemaHandlingStep.tooltip.iteration=識別子などの固有の属性の値を繰り返し見つけます。アイデンティティ・マネージャーは、そのような属性に固有の値を見つけるために何度か試行します。
SchemaHandlingStep.tooltip.kind=種類は、このオブジェクトが何であるか、それがアカウント、エンタイトルメント、または何か他のものであるかどうかを指定しました。
SchemaHandlingStep.tooltip.objectClass=このオブジェクト・タイプのインスタンスを構築するために使用されるスキーマのオブジェクトクラス。
SchemaHandlingStep.tooltip.protected=このオブジェクト型の保護されたインスタンスの指定 システムは保護されたインスタンスを見ることができますが、触れることはできません。 それらを変更しようとしても失敗します。 これは、 "root"や "administrator"などの緊急管理アカウントを保護するために使用されます。
@@ -3131,7 +3131,7 @@ SynchronizationStep.tooltip.enabled=この同期設定が有効になってい
SynchronizationStep.tooltip.focus=リソース・オブジェクトに対応するフォーカル・オブジェクトのタイプ。アカウント・オブジェクトの場合、これは通常ユーザー・オブジェクト(UserType)です。これは、エンタイトルメント・オブジェクトなどに対してRoleTypeまたはOrgTypeに設定できます。
SynchronizationStep.tooltip.intent=Object intent for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the intent specified in this field.
SynchronizationStep.tooltip.kind=Object kind for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the kind specified in this field.
-SynchronizationStep.tooltip.objectClass=Object class for which this definition applies. This will be used to select the synchronization settings in case the object (shadow) does not have kind/intent definition yet.
+SynchronizationStep.tooltip.objectClass=この定義が適用されるオブジェクトクラス。これはオブジェクト(シャドウ)が種類/用途の定義をまだ持っていない場合に同期設定を選択するために使用されます。
SynchronizationStep.tooltip.objectTemplate=この特定の同期イベントを処理するために使用されるオブジェクト・テンプレート。ここでオブジェクト・テンプレートが指定されていない場合は、通常のデフォルトが使用されます。
SynchronizationStep.tooltip.opportunistic=trueに設定すると、このイベントの処理中に日和見的同期(別名ディスカバリー)が有効になります。
SynchronizationStep.tooltip.reaction=システムがこの同期イベントにどのようにリアクションするかを指定します。 いくつかのリアクションを指定できます。 イベントの同期状況に適したリアクションが選択されます。
@@ -3696,7 +3696,7 @@ StageDefinitionPanel.notifyWhenNoDecisionHelp=チェックした場合、レビ
StageDefinitionPanel.reviewerSpecificationTargetHelp=割当て/インデュースメント・ターゲットの所有者/承認者に基づくレビュー担当者の選択。 例えば ロールの所有者を使用して、(任意のユーザーに対する)「自分の」ロールのすべての割当てを認証するように指定できます。
StageDefinitionPanel.reviewerSpecificationObjectHelp=Selection of reviewers based on object that has something assigned (or induced) to. E.g. you can specify that the role owner is used to certify all inducements made to 'his' role.
StageDefinitionPanel.reviewerUseObjectManagerHelp=Selection of reviewers based on managers of object (typically a user) that has something assigned/induced to. E.g. you can specify that a manager is used to certify all assignments made to users in 'his' organization.
-StageDefinitionPanel.reviewerUseObjectManagerOrgTypeHelp=Influences determination of a manager of a user: First, we take all managers of all organizations the user belongs to. We exclude the user himself, if he is a manager of such organization (and if 'allow managers to approve their own assignments' below is unchecked). If the value in this field is filled-in, we use it to select only organizations with given organization type value - for example, 'functional' (if you have e.g. both functional-type and project-type organizations). If this field is empty, we take into account all organizations. If we find no suitable manager, we continue with all parent organizations (again, of the given type, if specified).
+StageDefinitionPanel.reviewerUseObjectManagerOrgTypeHelp=ユーザーのマネージャーの決定に影響を与えます。まず、ユーザーが属するすべての組織のすべてのマネージャーを取得します。ユーザーがそのような組織のマネージャーである場合(および下記の「マネージャーに自分の割当てを承認することを許可する」のチェックが外されている場合)、ユーザー自身を除外します。 このフィールドの値が入力されている場合は、指定された組織タイプの値を持つ組織のみを選択するために使用します。例えば、「ファンクショナル」(例えば、ファンクショナル・タイプとプロジェクト・タイプの組織の両方がある場合)。 このフィールドが空白の場合は、すべての組織が考慮されます。 適切なマネージャーが見つからない場合は、すべての親組織(ここでも指定されている場合は指定されたタイプのもの)を続行します。
StageDefinitionPanel.reviewerUseObjectManagerAllowSelfHelp=If a user is a manager in his organization, could he be selected as a reviewer for his own assignments? If unchecked (the default), a higher-level manager is searched for - see description for the above field.
StageDefinitionPanel.defaultReviewerRefHelp=上記の条件でレビューワーを導けない場合は、このレビューワー(複数可)が使用されます。
StageDefinitionPanel.additionalReviewerRefHelp=このレビューワー(複数可)は、上記の条件で選択されたレビューワーに加えて使用されます。
@@ -3747,7 +3747,7 @@ PageResourceVisualization.dotMessage=DOTグラフのレンダリングは実行
PageResourceVisualization.dot1=DOTレンダリング・ソフトウェアがサーバーにインストールされています。 推奨されるのはGraphvizです
PageResourceVisualization.dot2=DOTレンダリング実行ファイルへのパスは、config.xmlファイルで正しく設定されています。
PageResourceVisualization.moreInformation=詳細は、こちらをご覧ください:
-PageResourceVisualization.moreInformationLink=this article
+PageResourceVisualization.moreInformationLink=この記事
PageResourceVisualization.errorMessage=エラーメッセージ
PageResourceVisualization.seeOnline=オンラインのDOTレンダラーを使用することもできます
PageResourceVisualization.seeOnlineLink=webgraphviz.com
@@ -4172,7 +4172,7 @@ ExpressionValuePanel.specifyExpression=式を指定する
ExpressionValuePanel.addValueButtonDefaultTitle=シャドウ・リファレンス値を追加
ExpressionValuePanel.addValueButtonTargetSearchTitle=アソシエーション・ターゲット・検索を追加
ExpressionValuePanel.addLiteralValueButton=リテラル値を追加
-ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters.
+ExpressionValuePanel.associationDefenitionsNotDefined=アソシエーション定義は、選択された種類/用途パラメーターを持つ現在のリソースに対して定義されていません。
ConstructionType.attribute=属性
ConstructionType.association=アソシエーション
operation.Recompute.ALL.members=全メンバーの再計算
diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties
index c6a0b9f683c..4bb0c3f8248 100644
--- a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties
+++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties
@@ -4172,7 +4172,7 @@ ExpressionValuePanel.specifyExpression=Określ wyrażenie
ExpressionValuePanel.addValueButtonDefaultTitle=Dodaj wartość referencyjną cienia
ExpressionValuePanel.addValueButtonTargetSearchTitle=Dodaj wyszukiwanie celu powiązania
ExpressionValuePanel.addLiteralValueButton=Dodaj wartość dosłowną
-ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters.
+ExpressionValuePanel.associationDefenitionsNotDefined=Brak jest definicji powiązań dla bieżącego systemu z wybranymi parametrami rodzaj/intencja
ConstructionType.attribute=Atrybut
ConstructionType.association=Powiązanie
operation.Recompute.ALL.members=Przelicz wszystkich członków
diff --git a/infra/schema/src/main/resources/localization/schema_fr.properties b/infra/schema/src/main/resources/localization/schema_fr.properties
index b08ad80b20b..fce73424438 100644
--- a/infra/schema/src/main/resources/localization/schema_fr.properties
+++ b/infra/schema/src/main/resources/localization/schema_fr.properties
@@ -299,7 +299,7 @@ FormSpecificationType.formRef=Reference to form
FormSpecificationType.panelClass=Classe de panneau
FormSpecificationType.panelUri=Uri du panneau
GenericPcpAspectConfigurationType.name=Nom
-GlobalPolicyRuleType.details=Règle globale de politique
+GlobalPolicyRuleType.details=Règle de politique globale
GlobalPolicyRuleType.focusSelector=Sélecteur de foyer
GlobalPolicyRuleType.targetSelector=Sélecteur de cible
GlobalPolicyRuleType.condition=Conditions
@@ -633,9 +633,9 @@ RoleManagementConfigurationType.defaultAssignmentConstraints=Contraintes d'attri
RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute after all approvals
RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled
RoleManagementConfigurationType.relations=Relations
-SearchBoxConfigurationType.defaultMode=Default mode
-SearchBoxConfigurationType.defaultObjectType=Default object type
-SearchBoxConfigurationType.defaultScope=Default scope
+SearchBoxConfigurationType.defaultMode=Mode par défaut
+SearchBoxConfigurationType.defaultObjectType=Type d'objet par défaut
+SearchBoxConfigurationType.defaultScope=Champ d'application par défaut
ShadowType.dead=Mort
ShadowType.kind=Sorte
ShadowType.failedOperationType=Failed operation type
@@ -931,7 +931,7 @@ DefaultPolicyConstraint.not=Les contraintes incluses n'ont pas été enclenchée
DefaultPolicyConstraint.transition=Contrainte de politique de transition appariée
DefaultPolicyConstraint.situation=Contrainte de politique de situation appariée
PolicyViolationException.message.aggregate=Des infractions à la politique {0} ont eu lieu.
-PolicyViolationException.message.projectionPassword=Le mot de passe fourni ne satisfait pas aux stratégies de mot de passe dans {0 }: {1}
+PolicyViolationException.message.projectionPassword=Le mot de passe fourni ne satisfait pas aux politiques de mots de passe dans {0} : {1}
PolicyViolationException.message.credentials.nonce=Provided nonce does not satisfy the policies: {0}
PolicyViolationException.message.credentials.password=Le mot de passe fourni ne satisfait pas les règles: {0}
PolicyViolationException.message.credentials.securityQuestions=Les questions de sécurité fournies ne satisfont pas aux règles : {0}
@@ -1003,9 +1003,9 @@ PolicyConstraintsType.modification=Modification
PolicyConstraintsType.modification.help=Contrainte déclenchée lorsque l'objet est modifié.
PolicyConstraintsType.assignment=Attribution
PolicyConstraintsType.assignment.help=Contrainte déclenchée lorsqu'un objet est attribué ou que l'attribution est retirée ou modifiée.
-PolicyConstraintsType.objectTimeValidity=Object time validity
+PolicyConstraintsType.objectTimeValidity=Durée de validité de l'objet
PolicyConstraintsType.objectTimeValidity.help=Une contrainte qui se déclenche lorsque la validité d'un objet ou n'importe lequel de ses éléments asservis au temps (p.e. un mot de passe) est sur le point d'expirer.
-PolicyConstraintsType.assignmentTimeValidity=Validité du temps d'attribution
+PolicyConstraintsType.assignmentTimeValidity=Durée de validité des attributions
PolicyConstraintsType.assignmentTimeValidity.help=Une contrainte qui se déclenche lorsque la validité d'une attribution ou n'importe lequel de ses éléments asservis au temps (p.e. un mot de passe) est sur le point d'expirer.
PolicyConstraintsType.situation=Situation de politique
PolicyConstraintsType.situation.help=Occurrence de la situation de politique au sein d'un objet ou d'une attribution.
@@ -1088,8 +1088,8 @@ DefaultPolicyConstraint.Short.objectModification.toBeDeleted=Suppression de {0}
DefaultPolicyConstraint.Short.objectModification.wasDeleted={0} supprimé(e)
DefaultPolicyConstraint.Short.objectModification.toBeModified=Modification de {0}
DefaultPolicyConstraint.Short.objectModification.wasModified={0} modifié(e)
-DefaultPolicyConstraint.Short.objectState.unnamed=État d'appariement : {0}
-DefaultPolicyConstraint.Short.objectState.named=État d'appariement : {0} (« {1} »)
+DefaultPolicyConstraint.Short.objectState.unnamed=État d'appariement : {0}
+DefaultPolicyConstraint.Short.objectState.named=État d'appariement : {0} (« {1} »)
# {0} = before/after, {1} target/path, {2} rule name
DefaultPolicyConstraint.Short.assignmentState.unnamed=État correspondant : attribution de {1} ({0})
DefaultPolicyConstraint.Short.assignmentState.named=État correspondant : attribution de {1} ({0}) (« {2} »)
From eb6903a93551361b7e97229b80e4cf9f645e02ea Mon Sep 17 00:00:00 2001
From: Pavol Mederly
Date: Fri, 1 Mar 2019 14:55:03 +0100
Subject: [PATCH 05/12] Fix intra-cluster authentication (MID-5162)
Also fixed the fix for TaskManagerQuartzImpl autowiring when profiling
is enabled.
---
.../NodeAuthenticationEvaluatorImpl.java | 105 +++++++++---------
.../midpoint/task/api/TaskManager.java | 7 ++
.../quartzimpl/TaskManagerQuartzImpl.java | 7 +-
.../cluster/ClusterExecutionHelperImpl.java | 9 +-
.../quartzimpl/execution/HandlerExecutor.java | 4 +-
.../LightweightPartitioningTaskHandler.java | 2 +-
6 files changed, 76 insertions(+), 58 deletions(-)
diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java
index 680c24e495d..29776336582 100644
--- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java
+++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java
@@ -23,6 +23,7 @@
import com.evolveum.midpoint.prism.crypto.Protector;
import com.evolveum.midpoint.task.api.TaskManager;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -55,7 +56,7 @@ public class NodeAuthenticationEvaluatorImpl implements NodeAuthenticationEvalua
private static final String OPERATION_SEARCH_NODE = NodeAuthenticationEvaluatorImpl.class.getName() + ".searchNode";
- public boolean authenticate(@Nullable String remoteName, String remoteAddress, @Nullable String credentials, String operation) {
+ public boolean authenticate(@Nullable String remoteName, String remoteAddress, @NotNull String credentials, String operation) {
LOGGER.debug("Checking if {} ({}) is a known node", remoteName, remoteAddress);
OperationResult result = new OperationResult(OPERATION_SEARCH_NODE);
@@ -63,45 +64,52 @@ public boolean authenticate(@Nullable String remoteName, String remoteAddress, @
try {
List> allNodes = repositoryService.searchObjects(NodeType.class, null, null, result);
- List> matchingNodes = getMatchingNodes(allNodes, remoteName, remoteAddress, operation);
-
- if (matchingNodes.size() == 1 || matchingNodes.size() >= 1 && taskManager.isLocalNodeClusteringEnabled()) {
+ List> matchingNodes = getMatchingNodes(allNodes, remoteName, remoteAddress);
+
+ if (matchingNodes.isEmpty()) {
+ LOGGER.debug("Authenticity cannot be established: No matching nodes for remote name '{}' and remote address '{}'",
+ remoteName, remoteAddress);
+ } else if (matchingNodes.size() > 1 && !taskManager.isLocalNodeClusteringEnabled()) {
+ LOGGER.debug("Authenticity cannot be established: More than one matching node for remote name '{}' and "
+ + "remote address '{}' with local-node clustering disabled: {}", remoteName, remoteAddress, matchingNodes);
+ } else {
+ assert matchingNodes.size() == 1 || matchingNodes.size() > 1 && taskManager.isLocalNodeClusteringEnabled();
LOGGER.trace(
- "Matching result: Node(s) {} recognized as known (remote host name {} or IP address {} matched). Attempting to execute the requested operation: {}",
- allNodes, remoteName, remoteAddress, operation);
+ "Matching result: Node(s) {} recognized as known (remote host name {} or IP address {} matched).",
+ matchingNodes, remoteName, remoteAddress);
PrismObject actualNode = null;
- if (credentials != null) {
- for (PrismObject matchingNode : matchingNodes) {
- ProtectedStringType encryptedSecret = matchingNode.asObjectable().getSecret();
- if (encryptedSecret != null) {
- String plainSecret;
- try {
- plainSecret = protector.decryptString(encryptedSecret);
- } catch (EncryptionException e) {
- LoggingUtils.logUnexpectedException(LOGGER, "Couldn't decrypt node secret for {}", e, matchingNode);
- continue;
- }
- if (credentials.equals(plainSecret)) {
- LOGGER.debug("Node secret matches for {}", matchingNode);
- actualNode = matchingNode;
- break;
- } else {
- LOGGER.debug("Node secret does not match for {}", matchingNode);
- }
+ for (PrismObject matchingNode : matchingNodes) {
+ ProtectedStringType encryptedSecret = matchingNode.asObjectable().getSecret();
+ if (encryptedSecret != null) {
+ String plainSecret;
+ try {
+ plainSecret = protector.decryptString(encryptedSecret);
+ } catch (EncryptionException e) {
+ LoggingUtils.logUnexpectedException(LOGGER, "Couldn't decrypt node secret for {}", e, matchingNode);
+ continue;
+ }
+ if (credentials.equals(plainSecret)) {
+ LOGGER.debug("Node secret matches for {}", matchingNode);
+ actualNode = matchingNode;
+ break;
+ } else {
+ LOGGER.debug("Node secret does not match for {}", matchingNode);
}
+ } else {
+ LOGGER.debug("No secret known for node {}", matchingNode);
}
- } else {
- actualNode = matchingNodes.get(0);
}
if (actualNode != null) {
+ LOGGER.trace("Established authenticity for remote {}", actualNode);
NodeAuthenticationToken authNtoken = new NodeAuthenticationToken(actualNode, remoteAddress,
Collections.emptyList());
SecurityContextHolder.getContext().setAuthentication(authNtoken);
securityHelper.auditLoginSuccess(actualNode.asObjectable(), connEnv);
return true;
+ } else {
+ LOGGER.debug("Authenticity for {} couldn't be established: none of the secrets match", matchingNodes);
}
}
-
} catch (RuntimeException | SchemaException e) {
LOGGER.error("Unhandled exception when listing nodes");
LoggingUtils.logUnexpectedException(LOGGER, "Unhandled exception when listing nodes", e);
@@ -110,27 +118,24 @@ public boolean authenticate(@Nullable String remoteName, String remoteAddress, @
return false;
}
-private List> getMatchingNodes(List> knownNodes, String remoteName, String remoteAddress, String operation) {
- List> matchingNodes = new ArrayList<>();
- for (PrismObject node : knownNodes) {
- NodeType actualNode = node.asObjectable();
- if (remoteName != null && remoteName.equalsIgnoreCase(actualNode.getHostname())) {
- LOGGER.trace("The node {} was recognized as a known node (remote host name {} matched). Attempting to execute the requested operation: {} ",
- actualNode.getName(), actualNode.getHostname(), operation);
- matchingNodes.add(node);
- continue;
- }
- if (actualNode.getIpAddress().contains(remoteAddress)) {
- LOGGER.trace("The node {} was recognized as a known node (remote host address {} matched). Attempting to execute the requested operation: {} ",
- actualNode.getName(), remoteAddress, operation);
- matchingNodes.add(node);
- continue;
- }
- }
-
- return matchingNodes;
-}
-
-
-
+ private List> getMatchingNodes(List> knownNodes, String remoteName,
+ String remoteAddress) {
+ List> matchingNodes = new ArrayList<>();
+ for (PrismObject node : knownNodes) {
+ NodeType actualNode = node.asObjectable();
+ if (remoteName != null && remoteName.equalsIgnoreCase(actualNode.getHostname())) {
+ LOGGER.trace("The node {} was recognized as a known node (remote host name {} matched).",
+ actualNode.getName(), actualNode.getHostname());
+ matchingNodes.add(node);
+ continue;
+ }
+ if (actualNode.getIpAddress().contains(remoteAddress)) {
+ LOGGER.trace("The node {} was recognized as a known node (remote host address {} matched).",
+ actualNode.getName(), remoteAddress);
+ matchingNodes.add(node);
+ continue;
+ }
+ }
+ return matchingNodes;
+ }
}
diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java
index 35ef928292e..c18f3704ccf 100644
--- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java
+++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java
@@ -740,4 +740,11 @@ String recordTaskThreadsDump(String taskOid, String cause, OperationResult paren
* Use only for tests. Otherwise considered to be an ugly hack.
*/
RunningTask createFakeRunningTask(Task task);
+
+ TaskHandler getHandler(String handlerUri);
+
+ NodeType getLocalNode();
+
+ // TEMPORARY HACK -- DO NOT USE OUTSIDE task-quartz-impl module
+ Object getWorkStateManager();
}
diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java
index c26f85620b7..f5786467073 100644
--- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java
+++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java
@@ -42,6 +42,7 @@
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
+import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.jetbrains.annotations.NotNull;
@@ -91,7 +92,6 @@
import com.evolveum.midpoint.task.api.LightweightIdentifierGenerator;
import com.evolveum.midpoint.task.api.LightweightTaskHandler;
import com.evolveum.midpoint.task.api.RunningTask;
-import com.evolveum.midpoint.task.api.RunningTask;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.task.api.TaskCategory;
import com.evolveum.midpoint.task.api.TaskDeletionListener;
@@ -2548,5 +2548,8 @@ public RunningTaskQuartzImpl createFakeRunningTask(Task task) {
return createRunningTask(task);
}
-
+ @Override
+ public NodeType getLocalNode() {
+ return ObjectTypeUtil.asObjectable(clusterManager.getLocalNodeObject());
+ }
}
diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
index fcbe48703d4..80c223c505a 100644
--- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
+++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
@@ -34,6 +34,7 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType;
+import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
import org.apache.cxf.common.util.Base64Utility;
import org.apache.cxf.jaxrs.client.WebClient;
import org.jetbrains.annotations.NotNull;
@@ -110,14 +111,16 @@ public void execute(@NotNull NodeType node, @NotNull BiConsumer
Date: Fri, 1 Mar 2019 15:43:25 +0100
Subject: [PATCH 06/12] MID-5107 sorting for dropdown choices
---
.../AssignmentActivationPopupablePanel.html | 77 --------
.../AssignmentActivationPopupablePanel.java | 181 ------------------
.../component/input/DropDownChoicePanel.java | 19 +-
.../web/page/admin/server/PageTaskAdd.html | 2 +-
.../web/page/admin/server/PageTaskAdd.java | 13 +-
5 files changed, 23 insertions(+), 269 deletions(-)
delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html
delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html
deleted file mode 100644
index 5048d061eff..00000000000
--- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2010-2017 Evolveum
-*
-* 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* 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.
-*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java
deleted file mode 100644
index 50caabfb269..00000000000
--- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2010-2017 Evolveum
- *
- * 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.evolveum.midpoint.web.component.assignment;
-
-import com.evolveum.midpoint.gui.api.component.BasePanel;
-import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
-import com.evolveum.midpoint.web.component.AjaxButton;
-import com.evolveum.midpoint.web.component.DateInput;
-import com.evolveum.midpoint.web.component.dialog.Popupable;
-import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
-import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.StringResourceModel;
-
-/**
- * Created by honchar.
- * the panel could be used as a content panel for popup
- * window as well as a standard page activation panel
- */
-public class AssignmentActivationPopupablePanel extends BasePanel implements Popupable{
- private static final long serialVersionUID = 1L;
-
- private static final String ID_ACTIVATION = "activation";
- private static final String ID_ACTIVATION_BLOCK = "activationBlock";
- private static final String ID_ADMINISTRATIVE_STATUS = "administrativeStatus";
- private static final String ID_VALID_FROM = "validFrom";
- private static final String ID_VALID_TO = "validTo";
- private static final String ID_ADMIN_STATUS_CONTAINER = "administrativeStatusContainer";
- private static final String ID_VALID_FROM_CONTAINER = "validFromContainer";
- private static final String ID_VALID_TO_CONTAINER = "validToContainer";
- private static final String ID_OK_BUTTON = "okButton";
- private static final String ID_CANCEL_BUTTON = "cancelButton";
- private static final String ID_BUTTONS_PANEL = "buttonsPanel";
-
-
- public AssignmentActivationPopupablePanel(String id, IModel assignmentModel){
- super(id, assignmentModel);
- initModelObject();
- initLayout();
- }
-
- private void initModelObject(){
- if (getModelObject() == null){
- getModel().setObject(new ActivationType());
- }
- }
-
- private void initLayout(){
- WebMarkupContainer activationBlock = new WebMarkupContainer(ID_ACTIVATION_BLOCK);
- activationBlock.setOutputMarkupId(true);
- add(activationBlock);
-
- WebMarkupContainer adminStatusContainer = new WebMarkupContainer(ID_ADMIN_STATUS_CONTAINER);
- adminStatusContainer.setOutputMarkupId(true);
- activationBlock.add(adminStatusContainer);
-
- DropDownChoicePanel administrativeStatus = WebComponentUtil.createEnumPanel(
- ActivationStatusType.class, ID_ADMINISTRATIVE_STATUS,
- new PropertyModel(getModel(), ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart()),
- this);
- adminStatusContainer.add(administrativeStatus);
-
- WebMarkupContainer validFromContainer = new WebMarkupContainer(ID_VALID_FROM_CONTAINER);
- validFromContainer.setOutputMarkupId(true);
- activationBlock.add(validFromContainer);
-
- DateInput validFrom = new DateInput(ID_VALID_FROM,
- AssignmentsUtil.createDateModel(new PropertyModel<>(getModel(),
- ActivationType.F_VALID_FROM.getLocalPart())));
- validFromContainer.add(validFrom);
-
- WebMarkupContainer validToContainer = new WebMarkupContainer(ID_VALID_TO_CONTAINER);
- validToContainer.setOutputMarkupId(true);
- activationBlock.add(validToContainer);
-
- DateInput validTo = new DateInput(ID_VALID_TO,
- AssignmentsUtil.createDateModel(new PropertyModel<>(getModel(),
- ActivationType.F_VALID_TO.getLocalPart())));
- validToContainer.add(validTo);
-
- activationBlock.add(new VisibleEnableBehaviour() {
-
- @Override
- public boolean isVisible() {
- // enabled activation in assignments for now.
- return true;
- }
- });
-
- WebMarkupContainer buttonsPanel = new WebMarkupContainer(ID_BUTTONS_PANEL);
- buttonsPanel.setOutputMarkupId(true);
- buttonsPanel.add(new VisibleEnableBehaviour(){
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean isVisible(){
- return getButtonsPanelVisibility();
- }
- });
- add(buttonsPanel);
-
- AjaxButton okButton = new AjaxButton(ID_OK_BUTTON, createStringResource("AssignmentActivationPopupPanel.okButton")) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick(AjaxRequestTarget ajaxRequestTarget) {
- getPageBase().hideMainPopup(ajaxRequestTarget);
- reloadDateComponent(ajaxRequestTarget);
- }
- };
- buttonsPanel.add(okButton);
-
- AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("AssignmentActivationPopupPanel.cancelButton")) {
- private static final long serialVersionUID = 1L;
- @Override
- public void onClick(AjaxRequestTarget ajaxRequestTarget) {
- getPageBase().hideMainPopup(ajaxRequestTarget);
- }
- };
- buttonsPanel.add(cancelButton);
-
- WebComponentUtil.addAjaxOnUpdateBehavior((WebMarkupContainer)get(ID_ACTIVATION_BLOCK));
-
- }
-
- protected void reloadDateComponent(AjaxRequestTarget target){
- }
-
- protected boolean getButtonsPanelVisibility(){
- return true;
- }
-
- @Override
- public int getWidth(){
- return 600;
- }
-
- @Override
- public int getHeight(){
- return 300;
- }
-
- @Override
- public String getWidthUnit(){
- return "px";
- }
-
- @Override
- public String getHeightUnit(){
- return "px";
- }
-
- @Override
- public StringResourceModel getTitle(){
- return createStringResource("AssignmentActivationPopupPanel.title");
- }
-
- @Override
- public Component getComponent(){
- return this;
- }
-}
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java
index 21e8152cc33..cbb2ebdf569 100644
--- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java
+++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java
@@ -17,13 +17,17 @@
package com.evolveum.midpoint.web.component.input;
import java.util.List;
+import java.util.stream.Collectors;
+import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.web.component.prism.InputPanel;
+import org.apache.commons.lang.Validate;
import org.apache.wicket.markup.html.form.ChoiceRenderer;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
/**
* @author lazyman
@@ -49,7 +53,8 @@ public DropDownChoicePanel(String id, IModel model, IModel extends List e
boolean allowNull) {
super(id);
- DropDownChoice input = new DropDownChoice(ID_INPUT, model, choices, renderer) {
+ DropDownChoice input = new DropDownChoice(ID_INPUT, model,
+ Model.ofList(sortChoices(choices, renderer)), renderer) {
private static final long serialVersionUID = 1L;
@@ -71,6 +76,18 @@ protected String getNullValidDisplayValue() {
add(input);
}
+ private List sortChoices(IModel extends List extends T>> choicesModel, IChoiceRenderer renderer){
+ List sortedList = choicesModel.getObject().stream().sorted((choice1, choice2) -> {
+ Validate.notNull(choice1);
+ Validate.notNull(choice2);
+
+ return String.CASE_INSENSITIVE_ORDER.compare(renderer.getDisplayValue(choice1).toString(), renderer.getDisplayValue(choice2).toString());
+
+
+ }).collect(Collectors.toList());
+ return sortedList;
+ }
+
@Override
public DropDownChoice getBaseFormComponent() {
return (DropDownChoice) get("input");
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html
index 3f7e1dfdece..4d2da928c86 100644
--- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html
+++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html
@@ -37,7 +37,7 @@
-
+
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.java
index 43ba0a23811..c9fc2df55fd 100644
--- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.java
+++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.java
@@ -25,6 +25,7 @@
import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl;
import com.evolveum.midpoint.prism.delta.DeltaFactory;
+import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
import org.apache.commons.lang.StringUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -221,15 +222,9 @@ private void initLayout() {
Form mainForm = new com.evolveum.midpoint.web.component.form.Form(ID_FORM_MAIN);
add(mainForm);
- final DropDownChoice resource = new DropDownChoice<>(ID_RESOURCE,
+ final DropDownChoicePanel resource = new DropDownChoicePanel(ID_RESOURCE,
new PropertyModel<>(model, TaskAddDto.F_RESOURCE),
- new IModel>() {
-
- @Override
- public List getObject() {
- return createResourceList();
- }
- }, new ChoiceableChoiceRenderer<>());
+ Model.ofList(createResourceList()), new ChoiceableChoiceRenderer<>());
resource.add(new VisibleEnableBehaviour() {
@Override
@@ -241,7 +236,7 @@ public boolean isEnabled() {
return sync || recon || importAccounts;
}
});
- resource.add(new AjaxFormComponentUpdatingBehavior("change") {
+ resource.getBaseFormComponent().add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
From 53764243edab4ad5ccd16d27ab777f4d8488a31e Mon Sep 17 00:00:00 2001
From: Pavol Mederly
Date: Fri, 1 Mar 2019 16:29:38 +0100
Subject: [PATCH 07/12] Re-fix intra-cluster authentication (MID-5162)
Fix of fix of fix of fix of ...
---
.../task/quartzimpl/cluster/ClusterExecutionHelperImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
index 80c223c505a..4777e79d891 100644
--- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
+++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java
@@ -118,7 +118,7 @@ public void execute(@NotNull NodeType node, @NotNull BiConsumer
Date: Fri, 1 Mar 2019 18:26:49 +0100
Subject: [PATCH 08/12] Support for PolyString translation
---
.../midpoint/prism/polystring/PolyString.java | 44 ++++++
.../PolyStringTranslationArgumentType.java | 115 ++++++++++++++++
.../types_3/PolyStringTranslationType.java | 129 ++++++++++++++++++
.../ns/_public/types_3/PolyStringType.java | 49 +++++--
.../prism/impl/marshaller/BeanMarshaller.java | 10 +-
.../impl/marshaller/BeanUnmarshaller.java | 9 +-
.../impl/marshaller/PrismMarshaller.java | 30 +++-
.../main/resources/xml/ns/public/types-3.xsd | 73 +++++++++-
.../midpoint/prism/PrismInternalTestUtil.java | 37 ++++-
.../com/evolveum/midpoint/prism/TestFind.java | 2 +-
.../midpoint/prism/TestPrismParsing.java | 16 +--
.../common/json/user-jack-adhoc.json | 14 +-
.../common/json/user-jack-modified.json | 14 +-
.../common/json/user-jack-no-ns.json | 13 +-
.../test/resources/common/json/user-jack.json | 14 +-
.../resources/common/xml/user-jack-adhoc.xml | 7 +
.../common/xml/user-jack-modified.xml | 7 +
.../resources/common/xml/user-jack-no-ns.xml | 7 +
.../test/resources/common/xml/user-jack.xml | 7 +
.../common/yaml/user-jack-adhoc.yaml | 10 +-
.../common/yaml/user-jack-modified.yaml | 10 +-
.../common/yaml/user-jack-no-ns.yaml | 9 +-
.../test/resources/common/yaml/user-jack.yaml | 10 +-
23 files changed, 598 insertions(+), 38 deletions(-)
create mode 100644 infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationArgumentType.java
create mode 100644 infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationType.java
diff --git a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/polystring/PolyString.java b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/polystring/PolyString.java
index e3551ed0faa..841acd15469 100644
--- a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/polystring/PolyString.java
+++ b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/polystring/PolyString.java
@@ -25,6 +25,8 @@
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.ShortDumpable;
+import com.evolveum.midpoint.util.annotation.Experimental;
+import com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
import java.io.Serializable;
@@ -50,9 +52,11 @@ public class PolyString implements Matchable, Recomputable, Structur
public static final ItemName F_ORIG = new ItemName(PrismConstants.NS_TYPES, "orig");
public static final ItemName F_NORM = new ItemName(PrismConstants.NS_TYPES, "norm");
+ public static final ItemName F_TRANSLATION = new ItemName(PrismConstants.NS_TYPES, "translation");
private final String orig;
private String norm = null;
+ private PolyStringTranslationType translation;
public PolyString(String orig) {
super();
@@ -70,6 +74,11 @@ public PolyString(String orig, String norm) {
this.orig = orig;
this.norm = norm;
}
+
+ public PolyString(String orig, String norm, PolyStringTranslationType translation) {
+ this(orig, norm);
+ this.translation = translation;
+ }
public String getOrig() {
return orig;
@@ -79,6 +88,19 @@ public String getNorm() {
return norm;
}
+ public PolyStringTranslationType getTranslation() {
+ return translation;
+ }
+
+ /**
+ * Do NOT rely on this method too much. It may disappear later, e.g. when we align PolyString and PolyString type and
+ * make PolyString really immutable.
+ */
+ @Experimental
+ public void setTranslation(PolyStringTranslationType translation) {
+ this.translation = translation;
+ }
+
public boolean isEmpty() {
if (orig == null) {
return true;
@@ -111,6 +133,8 @@ public Object resolve(ItemPath subpath) {
return orig;
} else if (QNameUtil.match(F_NORM, itemName)) {
return norm;
+ } else if (QNameUtil.match(F_TRANSLATION, itemName)) {
+ return translation;
} else {
throw new IllegalArgumentException("Unknown path segment "+itemName);
}
@@ -184,6 +208,7 @@ public int hashCode() {
int result = 1;
result = prime * result + ((norm == null) ? 0 : norm.hashCode());
result = prime * result + ((orig == null) ? 0 : orig.hashCode());
+ result = prime * result + ((translation == null) ? 0 : translation.hashCode());
return result;
}
@@ -206,6 +231,11 @@ public boolean equals(Object obj) {
return false;
} else if (!orig.equals(other.orig))
return false;
+ if (translation == null) {
+ if (other.translation != null)
+ return false;
+ } else if (!translation.equals(other.translation))
+ return false;
return true;
}
@@ -241,6 +271,10 @@ public String debugDump(int indent) {
sb.append(",");
sb.append(norm);
}
+ if (translation != null) {
+ sb.append(";translation=");
+ sb.append(translation.getKey());
+ }
sb.append(")");
return sb.toString();
}
@@ -278,6 +312,15 @@ public boolean matches(String regex) {
return Pattern.matches(regex, norm) || Pattern.matches(regex, orig);
}
+ /**
+ * Returns true if the PolyString form contains only simple string.
+ * I.e. returns true if the polystring can be serialized in a simplified form of a single string.
+ * Returns true in case that there are language mutations, translation, etc.
+ */
+ public boolean isSimple() {
+ return translation == null;
+ }
+
@Override
public void checkConsistence() {
if (orig == null) {
@@ -299,4 +342,5 @@ public static PolyStringType toPolyStringType(PolyString value) {
public static PolyString fromOrig(String orig) {
return new PolyString(orig);
}
+
}
diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationArgumentType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationArgumentType.java
new file mode 100644
index 00000000000..a638f4e632a
--- /dev/null
+++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationArgumentType.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2019 Evolveum
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.04 at 01:34:24 PM CET
+//
+
+
+package com.evolveum.prism.xml.ns._public.types_3;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+
+/**
+ * WARNING: this is NOT a generated code.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PolyStringTranslationArgumentType", propOrder = {
+ "value",
+ "translation"
+})
+public class PolyStringTranslationArgumentType implements Serializable, Cloneable {
+ private static final long serialVersionUID = 1L;
+
+ public static final QName COMPLEX_TYPE = new QName("http://prism.evolveum.com/xml/ns/public/types-3", "PolyStringTranslationArgumentType");
+
+ protected String value;
+ protected PolyStringTranslationType translation;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public PolyStringTranslationType getTranslation() {
+ return translation;
+ }
+
+ public void setTranslation(PolyStringTranslationType translation) {
+ this.translation = translation;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((translation == null) ? 0 : translation.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PolyStringTranslationArgumentType other = (PolyStringTranslationArgumentType) obj;
+ if (translation == null) {
+ if (other.translation != null)
+ return false;
+ } else if (!translation.equals(other.translation))
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "PolyStringTranslationArgumentType(value=" + value + ", translation=" + translation + ")";
+ }
+
+ @Override
+ public PolyStringTranslationArgumentType clone() {
+ PolyStringTranslationArgumentType cloned = new PolyStringTranslationArgumentType();
+ cloned.setValue(value);
+ if (translation != null) {
+ cloned.setTranslation(translation.clone());
+ }
+ return cloned;
+ }
+}
diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationType.java
new file mode 100644
index 00000000000..09025dfdfde
--- /dev/null
+++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringTranslationType.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2019 Evolveum
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ */
+
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2014.02.04 at 01:34:24 PM CET
+//
+
+
+package com.evolveum.prism.xml.ns._public.types_3;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+
+/**
+ * WARNING: this is NOT a generated code.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PolyStringTranslationType", propOrder = {
+ "key",
+ "fallback",
+ "argument"
+})
+public class PolyStringTranslationType implements Serializable, Cloneable {
+ private static final long serialVersionUID = 1L;
+
+ public static final QName COMPLEX_TYPE = new QName("http://prism.evolveum.com/xml/ns/public/types-3", "PolyStringTranslationType");
+
+ @XmlElement(required = true)
+ protected String key;
+ protected String fallback;
+ protected final List argument = new ArrayList<>();
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getFallback() {
+ return fallback;
+ }
+
+ public void setFallback(String fallback) {
+ this.fallback = fallback;
+ }
+
+ public List getArgument() {
+ return argument;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((argument == null) ? 0 : argument.hashCode());
+ result = prime * result + ((fallback == null) ? 0 : fallback.hashCode());
+ result = prime * result + ((key == null) ? 0 : key.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PolyStringTranslationType other = (PolyStringTranslationType) obj;
+ if (argument == null) {
+ if (other.argument != null)
+ return false;
+ } else if (!argument.equals(other.argument))
+ return false;
+ if (fallback == null) {
+ if (other.fallback != null)
+ return false;
+ } else if (!fallback.equals(other.fallback))
+ return false;
+ if (key == null) {
+ if (other.key != null)
+ return false;
+ } else if (!key.equals(other.key))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "PolyStringTranslationType(key=" + key + ", fallback=" + fallback + ", argument=" + argument + ")";
+ }
+
+ @Override
+ public PolyStringTranslationType clone() {
+ PolyStringTranslationType cloned = new PolyStringTranslationType();
+ cloned.setKey(getKey());
+ cloned.setFallback(getFallback());
+ for (PolyStringTranslationArgumentType argument : getArgument()) {
+ cloned.getArgument().add(argument.clone());
+ }
+ return cloned;
+ }
+}
diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringType.java
index 4a058a34c15..09b943264b9 100644
--- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringType.java
+++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/PolyStringType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Evolveum
+ * Copyright (c) 2010-2019 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -86,15 +86,21 @@
@XmlType(name = "PolyStringType", propOrder = {
"orig",
"norm",
+ "translation",
"any"
})
public class PolyStringType implements DebugDumpable, Serializable, Cloneable {
+ private static final long serialVersionUID = 1L;
public static final QName COMPLEX_TYPE = new QName("http://prism.evolveum.com/xml/ns/public/types-3", "PolyStringType");
@XmlElement(required = true)
protected String orig;
+
protected String norm;
+
+ protected PolyStringTranslationType translation;
+
@XmlAnyElement(lax = true)
protected List