001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019
020package org.apache.isis.core.metamodel.consent;
021
022import org.apache.isis.core.metamodel.interactions.InteractionContext;
023
024/**
025 * Powertype for the {@link InteractionContext} hierarchy.
026 * 
027 */
028public enum InteractionContextType {
029
030    /**
031     * Persisting the object.
032     */
033    OBJECT_VALIDATE("Saving or updating object"),
034    /**
035     * Accessing the object's title.
036     */
037    OBJECT_TITLE("Reading object's title"),
038    /**
039     * Determining whether the property of the object is visible (or has been
040     * hidden).
041     */
042    PROPERTY_VISIBLE("View property"),
043    /**
044     * Determining whether the property of the object is either readable or
045     * modifiable (or has been disabled).
046     */
047    PROPERTY_USABLE("Use property"),
048    /**
049     * Reading the current value of the property of the object.
050     */
051    PROPERTY_READ("Read property"),
052    /**
053     * Modifying (or attempting to modify) the value of a property.
054     */
055    PROPERTY_MODIFY("Modify property"),
056    /**
057     * Determining whether the collection of the object is visible (or has been
058     * hidden).
059     */
060    COLLECTION_VISIBLE("View collection"),
061    /**
062     * Determining whether the collection of the object is either readable or
063     * modifiable (or has been disabled).
064     */
065    COLLECTION_USABLE("Use collection"),
066    /**
067     * Reading the contents of the collection.
068     */
069    COLLECTION_READ("Read contents of collection"),
070    /**
071     * Adding to (or attempting to add to) a collection.
072     */
073    COLLECTION_ADD_TO("Add to collection"),
074    /**
075     * Removing from (or attempting to remove from) a collection.
076     */
077    COLLECTION_REMOVE_FROM("Remove from collection"),
078    /**
079     * Whether the action of the object is visible (or has been hidden).
080     */
081    ACTION_VISIBLE("View action"),
082    /**
083     * Whether the action of the object is usable (or has been disabled).
084     */
085    ACTION_USABLE("Use action"),
086    /**
087     * Whether this particular proposed argument for an action invocation is
088     * valid (or if it is in fact invalid).
089     * 
090     * <p>
091     * For example, ensuring that a regular expression match or number range is
092     * correct.
093     */
094    ACTION_PROPOSED_ARGUMENT("Proposed argument"),
095    /**
096     * Invoking (or attempting to invoke) an action.
097     * 
098     * <p>
099     * Even if each of the {@link #ACTION_PROPOSED_ARGUMENT proposed arguments}
100     * are valid, it may not be possible to invoke the action if there the
101     * arguments together are invalid (for example,
102     * <tt>startDate &gt; endDate</tt>).
103     */
104    ACTION_INVOKE("Invoke action"),
105
106    /**
107     * Parsing a value (could be an property or an action argument).
108     */
109    PARSE_VALUE("Parsing value");
110
111    private final String description;
112
113    private InteractionContextType(final String description) {
114        this.description = description;
115    }
116
117    public String getDescription() {
118        return description;
119    }
120
121}