KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > jcr > impl > core > nodetype > mix > Versionable


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5
6 package org.exoplatform.services.jcr.impl.core.nodetype.mix;
7
8
9 import javax.jcr.nodetype.PropertyDef;
10 import javax.jcr.nodetype.NodeType;
11 import javax.jcr.nodetype.NodeDef;
12
13
14 import javax.jcr.PropertyType;
15 import javax.jcr.Value;
16 import javax.jcr.StringValue;
17
18
19 import javax.jcr.version.OnParentVersionAction;
20 import org.exoplatform.services.jcr.impl.core.nodetype.NodeDefImpl;
21 import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeImpl;
22 import org.exoplatform.services.jcr.impl.core.nodetype.PropertyDefImpl;
23 import org.exoplatform.services.jcr.impl.core.nodetype.nt.Base;
24
25 /**
26  * Created by The eXo Platform SARL .
27  *
28  * @author <a HREF="mailto:geaz@users.sourceforge.net">Gennady Azarenkov</a>
29  * @version $Id: Versionable.java,v 1.1 2004/11/02 18:36:34 geaz Exp $
30  */

31
32 public class Versionable extends NodeTypeImpl {
33
34   //name, declaringNodeType, requiredType,
35
// vlueConstraint, defaultValue, autoCreate, mandatory,
36
// onVersion, readOnly, primaryItem, multiple)
37

38   public Versionable() {
39     this.name = "mix:versionable";
40     this.mixin = true;
41     this.declaredSupertypes = new NodeType[1];
42     this.declaredSupertypes[0] = new Referenceable();
43     this.declaredPropertyDefs = new PropertyDef[4];
44
45     this.declaredPropertyDefs[0] = new PropertyDefImpl("jcr:versionHistory", null, PropertyType.REFERENCE,
46         "\"nt:versionHistory\"", null, true, true,
47         OnParentVersionAction.COPY, true, false, false);
48
49     this.declaredPropertyDefs[1] = new PropertyDefImpl("jcr:baseVersion", null, PropertyType.REFERENCE,
50         "\"nt:version\"", null, true, true,
51         OnParentVersionAction.IGNORE, true, false, false);
52
53     this.declaredPropertyDefs[2] = new PropertyDefImpl("jcr:isCheckedOut", null, PropertyType.BOOLEAN,
54         null, new StringValue("[\"true\"]"), true, true,
55         OnParentVersionAction.IGNORE, true, false, false);
56
57     this.declaredPropertyDefs[3] = new PropertyDefImpl("jcr:predecessors", null, PropertyType.REFERENCE,
58         "\"nt:version\"", null, true, true,
59         OnParentVersionAction.COPY, false, false, true);
60
61   }
62
63 }
64
Popular Tags