Giter VIP home page Giter VIP logo

jcrom's People

Contributors

frankgh avatar kobee1203 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jcrom's Issues

Dynamic Maps annotated with @JcrReference require lazy loading.

There seems to be a problem with referencing content within dynamic maps:

If the map is annotated with @JcrReference(lazy=true), everything works fine.

However, 

If the map is NOT lazily loaded AND the referenced object DOES define the
classNameProperty = "className" of the @JcrNode annotation:

Mapper.setNodeName() attemps to set the jcrName property on
java.lang.Object, which causes the following exception:

java.lang.NullPointerException
    at org.jcrom.Mapper.setNodeName(Mapper.java:181)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:408)
    at org.jcrom.ReferenceMapper.createReferencedObject(ReferenceMapper.java:233)
    at org.jcrom.ReferenceMapper.getReferenceMap(ReferenceMapper.java:293)
    at org.jcrom.ReferenceMapper.getReferencesFromNode(ReferenceMapper.java:325)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:470)
    at org.jcrom.Mapper.fromNode(Mapper.java:244)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:204)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:182)
    at
org.jcrom.TestInstantiation.test_dynamic_map_instantiation(TestInstantiation.jav
a:87)


If the map is NOT lazily loaded AND the referenced object DOES NOT define
the classNameProperty = "className" of the @JcrNode annotation:

java.lang.IllegalArgumentException
    at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java
:63)
    at java.lang.reflect.Field.set(Field.java:656)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:462)
    at org.jcrom.ReferenceMapper.createReferencedObject(ReferenceMapper.java:233)
    at org.jcrom.ReferenceMapper.getReferenceMap(ReferenceMapper.java:293)
    at org.jcrom.ReferenceMapper.getReferencesFromNode(ReferenceMapper.java:325)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:470)
    at org.jcrom.Mapper.fromNode(Mapper.java:244)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:204)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:182)
    at
org.jcrom.TestInstantiation.test_dynamic_map_instantiation(TestInstantiation.jav
a:87)


How to reproduce : 

Run the test called : test_dynamic_map_instantiation() in the attached file
(TestInstantiation.java).

Play around with the following properties:
    lazy=true from the DynamicObject's singleReferences attribute
    @JcrNode(classNameProperty = "className") on Child.java

Environment: 
Windows XP, Java 6, JCrom 1.3

Vincent Giguère

Original issue reported on code.google.com by [email protected] on 4 Jun 2008 at 5:09

Attachments:

Specify node types for child node containers

JCROM creates a container node for child nodes, but this container node is
always of type nt:unstructured. We need to add support for specifying a
node type for the container node.

Original issue reported on code.google.com by [email protected] on 21 Feb 2008 at 11:26

Lazy loading

Currently, JCROM supports specifying manually the max depth of child nodes
and references to load, plus a name filter. It would be nice to support
lazy loading, so that the caller does not need to manually specify these
settings. For backwards compatibility, both options should be supported.

Original issue reported on code.google.com by [email protected] on 12 Apr 2008 at 8:04

Map of child nodes and references

JCROM already supports the ability to map a Map of properties. But to
support dynamic content structures, JCROM needs to have the ability to map
key-value pairs of child nodes and references.

Map<String,Object> for single-value child node and reference
Map<String,List<Object>> for multi-value child nodes and references

For dynamic Map of children, dynamic instantiation needs to be on, since
the entity class cannot be derived from the Map field definition.

Ideally, this should also be supported for JcrFile nodes.

Original issue reported on code.google.com by [email protected] on 6 May 2008 at 12:23

Support loading references by path

