View Javadoc

1   /**
2    * Copyright (C) 2005-2009 Alfresco Software Limited.
3    *
4    * This file is part of the Spring Surf Extension project.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *  http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.springframework.extensions.surf.types;
20  
21  import org.springframework.extensions.surf.ModelObject;
22  import org.springframework.extensions.surf.RequestContext;
23  
24  /**
25   * Interface for a ContentAssociation object type
26   * 
27   * @author muzquiano
28   */
29  public interface ContentAssociation extends ModelObject
30  {
31      // type
32      public static String TYPE_ID = "content-association";
33      
34      // properties
35      public static String PROP_SOURCE_ID = "source-id";
36      public static String PROP_SOURCE_TYPE = "source-type";
37      public static String PROP_DEST_ID = "dest-id";
38      public static String PROP_ASSOC_TYPE = "assoc-type";
39      public static String PROP_FORMAT_ID = "format-id";    
40      
41      /**
42       * Gets the source id.
43       * 
44       * @return the source id
45       */
46      public String getSourceId();
47  
48      /**
49       * Sets the source id.
50       * 
51       * @param sourceId the new source id
52       */
53      public void setSourceId(String sourceId);
54  
55      /**
56       * Gets the dest id.
57       * 
58       * @return the dest id
59       */
60      public String getDestId();
61  
62      /**
63       * Sets the dest id.
64       * 
65       * @param destId the new dest id
66       */
67      public void setDestId(String destId);
68  
69      /**
70       * Gets the association type.
71       * 
72       * @return the association type
73       */
74      public String getAssociationType();
75  
76      /**
77       * Sets the source type.
78       * 
79       * @param sourceType the source type
80       */
81      public void setSourceType(String sourceType);
82  
83      /**
84       * Gets the source type.
85       * 
86       * @return the source type
87       */
88      public String getSourceType();
89  
90      /**
91       * Sets the association type.
92       * 
93       * @param associationType the new association type
94       */
95      public void setAssociationType(String associationType);
96  
97      /**
98       * Gets the format id.
99       * 
100      * @return the format id
101      */
102     public String getFormatId();
103 
104     /**
105      * Sets the format id.
106      * 
107      * @param formatId the new format id
108      */
109     public void setFormatId(String formatId);
110 
111     // Helpers
112 
113     /**
114      * Gets the object that is being associated.
115      * This is generally a template or a page.
116      * 
117      * @param context the context
118      * 
119      * @return the page
120      */
121     public ModelObject getObject(RequestContext context);
122     
123     /**
124      * Checks if is template association.
125      * 
126      * @return true, if is template association
127      */
128     public boolean isTemplateAssociation();
129     
130     /**
131      * Checks if is page association.
132      * 
133      * @return true, if is page association
134      */
135     public boolean isPageAssociation();
136     
137 }