Skip to content

Commit

Permalink
fix for getting of refined schema on account tab panel (MID-7560)
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jan 20, 2022
1 parent 8803ea6 commit 14ed3f0
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,16 @@ private ResourceContentResourcePanel initResourceContent(IModel<PrismObjectWrapp
String searchMode = isRepoSearch ? SessionStorage.KEY_RESOURCE_PAGE_REPOSITORY_CONTENT :
SessionStorage.KEY_RESOURCE_PAGE_RESOURCE_CONTENT;
ResourceContentResourcePanel resourceContent = new ResourceContentResourcePanel(ID_TABLE, loadResourceModel(),
getObjectClass(), getKind(), getIntent(), searchMode, getPanelConfiguration());
getObjectClass(), getKind(), getIntent(), searchMode, getPanelConfiguration()){
@Override
protected ResourceSchema getRefinedSchema() throws SchemaException {
try {
return super.getRefinedSchema();
} catch (SchemaException e) {
return getObjectDetailsModels().getRefinedSchema();
}
}
};
resourceContent.setOutputMarkupId(true);
return resourceContent;

Expand All @@ -312,7 +321,16 @@ private ResourceContentRepositoryPanel initRepoContent(IModel<PrismObjectWrapper
String searchMode = isRepoSearch ? SessionStorage.KEY_RESOURCE_PAGE_REPOSITORY_CONTENT :
SessionStorage.KEY_RESOURCE_PAGE_RESOURCE_CONTENT;
ResourceContentRepositoryPanel repositoryContent = new ResourceContentRepositoryPanel(ID_TABLE, loadResourceModel(),
getObjectClass(), getKind(), getIntent(), searchMode, getPanelConfiguration());
getObjectClass(), getKind(), getIntent(), searchMode, getPanelConfiguration()){
@Override
protected ResourceSchema getRefinedSchema() throws SchemaException {
try {
return super.getRefinedSchema();
} catch (SchemaException e) {
return getObjectDetailsModels().getRefinedSchema();
}
}
};
repositoryContent.setOutputMarkupId(true);
return repositoryContent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public QName getObjectClass() {
}

public ResourceObjectDefinition getDefinitionByKind() throws SchemaException {
ResourceSchema refinedSchema = ResourceSchemaFactory.getCompleteSchema(resourceModel.getObject());
ResourceSchema refinedSchema = getRefinedSchema();
if (refinedSchema == null) {
warn("No schema found in resource. Please check your configuration and try to test connection for the resource.");
return null;
Expand All @@ -176,7 +176,7 @@ public ResourceObjectDefinition getDefinitionByKind() throws SchemaException {
}

public ResourceObjectDefinition getDefinitionByObjectClass() throws SchemaException {
ResourceSchema refinedSchema = ResourceSchemaFactory.getCompleteSchema(resourceModel.getObject());
ResourceSchema refinedSchema = getRefinedSchema();
if (refinedSchema == null) {
warn("No schema found in resource. Please check your configuration and try to test connection for the resource.");
return null;
Expand All @@ -185,6 +185,10 @@ public ResourceObjectDefinition getDefinitionByObjectClass() throws SchemaExcept

}

protected ResourceSchema getRefinedSchema() throws SchemaException {
return ResourceSchemaFactory.getCompleteSchema(resourceModel.getObject());
}

private UserProfileStorage.TableId getTableId() {
if (kind == null) {
return UserProfileStorage.TableId.PAGE_RESOURCE_OBJECT_CLASS_PANEL;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
~ Copyright (c) 2020 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<archetype oid="00000000-0000-0000-0000-000000000529"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">
<name>System task</name>
<archetypePolicy>
<display>
<label>System task</label>
<pluralLabel>
<orig>System tasks</orig>
<translation>
<key>SystemTasks.title</key>
</translation>
</pluralLabel>
<icon>
<cssClass>fa fa-save</cssClass>
<color>green</color>
</icon>
</display>
<!-- no configuration yet -->
</archetypePolicy>
<assignment>
<assignmentRelation>
<holderType>TaskType</holderType>
</assignmentRelation>
</assignment>
<inducement>
<focusMappings>
<mapping>
<strength>weak</strength>
<expression>
<value>System</value>
</expression>
<target>
<c:path>category</c:path>
</target>
</mapping>
</focusMappings>
</inducement>
</archetype>

0 comments on commit 14ed3f0

Please sign in to comment.