Rule #5 of David Nuescheler's guide for blissful content modeling states
that references are harmful (http://wiki.apache.org/jackrabbit/DavidsModel).

Therefore, JCROM should support a new property on the @JcrReference
annotation, to specify that this should be a weak reference, referenced by
path:

@JcrReference(byPath=true)

This means, that the referenced node can be deleted. If a path-reference is
found to a non-existent node, then it is simply ignored.

Original issue reported on code.google.com by [email protected] on 26 Apr 2008 at 12:18

Programming to interface does not work with @JcrReference

It is not possible to map to interfaces using the @JcrReference annotation
rather than the @JcrChildNode.

I use @JcrReference and get the following error:

Field [itemReference] which is annotated as @JcrReference is of type that
has no @JcrUUID: xxx.yyy.zzz.Referenceable

My JCROM instance is created with dynamicInstantiation turned ON
My xxx.yyy.zzz.Referenceable interface is annotated with
@JcrNode(classNameProperty="className") 

Original issue reported on code.google.com by [email protected] on 6 Jun 2008 at 2:19

Problem adding new files under node-update

What is the expected output? What do you see instead?
My POJO (which is being persisted in Jackrabbit) has an instance variable
as follows:

@JcrFileNode private List<JcrFile> jcrResources;

This list is defined for the first time when the POJO is being created.
Later on this list can be modifies (both in terms of content as well as the
size). When the size of the list is changed (increased), the following
piece of code is executed:

// we must add new children, if any
for ( int i = 0; i < children.size(); i++ ) {
                                      Object child = children.get(i);
if ( !childContainer.hasNode(getCleanName(getNodeName(child))) ) {
addNode(childContainer, child, null);
}                               
}

This code is in Mapper.java in method
private String updateNode( Node node, Object obj, Class objClass,
NameFilter childNameFilter, int maxDepth, int depth ) throws Exception {..}

The above code seems to add the new files added to jcrResources list, to
the childContainer variable. Everything seems to be good and dandy until I
try to save the modified node, by calling session.save(). (session.save()
is called after the update method above is returned successfully).

I get the following error:

javax.jcr.nodetype.ConstraintViolationException:
/curnits/a-b-c/jcrResources/resource2: mandatory child node
{http://www.jcp.org/jcr/1.0}content does not exist
    at
org.apache.jackrabbit.core.ItemImpl.validateTransientItems(ItemImpl.java:553)
    at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1202)
    at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:896)
    at net.sf.sail.cms.curnit.impl.CurnitDao.update(CurnitDao.java:108)
    at net.sf.sail.cms.curnit.impl.CurnitDao.update(CurnitDao.java:1)
    at org.jcrom.dao.AbstractJcrDAO.update(AbstractJcrDAO.java:125)
    at org.jcrom.dao.AbstractJcrDAO.update(AbstractJcrDAO.java:120)
    at
net.sf.sail.cms.curnit.impl.CurnitManagementImpl.updateCurnit(CurnitManagementIm
pl.java:289)
    at net.sf.sail.cms.curnit.Test.main(Test.java:79)


Note: /curnits/a-b-c/jcrResources/resource2 is the path in Jackrabbit to
the resource file, and resource2 is the newly added file to the list for
update.

I've been trying to figure out the problem all day today and I'm out of
luck. I am wondering if this is due to a bug in Jcrom or maybe Jackrabbit's
save method. Of course it can be something in my code, but I'm not seeing it.

Any help is appreciated.


What version of the product are you using? On what operating system?
1.2


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 1 May 2008 at 10:22

Child node java.util.Map should be annotated as @JcrProperty

A java.util.Map can be used to store properties. This is currently mapped
as @JcrChildNode, but should be mapped as @JcrProperty. The reason is, that
we are storing properties, and also child node Maps might be supported for
dynamic child nodes in the future.

Original issue reported on code.google.com by [email protected] on 14 Apr 2008 at 9:23

Removing a child of a versioned node using DAO fails

Using the DAO to remove a node which is the child of a versioned node will
result in an exception:

javax.jcr.version.VersionException: /path/to/VersionedEntity/children:
cannot remove a child of a checked-in node

Original issue reported on code.google.com by [email protected] on 10 May 2008 at 1:37

