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 916024b commit 5670d4a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,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 RefinedResourceSchema getRefinedSchema() throws SchemaException {
try {
return super.getRefinedSchema();
} catch (SchemaException e) {
return getObjectDetailsModels().getRefinedSchema();
}
}
};
resourceContent.setOutputMarkupId(true);
return resourceContent;

Expand All @@ -321,7 +330,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 RefinedResourceSchema 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 @@ -166,8 +166,7 @@ public QName getObjectClass() {
}

public RefinedObjectClassDefinition getDefinitionByKind() throws SchemaException {
RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl
.getRefinedSchema(resourceModel.getObject(), getPageBase().getPrismContext());
RefinedResourceSchema 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,8 +175,7 @@ public RefinedObjectClassDefinition getDefinitionByKind() throws SchemaException
}

public RefinedObjectClassDefinition getDefinitionByObjectClass() throws SchemaException {
RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl
.getRefinedSchema(resourceModel.getObject(), getPageBase().getPrismContext());
RefinedResourceSchema 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 @@ -186,6 +184,10 @@ public RefinedObjectClassDefinition getDefinitionByObjectClass() throws SchemaEx

}

protected RefinedResourceSchema getRefinedSchema() throws SchemaException {
return RefinedResourceSchemaImpl.getRefinedSchema(resourceModel.getObject(), getPageBase().getPrismContext());
}

private UserProfileStorage.TableId getTableId() {
if (kind == null) {
return UserProfileStorage.TableId.PAGE_RESOURCE_OBJECT_CLASS_PANEL;
Expand Down

0 comments on commit 5670d4a

Please sign in to comment.