cancel
Showing results for 
Search instead for 
Did you mean: 

Checkout/Checkin

mrgrechkinn
Champ in-the-making
Champ in-the-making
Hello,

I have custom type with custom child association. I create node, create one-two child and save it all.
Then I do checkout, in working copy I try delete all children (but they not exist for working copy) and create new, than checkin it.
But when I checkin node, I expect 2 child nodes but I have more. How I can fix it?

Thanks.
6 REPLIES 6

loftux
Star Contributor
Star Contributor
I think it is this bug: https://issues.alfresco.com/jira/browse/ALF-10717
In my case I noticed it for renditions /thumbnails.

Can please add a comment to this issue, or here and I will add the information.
In the comment add
-What version of alfresco and environment.
-What your custom data model look like
-Any steps to reproduce (preferably as a numbered list with exact steps)

mrgrechkinn
Champ in-the-making
Champ in-the-making
I use Alfresco 3.4.4 Enterprise.

I have a simple model:

…………………
<type name="myprefix:field">
    <title>Dynamic field base type</title>
    <parent>sys:base</parent>
    <properties>
        <property name="myprefix:label">
            <type>d:text</type>
        </property>
    </properties>
    <associations>
        <child-association name="myprefix:constraints">
            <source>
                <mandatory>false</mandatory>
                <many>true</many>
            </source>
            <target>
                <class>myprefix:constraint</class>
                <mandatory>false</mandatory>
                <many>true</many>
            </target>
            <duplicate>false</duplicate>
        </child-association>
    </associations>
    <mandatory-aspects>
        <aspect>cm:versionable</aspect>
    </mandatory-aspects>
</type>

<type name="myprefix:constraint">
    <parent>sys:base</parent>
    <properties>
        <property name="myprefix:constraintName">
            <type>d:text</type>
            <mandatory enforced="true">true</mandatory>
        </property>
    </properties>
</type>
…………………

And I have a put webscript for update node

Get a my created node by noderef, this node with couple of child nodes
var node = search.findNode(${noderef});

Checkout node
var workingCopy = node.checkout();

Hm… working copy doesn't have a child nodes
Try to remove all children, but they doesn't exists
workingCopy.methodForRemoveChildren();

Then I create a child node
var childNode = workingCopy.createNode(null, "myprefix:constraint", "myprefix:constraints");
childNode.properties["myprefix:constraintName"] = "Test";
childNode.save();

Checkin working copy
node = workingCopy.checkin("Modify node", false);


But the old children exist in new version of node. But I expect only one child.

Thanks,
Eugene

loftux
Star Contributor
Star Contributor
Added a link from the issue to your post.

Meantime, do you want your association to be a child-association and get parent child relationship? Because you can do just an association, peer to peer relationship. Just asking, so that you havent missed that option.

mrgrechkinn
Champ in-the-making
Champ in-the-making
In this case I need exactly child-association.

Thanks,
Eugene

mrgrechkinn
Champ in-the-making
Champ in-the-making
up!

loftux
Star Contributor
Star Contributor
I suggest you raise a new issue for this if it is not fixed for you, since the other one is closed. Add links to that issue and this forum post.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.