Remove static root path from DAO classes

The org.jcrom.dao.AbstractJcrDAO constructor takes a "rootPath" argument.
This severely limits how DAOs are used. This is not needed when @JcrPath
annotation has been made mandatory, and should be removed. This means that
separate DAOs can be used for parent and child nodes, and makes the DAO
support a lot more flexible.

Original issue reported on code.google.com by [email protected] on 14 Feb 2008 at 2:42

JcrDao naming consistency for delete/remove

In JcrDao, I think there is a naming consistency issue :

public void delete( String path );
public void deleteByUUID( String uuid );

public void removeVersion( String path, String versionName );
public void removeVersionByUUID( String uuid, String versionName );

What do you think about renaming delete to remove and deleteByUUID to
removeByUUID ?




Original issue reported on code.google.com by bouiaw on 5 May 2008 at 2:14

Make name validation cleanup optional

Currently, JCROM will replace spaces and illegal characters in fields
annotated with @JcrName, to make sure that the path is valid. The intention
was also to make mapping of web paths to JCR paths easier.

This can cause problems in some instances, and therefore needs to be an
optional feature that can be turned off.

Original issue reported on code.google.com by [email protected] on 19 Feb 2008 at 4:55

Improve Exception handling

Currently JCROM and DAO methods all throw java.lang.Exception. This should
be improved so that these classes catch specific exceptions and throw them
as JcrMappingException (which is a RuntimeException).

Original issue reported on code.google.com by [email protected] on 14 Apr 2008 at 11:15

Cannot create nodes directly under root using AbstractJcrDAO

The AbstractJcrDAO create() method does not allow empty paths, and
therefore it is impossible to create nodes directly under the repository root.

This should be fixed so that if the entity path is "/", then the root node
is used as the parent.

Original issue reported on code.google.com by [email protected] on 10 Apr 2008 at 9:19

Keys are not retained in Dynamic Maps annotated with @JcrChildNode

Keys are not retained in Dynamic Maps annotated with @JcrChildNode

When using a dynamic map annotated with @JcrChildNode, the keys in the map
will not be retained. 
Jcrom uses the @JcrName annotated property instead of the key in the map.



How to reproduce the problem:

Run the following test in the JCROM unit tests provided with the bundle: 
(FILE ATTACHED)
    @Test
    public void
test_dynamic_maps_stored_as_child_nodes_can_be_retrieved_by_key() throws
Exception
    {
        Jcrom jcrom = new Jcrom(true, true);
        jcrom.map(DynamicObject.class).map(Child.class);

        Node rootNode = session.getRootNode().addNode("test");

        DynamicObject dyna = new DynamicObject();
        dyna.setName("Dynamic");

        dyna.putSingleValueChild("childOne", 
createChildWithName("childName1"));
        dyna.putSingleValueChild("childTwo", 
createChildWithName("childName2"));

dyna.putSingleValueChild("childThree",createChildWithName("childName3"));

        assertEquals(3, dyna.getSingleValueChildren().size());

        DynamicObject loaded = jcrom.fromNode(DynamicObject.class,
jcrom.addNode(rootNode, dyna));

        assertEquals(3, loaded.getSingleValueChildren().size());
        assertNotNull(loaded.getSingleValueChildren().get("childOne"));
        assertNotNull(loaded.getSingleValueChildren().get("childTwo"));
        assertNotNull(loaded.getSingleValueChildren().get("childThree"));
    }


      Additional Info: 

    When persisting the map, its content is organized like this: 
    "childOne" -> childObjectA
    "childTwo" -> childObjectB
    "childOne" -> childObjectC

      Expected Output: 
    When loading the map from JCR, its content is organized like this:
    "childName1" -> childObjectA
    "childName2" -> childObjectB
    "childName3" -> childObjectC

System Information
Java 6, Windows XP, JCrom 1.3

Regards,

Vincent Giguère



