01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ContentRepository.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf;
09:
10: import com.uwyn.rife.site.ConstrainedProperty;
11: import com.uwyn.rife.site.Validation;
12:
13: /**
14: * Contains the information that's required to describe a content repository.
15: *
16: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
17: * @version $Revision: 3634 $
18: * @since 1.0
19: */
20: public class ContentRepository extends Validation {
21: public final static String DEFAULT = "default";
22:
23: private String mName = null;
24:
25: /**
26: * Instantiates a new <code>ContentRepository</code> instance.
27: *
28: * @since 1.0
29: */
30: public ContentRepository() {
31: }
32:
33: public void activateValidation() {
34: addConstraint(new ConstrainedProperty("name").notNull(true)
35: .notEmpty(true).maxLength(100).unique(true));
36: }
37:
38: /**
39: * Sets the name of the content repository.
40: *
41: * @param name the name
42: * @return the current <code>ContentRepository</code> instance
43: * @see #setName(String)
44: * @see #getName()
45: * @since 1.0
46: */
47: public ContentRepository name(String name) {
48: setName(name);
49:
50: return this ;
51: }
52:
53: /**
54: * Sets the name of the content repository.
55: *
56: * @param name the name
57: * @see #name(String)
58: * @see #getName()
59: * @since 1.0
60: */
61: public void setName(String name) {
62: mName = name;
63: }
64:
65: /**
66: * Retrieves the name of the content repository.
67: *
68: * @return <code>null</code> if the stored <code>Content</code> instance
69: * has no name; or
70: * <p>the name of the content
71: * @see #name(String)
72: * @see #setName(String)
73: * @since 1.0
74: */
75: public String getName() {
76: return mName;
77: }
78: }
|