1   package hudsonfog.voc.system;
2   
3   import com.fogx.webdav.DavResource;
4   import com.fogx.webdav.DavClass;
5   import com.fogx.webdav.DavBean;
6   import com.fogx.webdav.DavProperty;
7   import static com.fogx.webdav.DavProperty.*;
8   import com.fogx.webdav.packages.DavBeanPackage;
9   import com.fogx.webdav.util.DavResourceSupport;
10  import com.fogx.webdav.util.UrlUtil;
11  import java.util.Date;
12  import java.util.Map;
13  import java.util.HashMap;
14  import java.util.List;
15  import java.util.Collections;
16  import java.util.Arrays;
17  
18  import hudsonfog.voc.system.primitiveTypes.*;
19  import hudsonfog.voc.system.XMLSchema.*;
20  
21  import hudsonfog.voc.system.fog.*;
22  
23  
24  public abstract class fog {
25  
26    /**
27   * Context is created for each vocabulary file.
28   */
29    public static class Context {
30           @_maxSize(100)
31        @k public String                        ns;
32           @_backLink("context")
33           public Namespace[]                   namespaces;
34    }
35  
36    /**
37   * Namespace (import) defined within the Context (file).
38   */
39    public static class Namespace {
40           @_maxSize(100)
41        @k public String                        ns;
42           @_maxSize(100)
43        @k public String                        alias;
44           @_maxSize(300)
45           public String                        url;
46           public Context                       context;
47    }
48  
49    /**
50   * Identifies an interface within the Context (file).
51   */
52    public static class Interface {
53        @k public DavClass                      implementation;
54        @k public DavClass                      definition;
55    }
56  
57    /**
58   * Resource that identifies the scope whithin which Resources were entered or
59   * modified in the system. Creates the basis for long-running transactions.
60   * Each Resource points to Entry via partOf property.
61   */
62    @DavClass._copyByReference
63    @DavClass._avoidIndexing
64    public static class Entry {
65           @_maxSize(10000)
66           @_avoidDisplaying
67           public String                        forClasses;
68           @_dateFormat("~MMM-dd, yyyy HH:mm")
69           @_readOnly
70           @_sortAscending(false)
71           public dateTime                      entered; //* when information for this Entry was received by the system
72           @_dateFormat("~MMM-dd, yyyy HH:mm")
73           @_readOnly
74           public dateTime                      completed; //* when processing for this Entry was completed
75    }
76  
77    /**
78   * Top class that serves as a marker.
79   * Subclasses are shown in the listbox.
80   *
81   * @deprecated since 2.2, Use enumeration instead
82   */
83    public static class ListItem {
84    }
85  
86    /**
87   * This interface is used in case when property may have multiple values (constrained by Enum).
88   * Each resource of type MultiValueEnum is backlinked to a resource for which the value is specified.
89   */
90    @DavClass._avoidIndexing
91    public static interface MultiValueEnum {
92           public DavResource                   forResource = null;
93           public String                        value = null;
94    }
95  
96    /**
97   * a typical web href
98   */
99    @DavClass._alwaysInlined
100   public static class Url {
101          @_mainValue
102          @_maxSize(4000)
103          @_displayNameElm
104       @k public String                        href;
105          @_maxSize(200)
106          public String                        linkText;
107   }
108 
109   /**
110  * Top class that serves as a marker.
111  * Subclasses are shown in semantic directory, and their resources are full-text indexed.
112  */
113   @DavClass._abstract
114   public static abstract class Category {
115   }
116 
117   /**
118  * used to automatically add filters to a class query (for data access control)
119  */
120   public static class JoinQuery {
121          public DavClass                      fromClass;
122          public DavClass                      toClass;
123          public DavProperty                   fromProperty;
124          @_maxSize(200)
125          public String                        toConst;
126          public DavResource                   toResource;
127          @_maxSize(100)
128          public String                        joinToHost;
129   }
130 
131   /**
132  * Top class for all the initial Resources created from imported documents
133  */
134   @DavClass._avoidCaching
135   @DavClass._avoidIndexing
136   @DavClass._avoidExtraIndexes
137   @DavClass._notSiteSharable
138   @DavClass._abstract
139   public static abstract class DocItem {
140          @_excludeFromDuplicateChecking
141          public Integer                       rowNumber;
142          @_index
143          public Integer                       hash1;
144   }
145 
146   /**
147  * Action that can be/was applied to a Resource
148  */
149   @DavClass._abstract
150   public static abstract class Action {
151   }
152 
153   /**
154  * This is used in place of 'date' type to allow aggregations by year, month, etc.
155  */
156   @DavClass._alwaysIndex
157   @DavClass._alwaysInlined
158   @DavClass._inTimeUnits("TimeUnitTypes")
159   public static class ComplexDate {
160          @_mainValue
161          @_dateFormat("~MMM dd, yyyy")
162       @k public dateTime                      date;
163          @_label("day")
164          public Integer                       day;
165          @_label("month")
166          public Integer                       month;
167          @_label("week")
168          public Integer                       week;
169          @_label("quarter")
170          public Integer                       quarter;
171          @_label("year")
172          public Integer                       year;
173   }
174 
175   public static enum TimeUnitTypes {
176     today, yesterday, @_label("2 days ago") _2DaysAgo, @_label("week ago") weekAgo, @_label("month ago") monthAgo, @_label("2 month ago") _2MonthAgo, tomorrow, @_label("day after tomorrow") dayAfterTomorrow, @_label("week ahead") weekAhead, @_label("month ahead") monthAhead, @_label("2 months ahead") _2MonthsAhead;
177   }
178 
179   public static enum TimeUnits {
180     @_label("0") _0, @_label("-1") __1, @_label("-2") __2, @_label("-7") __7, @_label("-30") __30, @_label("-60") __60, @_label("1") _1, @_label("2") _2, @_label("7") _7, @_label("30") _30, @_label("60") _60;
181   }
182 }
183