Original issue reported on code.google.com by [email protected] on 4 Jun 2008 at 3:34

Attachments:

Ability to override session management in DAOs

Currently, JCROM makes you pass the JCR session in as a DAO constructor
parameter. Firstly this means that that singleton DAOs are not possible,
and secondly sometimes you want to manage the session via other means (for
example via a Guice provider).

JCROM should have a protected getSession() method in the AbstractJcrDAO,
and use that for all internal calls to the session. That way,
implementations can override the method to provide their own session hooks.

Original issue reported on code.google.com by [email protected] on 23 Apr 2008 at 9:06

Remove dependency on slf4j logging

I cannot justify external dependencies for the logging, so I'm going to use
the standard java.util logging rather than the slf4j logging.

There are ways to redirect java.util logging to slf4j if needed anyway.

Original issue reported on code.google.com by [email protected] on 7 May 2008 at 12:07

Automatically add mixinTypes on Jcrom.addNode

I have a EntityService with a addEntity(Entity entity) method. 
Entity is the base class for all my business/domain objects. The addEntity
method from EntityService is a generic method to add entities (Folder,
User, Group ...) in my application. Implementation of addEntity uses
Jcrom.addNode(Node parentNode, Object entity) method.
I want to avoid if/else multiple blocks (for add mixins) in my generic
addEntity(Entity entity) or creation of addXXX() method for each entity type.
I think that a new element "mixinTypes" in @JcrNode and adding
these mixins automatically on Jcrom.addNode(Node parentNode, Object entity)
resolve my problem.

Original issue reported on code.google.com by [email protected] on 27 Mar 2008 at 9:53

@JcrReference and @JcrParentNode

1. The Mapper follows a @JcrReference and tries to create the referenced node.
2. The referenced node containes a @JcrParent.
3. The Mapper tries to set the referencing node as the parent.
4. Reflection exception since refering node and parent are of different type:

java.lang.IllegalArgumentException
    at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java
:63)
    at java.lang.reflect.Field.set(Field.java:656)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:462)
    at org.jcrom.ReferenceMapper.createReferencedObject(ReferenceMapper.java:233)
    at org.jcrom.ReferenceMapper.getReferencesFromNode(ReferenceMapper.java:336)
    at org.jcrom.Mapper.mapNodeToClass(Mapper.java:470)
    at org.jcrom.Mapper.fromNode(Mapper.java:244)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:204)
    at org.jcrom.Jcrom.fromNode(Jcrom.java:182)

The issue seems to be in line 233 of ReferenceMapper, where
mapper.mapNodeToClass is called with the obj as the parent.

Obviously, the Mapper should figure out the actual parent instead.

JCrom Version 1.3

Original issue reported on code.google.com by [email protected] on 25 Jun 2008 at 2:37

UpdateNode problem with JcrFile object types

What steps will reproduce the problem?
1. Create a POJO structure with a hierarchy of classes (2 levels is enough)
where most inner (lower) hierarchy contains a jcrFile type as an instance
variable.
2. Create an instance of the POJO in Jackrabbit
3. Retrieve it.
4. Manipulate some of its parameters (you don't need to manipulated the
jcrFile type instance). You can just change the string value of some of
String parameters.
4. Try to update it.

What is the expected output? What do you see instead?
Expected: The node gets updated with the correct (new) values
Instead I get: 

org.jcrom.JcrMappingException: Could not update node from object
    at org.jcrom.Jcrom.updateNode(Jcrom.java:287)
    at roolo.cms.repository.curnit.impl.CurnitDao.update(CurnitDao.java:111)
    at roolo.cms.repository.curnit.impl.CurnitDao.update(CurnitDao.java:1)
    at org.jcrom.dao.AbstractJcrDAO.update(AbstractJcrDAO.java:177)
    at org.jcrom.dao.AbstractJcrDAO.update(AbstractJcrDAO.java:167)
    at
