KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > repository > IContentRepository


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jul 1, 2005
14  * @author Marc Batchelor
15  *
16  */

17
18 package org.pentaho.core.repository;
19
20 import java.util.Date JavaDoc;
21 import java.util.List JavaDoc;
22
23 import org.pentaho.core.session.IPentahoSession;
24 import org.pentaho.core.repository.RepositoryException;
25
26 /**
27  * The ContentRepository is responsible for all the DAO calls used to get
28  * content items out of a repository. This interface is used to create
29  * <tt>IContentLocation</tt> objects. The <tt>IContentLocation</tt> object can then
30  * be used to create child <tt>IContentItem</tt> objects.
31  * @author mbatchel
32  *
33  */

34
35 public interface IContentRepository {
36
37     /**
38      * Creates a new Content Location. A content location is analogous to a
39      * folder
40      *
41      * @param thePath
42      * The path
43      * @param theName
44      * The name of the location
45      * @param description
46      * The description of the location
47      * @param solutionId
48      * The Id of the solution
49      * @param createIfNotExists
50      * Attempt to create the physical folder on the hard drive
51      * @return The new content location
52      * @throws RepositoryException
53      */

54     public IContentLocation newContentLocation(String JavaDoc thePath, String JavaDoc theName, String JavaDoc description, String JavaDoc solutionId, boolean createIfNotExists) throws RepositoryException;
55
56     /**
57      * Retrieves a content location by the path.
58      *
59      * @param thePath
60      * The path to search for
61      * @return The content location
62      * @throws RepositoryException
63      */

64     public IContentLocation getContentLocationByPath(String JavaDoc thePath) throws RepositoryException;
65
66     /**
67      * Retrieves a content location by Id. This is the most efficient way to
68      * retrieve a content location
69      *
70      * @param theId
71      * The Id to retrieve
72      * @return The content location
73      */

74     public IContentLocation getContentLocationById(String JavaDoc theId);
75
76     /**
77      * Gets a content item by path
78      *
79      * @param thePath
80      * The path of the content item to find
81      * @return The Content Item with the specified path
82      */

83     public IContentItem getContentItemByPath(String JavaDoc thePath);
84
85     /**
86      * Gets a content item by id. This is the most efficient way to retrieve a
87      * content item.
88      *
89      * @param id
90      * The id of the content item to find
91      * @return The Content Item with the specified path
92      */

93     public IContentItem getContentItemById(String JavaDoc theId);
94
95     /**
96      * @return A list of all content locations
97      */

98     public List JavaDoc getAllContentLocations();
99
100     /**
101      * Content Location finder - searches for the terms amongst the content
102      * locations
103      *
104      * @param searchTerm
105      * The search term(s) to find
106      * @param searchType
107      * @see org.pentaho.repository.ISearchable
108      * @return List of matching Content Locations.
109      */

110     public List JavaDoc searchLocationsForTerms(String JavaDoc searchTerm, int searchType);
111
112     /**
113      * Content Item finder - searches for the terms amongst content items
114      *
115      * @param searchTerm
116      * The search term(s) to find
117      * @param searchType
118      * @see org.pentaho.repository.ISearchable
119      * @return List of matching Content Items.
120      */

121     public List JavaDoc searchContentItemsForTerms(String JavaDoc searchTerm, int searchType);
122
123     /**
124      * Content Location and Item finder - Simply aggregates the output of the
125      * searchLocationsForTerms and searchContentItemsForTerms.
126      *
127      * @param searchTerm
128      * The search term(s) to find
129      * @param searchType
130      * @see org.pentaho.repository.ISearchable
131      * @return List of matching Content Locations first, followed by Content
132      * Items.
133      */

134     public List JavaDoc searchLocationsAndItemsForTerms(String JavaDoc searchTerm, int searchType);
135
136     /**
137      * @param session
138      * Sets the IPentahoSession Content Repository. This also begins
139      * the Hibernate transaction.
140      */

141     public void setSession(IPentahoSession session);
142
143     /**
144      * This method is used to delete ContentItemFile objects that are older than
145      * the specified date.
146      *
147      * @param agingDate
148      * Date to use for selecting items for deleting. The argument is
149      * used as a "Less Than". The date is NOT inclusive. I.e., not
150      * "Less Than or Equal To".
151      * @return Count of content item files that were removed from the content
152      * repository and the file system.
153      */

154     public int deleteContentOlderThanDate(Date JavaDoc agingDate);
155
156     /**
157      * Returns a new background executed content object
158      * @param session Users' session object
159      * @param contentId The content id to reference.
160      * @return new BackgroundExecutedContent
161      */

162     public IBackgroundExecutedContentId newBackgroundExecutedContentId(IPentahoSession session, String JavaDoc contentId);
163     
164     /**
165      * Gets list of Content Items from a users' background execution list.
166      * @param session The users' session
167      * @return List of IContentItem objects
168      */

169     public List JavaDoc getBackgroundExecutedContentItemsForUser(IPentahoSession session);
170     
171     /**
172      * Gets list of all content items in the Background Execution id list. Should only be used in an administrative capacity
173      * @param session Users session
174      * @return List of IContentItem objects
175      */

176     public List JavaDoc getAllBackgroundExecutedContentItems(IPentahoSession session);
177     
178     /**
179      * Removes an ID from the background executed content Id list
180      * @param session Users' session
181      * @param contentId The content id to remove.
182      */

183     public void removeBackgroundExecutedContentId(IPentahoSession session, String JavaDoc contentId);
184     
185 }
186
Popular Tags