001: /* ***** BEGIN LICENSE BLOCK *****
002: * Version: MPL 1.1
003: * The contents of this file are subject to the Mozilla Public License Version
004: * 1.1 (the "License"); you may not use this file except in compliance with
005: * the License. You may obtain a copy of the License at
006: * http://www.mozilla.org/MPL/
007: *
008: * Software distributed under the License is distributed on an "AS IS" basis,
009: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
010: * for the specific language governing rights and limitations under the
011: * License.
012: *
013: * The Original Code is Riot.
014: *
015: * The Initial Developer of the Original Code is
016: * Neteye GmbH.
017: * Portions created by the Initial Developer are Copyright (C) 2006
018: * the Initial Developer. All Rights Reserved.
019: *
020: * Contributor(s):
021: * Felix Gnass [fgnass at neteye dot de]
022: *
023: * ***** END LICENSE BLOCK ***** */
024: package org.riotfamily.components.dao;
025:
026: import java.util.List;
027:
028: import org.riotfamily.components.model.ComponentList;
029: import org.riotfamily.components.model.ComponentVersion;
030: import org.riotfamily.components.model.Location;
031: import org.riotfamily.components.model.VersionContainer;
032:
033: /**
034: * DAO interface that provides methods to access
035: * {@link ComponentList ComponentList}s,
036: * {@link ComponentVersion ComponentVersion}s and
037: * {@link VersionContainer VersionContainer}s.
038: */
039: public interface ComponentDao {
040:
041: /**
042: * Returns the {@link ComponentList} with the given location.
043: */
044: public ComponentList findComponentList(Location location);
045:
046: /**
047: * Returns the nested {@link ComponentList} for the given parent/slot.
048: */
049: public ComponentList findComponentList(VersionContainer parent,
050: String slot);
051:
052: /**
053: * Returns all {@link ComponentList ComponentList} with the given type
054: * and path.
055: */
056: public List findComponentLists(String type, String path);
057:
058: /**
059: * Returns all {@link ComponentList ComponentLists} marked as dirty.
060: */
061: public List findDirtyComponentLists();
062:
063: /**
064: * Loads the ComponentList specified by the given id.
065: */
066: public ComponentList loadComponentList(Long id);
067:
068: /**
069: * Loads the VersionContainer specified by the given id.
070: */
071: public VersionContainer loadVersionContainer(Long id);
072:
073: /**
074: * Loads the ComponentVersion specified by the given id.
075: * @since 6.4
076: */
077: public ComponentVersion loadComponentVersion(Long id);
078:
079: /**
080: * Saves the given ComponentList.
081: */
082: public void saveComponentList(ComponentList list);
083:
084: /**
085: * Saves the given VersionContainer.
086: */
087: public void saveVersionContainer(VersionContainer container);
088:
089: /**
090: * Saves the given ComponentVersion.
091: */
092: public void saveComponentVersion(ComponentVersion version);
093:
094: /**
095: * Updates the given ComponentList.
096: */
097: public void updateComponentList(ComponentList list);
098:
099: /**
100: * Updates the given VersionContainer.
101: */
102: public void updateVersionContainer(VersionContainer container);
103:
104: /**
105: * Updates the given ComponentVersion.
106: */
107: public void updateComponentVersion(ComponentVersion version);
108:
109: /**
110: * Deletes the given ComponentList.
111: */
112: public void deleteComponentList(ComponentList list);
113:
114: /**
115: * Deletes the given ComponentVersion.
116: */
117: public void deleteComponentVersion(ComponentVersion version);
118:
119: /**
120: * Deletes the given VersionContainer.
121: */
122: public void deleteVersionContainer(VersionContainer container);
123:
124: /**
125: * Persists the information that the given property contains a reference
126: * to a file.
127: */
128: public void saveFileStorageInfo(String type, String property,
129: String fileStoreId);
130:
131: public List getFileStorageInfos(String type);
132:
133: }
|