roolo.cms.repository.curnit.impl.CurnitManagementImpl.updateCurnit(CurnitManagem
entImpl.java:361)
    at
roolo.cms.repository.curnit.CurnitRepository.updateELO(CurnitRepository.java:94)
    at roolo.cms.repository.test.curnit.Test.main(Test.java:82)
Caused by: javax.jcr.ItemExistsException:
/curnits/test-uri/content/otmlContent/otmlFile/test-uri.otml
    at org.apache.jackrabbit.core.SessionImpl.move(SessionImpl.java:1010)
    at org.jcrom.Mapper.updateNode(Mapper.java:272)
    at org.jcrom.FileNodeMapper.updateFileNode(FileNodeMapper.java:111)
    at org.jcrom.FileNodeMapper.addSingleFileToNode(FileNodeMapper.java:134)
    at org.jcrom.FileNodeMapper.setFiles(FileNodeMapper.java:286)
    at org.jcrom.FileNodeMapper.updateFiles(FileNodeMapper.java:327)
    at org.jcrom.Mapper.updateNode(Mapper.java:307)
    at org.jcrom.ChildNodeMapper.addSingleChildToNode(ChildNodeMapper.java:81)
    at org.jcrom.ChildNodeMapper.setChildren(ChildNodeMapper.java:222)
    at org.jcrom.ChildNodeMapper.updateChildren(ChildNodeMapper.java:236)
    at org.jcrom.Mapper.updateNode(Mapper.java:298)
    at org.jcrom.Mapper.updateNode(Mapper.java:258)
    at org.jcrom.Jcrom.updateNode(Jcrom.java:285)
    ... 7 more


What version of the product are you using? On what operating system?
version 1.3 on Mac OS X (Leopard)

Please provide any additional information below.
The problem seems to be in 

String updateNode( Node node, Object obj, Class objClass, NameFilter
childNameFilter, int maxDepth, int depth )
   throws RepositoryException, llegalAccessException, IOException {...}

If you put a break-point at 

