private static ApplicationSchemaDefinition GetListSchema(ApplicationCompositionSchema applicationCompositionSchema, CompleteApplicationMetadataDefinition compositionApplication) { var collectionSchema = (ApplicationCompositionCollectionSchema)applicationCompositionSchema; var listKey = new ApplicationMetadataSchemaKey(collectionSchema.CollectionProperties.ListSchema, applicationCompositionSchema.RenderMode, ClientPlatform.Web); return(compositionApplication.Schemas()[listKey]); }
private bool ShouldPaginate(ApplicationCompositionSchema compositionSchema, PaginatedSearchRequestDto paginatedSearch) { var listSchema = compositionSchema.Schemas.List; var paginationDisabled = listSchema.GetProperty("pagination.disabled"); // did not disable via metadata and requested paginated content //hapag asked to disable whole pagination return(false); }
/// <summary> /// If there´s a schema named print, use it, otherwise fallback to detail /// </summary> /// <param name="compositionSchema"></param> /// <param name="compositionApplication"></param> /// <returns></returns> private static ApplicationSchemaDefinition GetPrintSchema(ApplicationCompositionSchema compositionSchema, CompleteApplicationMetadataDefinition compositionApplication, ApplicationSchemaDefinition detailSchema, ApplicationSchemaDefinition listSchema) { var applicationSchemaDefinitions = compositionApplication.Schemas(); var printKey = new ApplicationMetadataSchemaKey(compositionSchema.PrintSchema, compositionSchema.RenderMode, ClientPlatform.Web); if (applicationSchemaDefinitions.ContainsKey(printKey)) { return(applicationSchemaDefinitions[printKey]); } return(detailSchema ?? listSchema); }
private static ApplicationSchemaDefinition GetDetailSchema(CompleteApplicationMetadataDefinition compositionApplication, ApplicationCompositionSchema compositionSchema) { if (compositionSchema.DetailSchema == "") { //This means that the composition is only needed for list visualization return(null); } var detailKey = new ApplicationMetadataSchemaKey(compositionSchema.DetailSchema, compositionSchema.RenderMode, ClientPlatform.Web); var applicationSchemaDefinitions = compositionApplication.Schemas(); if (!applicationSchemaDefinitions.ContainsKey(detailKey)) { throw ExceptionUtil.MetadataException( "detail composition schema {0} not found for application {1}. Use \"\" if you want to specify that this is used only for list", detailKey, compositionApplication.ApplicationName); } return(applicationSchemaDefinitions[detailKey]); }
internal void BuildProjection(ApplicationCompositionSchema schema, bool printMode = false) { var schemaToUse = printMode ? schema.Schemas.Print : schema.Schemas.List; var columns = schemaToUse.Displayables; foreach (var column in columns) { var displayable = column as IApplicationAttributeDisplayable; if (displayable == null || displayable.Attribute == null) { //displayable.Attribute might be null in case of sections continue; } AppendProjectionField(new ProjectionField { Name = displayable.Attribute, Alias = displayable.Attribute }); } }