andi-huber commented on code in PR #3516: URL: https://github.com/apache/causeway/pull/3516#discussion_r3218609582
########## api/applib/src/main/java/org/apache/causeway/applib/services/columnorder/Object_patchColumnOrder.java: ########## @@ -0,0 +1,123 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.causeway.applib.services.columnorder; + +import java.util.List; +import java.util.stream.Collectors; + +import jakarta.inject.Inject; + +import org.apache.causeway.applib.Identifier; +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.ActionLayout; +import org.apache.causeway.applib.annotation.DomainObject; +import org.apache.causeway.applib.annotation.Introspection; +import org.apache.causeway.applib.annotation.MemberSupport; +import org.apache.causeway.applib.annotation.Nature; +import org.apache.causeway.applib.annotation.Optionality; +import org.apache.causeway.applib.annotation.Parameter; +import org.apache.causeway.applib.annotation.ParameterLayout; +import org.apache.causeway.applib.annotation.PrecedingParamsPolicy; +import org.apache.causeway.applib.annotation.Publishing; +import org.apache.causeway.applib.annotation.RestrictTo; +import org.apache.causeway.applib.annotation.SemanticsOf; +import org.apache.causeway.applib.layout.LayoutConstants; +import org.apache.causeway.applib.services.appfeat.ApplicationFeatureId; +import org.apache.causeway.applib.services.appfeat.ApplicationFeatureRepository; +import org.apache.causeway.applib.services.metamodel.MetaModelService; + +import lombok.RequiredArgsConstructor; + +/** + * Allows uploading of column order definition, that overrules the default lookup for such information. + * + * @since 4.0 {@index} + */ +@Action( + domainEvent = Object_patchColumnOrder.ActionDomainEvent.class, + semantics = SemanticsOf.IDEMPOTENT, + commandPublishing = Publishing.DISABLED, + executionPublishing = Publishing.DISABLED, + restrictTo = RestrictTo.PROTOTYPING) +@ActionLayout( + cssClassFa = "solid file-arrow-up", + describedAs = "Uploads table column order, to be stored in memory for this object type. " + + "It overrules the default lookup. " + + "On application restart this information is lost.", + fieldSetId = LayoutConstants.FieldSetId.METADATA, + position = ActionLayout.Position.PANEL_DROPDOWN, + sequence = "700.2.4" +) +//framework provided domain objects and mixins should explicitly specify their introspection policy +@DomainObject(nature=Nature.MIXIN, mixinMethod = "act", introspection = Introspection.ANNOTATION_REQUIRED) +@RequiredArgsConstructor +public class Object_patchColumnOrder { + + public static class ActionDomainEvent + extends org.apache.causeway.applib.CausewayModuleApplib.ActionDomainEvent<Object_patchColumnOrder> {} + + @Inject MetaModelService metaModelService; + @Inject ApplicationFeatureRepository applicationFeatureRepository; + + private final Object mixee; + + @MemberSupport public Object act( Review Comment: general open question: how to deal with cases, where the concrete domain-object is an instance of the table's element type, but not the exact same type? we'd need another parameter, that reflects type inheritance and provides a means for users to make their element-type choice -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