if ( !node.getName().equals(getCleanName(getNodeName(obj))) ) {
and watch for "node.getName()" and "getNodeName(obj)", you will notice that
every time you hit that break-point, the two values match. The problem
occurs when you get to the jcrFile instance. All of a sudden
"node.getName()" gives you the file's name (correct value) but
"getNodeName(obj)" gives you the POJO's name (wrong value). I couldn't
really figure out why that's the case, but I believe that's a problem if
not the problem.

Thank you in advance,

Rokham.


Original issue reported on code.google.com by [email protected] on 26 Jun 2008 at 10:49

Support Locale property

It would be nice to be able to map java.util.Locale as a @JcrProperty. This
should be mapped to/from a String JCR property.

Original issue reported on code.google.com by [email protected] on 14 Mar 2008 at 3:12

List of References

Hi,

Currently using references with jcrom is possible, but not list of references.

Could you implement this feature in Jcrom, in to allow us to declare :
@JcrReference List<Contact> contacts;

Thanks in advance.


Original issue reported on code.google.com by bouiaw on 10 Apr 2008 at 11:42

Cannot retrieve Files from Jcrom DataProvider

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
Given I persist a java.io.File object (using Jcrom), I expect to get back a
java.io.File when requested. Instead my only option on retrieval is
java.io.InputStream


What version of the product are you using? On what operating system?
version 1.2 on Mac OS X Leopard


Please provide any additional information below.
I have persisted my File object using the @JcrFileNode annotation, using
JcrFile object type. I define my jcrFile object to be persisted in
Jackrabbit as follows:

JcrFile jcrOtmlFile = JcrFile.fromFile(curnitOtmlFile.getName(),
curnitOtmlFile, JcrDataProvider.TYPE.FILE.toString());

Notice the JcrDataProvider.TYPE is set to File. When I try to retrieve a
specific version of the persisted node using

curnitNode.getJcrFile().getDataProvider().getFile(), it returns null. The
only option is to do ....getDataProvider().getInputStream(). 

I looked at Mapper.java's 
private <T extends JcrFile> void mapNodeToFileObject( 
JcrFileNode jcrFileNode, T fileObj, Node fileNode, NameFilter nameFilter,
int maxDepth, Object parentObject, int depth ) throws Exception {...}
method and I believe the problem is from there. It seems like the node's
type is only checked against TYPE.BYTES and TYPE.STREAM, there's no mention
to TYPE.FILE.

Looking at JcrFileNode interface it seems like all JcrFile nodes are
defaulted to Stream type.

I'm not sure if Jcrom should provide the ability to read back a File, if a
File is persisted or whether the client is responsible to create a File
from the stream.

Thank you in advance,

Rokham


Original issue reported on code.google.com by [email protected] on 23 Apr 2008 at 4:57

Update @JcrProperty with an empty list

What steps will reproduce the problem?
1. Create an entity (Person in my TestCase) with a not empty list property
(@JcrProperty private List<String> phones)
2. Add the entity in jcr with Jcrom.addNode(...)
3. Reset the list property (phones = new ArrayList())
4. Update the entity in jcr
5. Retrieves the entity from jcr

What is the expected output? What do you see instead?
The phones property has the size 0. Instead is 0.

What version of the product are you using? On what operating system?
jcrom 1.2, 1.3.1
jdk  1.5
linux


Please provide any additional information below.
commons-collections-3.1.jar
concurrent-1.3.4.jar
derby-10.2.1.6.jar
jackrabbit-api-1.4.jar
jackrabbit-core-1.4.5.jar
jackrabbit-jcr-commons-1.4.2.jar
jackrabbit-spi-1.4.jar
jackrabbit-spi-commons-1.4.jar
jackrabbit-text-extractors-1.4.jar
jcr-1.0.jar
jcrom-1.2.jar(jcrom-1.3.1.jar)
junit-4.4.jar
log4j-1.2.14.jar
lucene-core-2.2.0.jar
slf4j-api-1.4.3.jar
slf4j-log4j12-1.4.3.jar



Original issue reported on code.google.com by [email protected] on 25 Jun 2008 at 3:03

Attachments:

Renaming a node at the root level throws an exception

Updating a node /foo when you change its name from foo to bar, result in an
error message :
javax.jcr.RepositoryException: //bar: invalid path: '//bar' is not a valid
path.

The problem is located at line 257 of Mapper.java :
node.getSession().move(node.getPath(), node.getParent().getPath() + "/" +
getCleanName(getNodeName(obj)));

Original issue reported on code.google.com by bouiaw on 12 Apr 2008 at 11:00

Support node references

Add a new annotation for mapping of node references. The methods creating
an object from a node need to accept arguments that control whether to load
references.


Original issue reported on code.google.com by [email protected] on 6 Feb 2008 at 11:56

Specify parent path in the create function of the DAO

I have a small enhancement requirement.

In order to manage the path attribute in a consistent way, I think you
should add a parameter parentPath to the create methods instead of using
entity path attribute :
public T create(String parentPath, T entity) throws Exception

It allows to have an implicit rule (guideline) "never set Path in the
application, modify only name" that simplify API usage.

It avoid to have to set a "false path" that does not contain the name when
you create the node, but that contains the name when you retreive it.

You can see an example of the modified DAO in my unit tests :
http://code.google.com/p/igenko/source/browse/trunk/igenko-core/src/test/java/or
g/igenko/core/service/SiteServiceTest.java



Original issue reported on code.google.com by bouiaw on 14 Apr 2008 at 6:47

Entities from DAO getVersionList() do not have base version info

When using the DAO support classes to retrieve versions
(AbstractJcrDAO.getVersionList()), then the version entities returned have
no base version name and base version created date. The reason for this is
that this information is not available directly from the JCR version nodes.
We should, however, add this information manually in the DAO, since we
already have it there.

Original issue reported on code.google.com by [email protected] on 2 Mar 2008 at 3:42

hasMixinType may return the false value.

What steps will reproduce the problem?

What is the expected output? What do you see instead?
The persisted POJO is marked as versionable but when POJO is deleted, jcrom
seem to think it is not versionable and therefore an exception is thrown.


What version of the product are you using? On what operating system?
1.3 on OS X (Leopard)


Please provide any additional information below.
In class AbstractJcrDAO, under method

public void remove( String path )

if ( hasMixinType(parent, "mix:versionable") ) returns false in the code
snippet below

if ( isVersionable ) {
 parent = getSession().getRootNode().getNode(relativePath(path)).getParent();
  if ( hasMixinType(parent, "mix:versionable") ) {
     parent.checkout();
  }
}

This is despite the fact that I have marked my POJO as versionable. Also
the constructor of my DAO class which extends AbstractJcrDAO has the
following code:

private static final String[] MIXIN_TYPES = {"mix:versionable"};
super(CurnitOtmlImpl.class, session, jcrom, MIXIN_TYPES);


Given that hasMixingType method above returns false and therefore
parent.checkout() is not executed, a little below that code-snippet in
method remove(String path) there is the following code-snippet:

 if ( isVersionable ) {
   if ( parent.isCheckedOut() ) {
       parent.checkin();
   }
}

In the code above "parent.isCheckedOut()" returns true and therefore we try
to checkin the parent. This in return throws an exception.

I'm guessing there might be a minor problem with the hasMixinType method
which should return True instead of False so the parent gets checked out.

Any help is much appreciated.


Original issue reported on code.google.com by [email protected] on 22 May 2008 at 4:49

Add annotations and DAO support for versioning

Add annotations:

@JcrBaseVersionName
@JcrBaseVersionCreated
@JcrVersionName
@JcrVersionCreated
@JcrCheckedout

Also, add versioning support to the DAO classes:

  * add methods for getting a list of all versions
  * add methods for getting a specific version
  * add methods for restoring a version
  * add methods for removing a version

The DAO should use checkin() and checkout() if a "mix:versionable" mixin
type is detected, so that versions can be managed transparently when using
the DAOs.

Original issue reported on code.google.com by [email protected] on 9 Feb 2008 at 12:30

Programming to the interface feature

What steps will reproduce the problem?
1. Create a abstract base class AbstractAsset
2. Create a subclass AssetImpl (Asset asset = new AssetImpl();)
3. Add AssetImpl to the repo (jcrom.addNode(node, asset, mixinTypes);
4. After saving it, try to retrieve the object as an Asset (Asset a =
jcrom.fromNode(Asset.class, assetNode);

What is the expected output? What do you see instead?
I would expect that it would return an AssetImpl object because AssetImpl
is an Asset.  Instead an exception is thrown because an instance of Asset
is trying to be created.  

What version of the product are you using? On what operating system?
version 1.1 on Windows XP

Please provide any additional information below.
It's obviously not a bug, but I think it's a problem.  In the case of
selecting an individual object it's not as big a deal, but when requesting
a list of objects through the provided DAO it's a big problem.  
There are a few ways I see solving it:
1.  add a property to the tree that contains the class name - problem here
is that if you change the name of the class, there's a big problem.
2.  check the properties under the node to determine the
subclass/implementation that is actually stored in the repo - problem here
is that it will be slower and problems occur with new or old properties and
2 subclasses having the same properties (unlikely)
3.  Similar to #1, but instead of using the class name, add an annotation
to the object that identifies it using a unique name.  This would need to
be validated and mapped properly.

Original issue reported on code.google.com by [email protected] on 20 Mar 2008 at 4:18

Problems updating JcrFile extensions

What steps will reproduce the problem?
1. Create a JcrFile extension with custom metadata 
2. Try to persist using AbstractJcrDAO extension.
3. Try to load using the same DAO.

What is the expected output? What do you see instead?
I expected that the properties of JcrFile will be available. Doing a
getDataProvider(), getMimeType(), getName() etc, is returning null


What version of the product are you using? On what operating system?
jcrom 1.3


Please provide any additional information below.
See attachment for an example of the problem.

Original issue reported on code.google.com by [email protected] on 31 Jul 2008 at 5:07

Infinite loop when child node class is same as parent class

This one is a bit embarrassing. If a class A has a field mapped as
@JcrChildNode, and that field type is class A as well (for example when
structuring a tree then a tree node will have children that are tree
nodes), then an infinite loop could occur in the validation phase.

Original issue reported on code.google.com by [email protected] on 14 Feb 2008 at 2:36

Make @JcrPath mandatory

Make a @JcrPath annotation mandatory. This leads to significant
simplifications in the DAO implementations, as methods that use the node
name can be removed (path-based methods used instead).

Original issue reported on code.google.com by [email protected] on 14 Feb 2008 at 2:38

getVersion in AbstractJcrDAO returns null

What steps will reproduce the problem?
1. Create a node
2. Update it two or three time (by changing some of its attribute values
3. Retrieve a version (not first or last version) of the node, using
public abstract class AbstractJcrDAO<T> implements JcrDAO<T> class'
getVersion method.
4. Null is returned.

What is the expected output? What do you see instead?
Get null instead of the requested version of the node.

What version of the product are you using? On what operating system?
1.3 on Mac OS X (leopard)


Please provide any additional information below.
I need this functionality for a demo for next week and I would really
appreciate it if I could have it working by then. Many thanks in advance.

Original issue reported on code.google.com by [email protected] on 10 Jun 2008 at 8:59

Add support for fields serialized to binary properties

Sometimes we need to be able to store fields serializable as bytes in a
binary property, rather than map as a child node.

For such cases, JCROM should support a new annotation:
@JcrSerializedProperty. Only fields that implement java.io.Serializable
should be valid for such an annotation.

JCROM will serialize fields annotated in this way, and store as binary
property in a JCR node, and deserialize back to an Object when loading from
JCR.

Original issue reported on code.google.com by [email protected] on 3 Mar 2008 at 3:51

No container node for a 1:1 child mapping

JCROM currently always creates a container node for child nodes. However,
in some 1:1 cases, this is unnecessary.

In such cases, it should be possible to specify that no container should be
created. A constant name would still have to be used for the child node,
ignoring the value in the field annotated with @JcrName.


Original issue reported on code.google.com by [email protected] on 25 Jul 2008 at 8:27

Support Map as a child node

JCROM needs to support Map-based child nodes. For a Map field, we would
create a container node, and then map the values of the map to properties.

Original issue reported on code.google.com by [email protected] on 28 Feb 2008 at 3:36

Support move() in DAOs

Add a method for moving a node to the JcrDAO interface and AbstractJcrDAO.
This method should take care of versioning automatically if the node is
versionable.

Original issue reported on code.google.com by [email protected] on 10 May 2008 at 11:20

Add path-based methods to DAOs

Currently, the DAOs can load/update objects using name or UUID. We need to
support full path as well, so that same name siblings (without UUIDs) can
be processed using the DAOs.

Original issue reported on code.google.com by [email protected] on 6 Feb 2008 at 11:57

Support dynamic Map of file nodes, and lazy loading for files

This is already supported for child nodes and references, but I need to
support this for file nodes as well:

1) Support dynamic map of file nodes (and lists):

@JcrFileNode private Map<String,JcrFile> files;
@JcrFileNode private Map<String,List<JcrFile>> fileLists;

2) Support lazy loading of file nodes:

@JcrFileNode(lazy=true) private JcrFile photo;

Original issue reported on code.google.com by [email protected] on 7 May 2008 at 12:05

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.