Java Code Examples for org.alfresco.model.ContentModel#ASSOC_CHILDREN

The following examples show how to use org.alfresco.model.ContentModel#ASSOC_CHILDREN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileImporterImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Get the type of child association that should be created.
 * 
 * @param parentNodeRef the parent
 * @return Returns the appropriate child association type qualified name for the type of the
 *      parent.  Null will be returned if it can't be determined.
 */
private QName getAssocTypeQName(NodeRef parentNodeRef)
{
    // check the parent node's type to determine which association to use
    QName parentNodeTypeQName = nodeService.getType(parentNodeRef);
    QName assocTypeQName = null;
    if (dictionaryService.isSubClass(parentNodeTypeQName, ContentModel.TYPE_CONTAINER))
    {
        // it may be a root node or something similar
        assocTypeQName = ContentModel.ASSOC_CHILDREN;
    }
    else if (dictionaryService.isSubClass(parentNodeTypeQName, ContentModel.TYPE_FOLDER))
    {
        // more like a directory
        assocTypeQName = ContentModel.ASSOC_CONTAINS;
    }
    return assocTypeQName;
}
 
Example 2
Source File: Node2ServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Simulates the node begin attached to the root node of the version store.
 */
public ChildAssociationRef getPrimaryParent(NodeRef nodeRef) throws InvalidNodeRefException
{
    return new ChildAssociationRef(
            ContentModel.ASSOC_CHILDREN,
            dbNodeService.getRootNode(new StoreRef(StoreRef.PROTOCOL_WORKSPACE, Version2Model.STORE_ID)),
            rootAssocName,
            nodeRef);
}
 
Example 3
Source File: NodeServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Simulates the node begin attached ot the root node of the version store.
 */
public ChildAssociationRef getPrimaryParent(NodeRef nodeRef) throws InvalidNodeRefException
{
    return new ChildAssociationRef(
            ContentModel.ASSOC_CHILDREN,
            dbNodeService.getRootNode(new StoreRef(StoreRef.PROTOCOL_WORKSPACE, STORE_ID)),
            rootAssocName,
            nodeRef);
}
 
Example 4
Source File: LuceneResultSetRow.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public QName getPrimaryAssocTypeQName()
{
    
    Field field = getDocument().getField("PRIMARYASSOCTYPEQNAME");
    if (field != null)
    {
        String qname = field.stringValue();
        return QName.createQName(qname);
    }
    else
    {
        return ContentModel.ASSOC_CHILDREN;
    }
}
 
Example 5
Source File: NodeArchiveServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private Pair<NodeRef, QName> getArchiveNodeRefAssocTypePair(final NodeRef archiveStoreRootNodeRef)
{
    final String currentUser = getCurrentUser();

    if (archiveStoreRootNodeRef == null || !nodeService.exists(archiveStoreRootNodeRef))
    {
        throw new InvalidNodeRefException("Invalid archive store root node Ref.",
                    archiveStoreRootNodeRef);
    }

    if (hasAdminAccess(currentUser))
    {
        return new Pair<NodeRef, QName>(archiveStoreRootNodeRef, ContentModel.ASSOC_CHILDREN);
    }
    else
    {
        List<ChildAssociationRef> list = AuthenticationUtil.runAs(new RunAsWork<List<ChildAssociationRef>>()
        {
            @Override
            public List<ChildAssociationRef> doWork() throws Exception
            {
                return nodeService.getChildrenByName(archiveStoreRootNodeRef,
                        ContentModel.ASSOC_ARCHIVE_USER_LINK,
                        Collections.singletonList(currentUser));
            }
        }, AuthenticationUtil.getAdminUserName());

        // Empty list means that the current user hasn't deleted anything yet.
        if (list == null || list.isEmpty())
        {
            return new Pair<NodeRef, QName>(null, null);
        }
        NodeRef userArchive = list.get(0).getChildRef();
        return new Pair<NodeRef, QName>(userArchive, ContentModel.ASSOC_ARCHIVED_LINK);
    }
}
 
Example 6
Source File: TestWithUserUtils.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void createUser(
        String userName, 
        String password, 
        String email,
        NodeRef rootNodeRef,
        NodeService nodeService,
        MutableAuthenticationService authenticationService)
{    
    // ignore if the user's authentication already exists
    if (authenticationService.authenticationExists(userName))
    {
        // ignore
        return;
    }
    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");
    
    NodeRef systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    NodeRef typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    
    HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
    properties.put(ContentModel.PROP_USERNAME, userName);
    if (email != null && email.length() != 0)
    {
        properties.put(ContentModel.PROP_EMAIL, email);
    }
    nodeService.createNode(typesNodeRef, children, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, userName) , container, properties);
    
    // Create the users
    authenticationService.createAuthentication(userName, password.toCharArray()); 
}
 
Example 7
Source File: VirtualStoreImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Path getPath(Reference reference) throws VirtualizationException
{
    Reference virtualPathElement = reference;
    Reference virtualPathParent = reference.execute(new GetParentReferenceMethod());

    Path virtualPath = new Path();

    while (virtualPathElement != null && virtualPathParent != null)
    {
        NodeRef parentNodeRef;

        parentNodeRef = virtualPathParent.toNodeRef();

        NodeRef parent = parentNodeRef;

        NodeRef virtualPathNodeRef = virtualPathElement.toNodeRef();

        // TODO: extract node reference name into protocol method in order
        // to enforce path processing code reuse and consistency

        String templatePath = virtualPathElement.execute(new GetTemplatePathMethod()).trim();
        final String pathSeparator = "/";
        if (pathSeparator.equals(templatePath))
        {
            // found root
            break;
        }
        else if (templatePath.endsWith(pathSeparator))
        {
            templatePath = templatePath.substring(0,
                                                  templatePath.length() - 1);
        }
        int lastSeparator = templatePath.lastIndexOf(pathSeparator);
        String childId = templatePath.substring(lastSeparator + 1);
        VirtualFolderDefinition structure = resolveVirtualFolderDefinition(virtualPathParent);
        VirtualFolderDefinition child = structure.findChildById(childId);
        if (child == null)
        {
            throw new VirtualizationException("Invalid reference: " + reference.encode());
        }
        String childName = child.getName();
        QName childQName = QName.createQName(VirtualContentModel.VIRTUAL_CONTENT_MODEL_1_0_URI,
                                             childName);

        ChildAssociationRef assocRef = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN,
                                                               parent,
                                                               childQName,
                                                               virtualPathNodeRef,
                                                               true,
                                                               -1);
        ChildAssocElement assocRefElement = new ChildAssocElement(assocRef);
        virtualPath.prepend(assocRefElement);

        virtualPathElement = virtualPathParent;
        virtualPathParent = virtualPathParent.execute(new GetParentReferenceMethod());
    }

    return virtualPath;
}
 
Example 8
Source File: AclDaoComponentTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    aclDaoComponent = (AclDAO) applicationContext.getBean("aclDAO");
    
    nodeService = (NodeService) applicationContext.getBean("nodeService");
    dictionaryService = (DictionaryService) applicationContext.getBean(ServiceRegistry.DICTIONARY_SERVICE
            .getLocalName());
    permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService");
    namespacePrefixResolver = (NamespacePrefixResolver) applicationContext
            .getBean(ServiceRegistry.NAMESPACE_SERVICE.getLocalName());
    authenticationService = (MutableAuthenticationService) applicationContext.getBean("authenticationService");
    authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
    serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
    permissionModelDAO = (ModelDAO) applicationContext.getBean("permissionsModelDAO");
    personService = (PersonService) applicationContext.getBean("personService");
    authorityService = (AuthorityService) applicationContext.getBean("authorityService");
    
    authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
    authenticationDAO = (MutableAuthenticationDao) applicationContext.getBean("authenticationDao");
    transactionService = (TransactionService) applicationContext.getBean("transactionComponent");
    
    testTX = transactionService.getUserTransaction();
    testTX.begin();
    this.authenticationComponent.setSystemUserAsCurrentUser();
    
    StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime());
    rootNodeRef = nodeService.getRootNode(storeRef);

    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");

    systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    NodeRef typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    Map<QName, Serializable> props = createPersonProperties("andy");
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();
    props = createPersonProperties("lemur");
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();

    // create an authentication object e.g. the user
    if(authenticationDAO.userExists("andy"))
    {
        authenticationService.deleteAuthentication("andy");
    }
    authenticationService.createAuthentication("andy", "andy".toCharArray());

    if(authenticationDAO.userExists("lemur"))
    {
        authenticationService.deleteAuthentication("lemur");
    }
    authenticationService.createAuthentication("lemur", "lemur".toCharArray());
    
    if(authenticationDAO.userExists(AuthenticationUtil.getAdminUserName()))
    {
        authenticationService.deleteAuthentication(AuthenticationUtil.getAdminUserName());
    }
    authenticationService.createAuthentication(AuthenticationUtil.getAdminUserName(), "admin".toCharArray());
    
    authenticationComponent.clearCurrentSecurityContext();
}
 
Example 9
Source File: AbstractPermissionTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    nodeService = (NodeService) applicationContext.getBean("nodeService");
    dictionaryService = (DictionaryService) applicationContext.getBean(ServiceRegistry.DICTIONARY_SERVICE
            .getLocalName());
    permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService");
    permissionServiceImpl = (PermissionServiceImpl) applicationContext.getBean("permissionServiceImpl");
    namespacePrefixResolver = (NamespacePrefixResolver) applicationContext
            .getBean(ServiceRegistry.NAMESPACE_SERVICE.getLocalName());
    authenticationService = (MutableAuthenticationService) applicationContext.getBean("authenticationService");
    authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
    serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
    permissionModelDAO = (ModelDAO) applicationContext.getBean("permissionsModelDAO");
    personService = (PersonService) applicationContext.getBean("personService");
    authorityService = (AuthorityService) applicationContext.getBean("authorityService");
    authorityDAO = (AuthorityDAO) applicationContext.getBean("authorityDAO");
    siteService = (SiteService) applicationContext.getBean("SiteService"); // Big 'S'
    
    authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
    authenticationDAO = (MutableAuthenticationDao) applicationContext.getBean("authenticationDao");
    nodeDAO = (NodeDAO) applicationContext.getBean("nodeDAO");
    aclDaoComponent = (AclDAO) applicationContext.getBean("aclDAO");
    
    publicServiceAccessService = (PublicServiceAccessService) applicationContext.getBean("publicServiceAccessService");
    policyComponent = (PolicyComponent) applicationContext.getBean("policyComponent");
    
    retryingTransactionHelper = (RetryingTransactionHelper) applicationContext.getBean("retryingTransactionHelper");
    
    transactionService = (TransactionService) applicationContext.getBean("transactionComponent");
    
    testTX = transactionService.getUserTransaction();
    testTX.begin();


    testStoreRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.nanoTime());
    rootNodeRef = nodeService.getRootNode(testStoreRef);

    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");

    systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    NodeRef typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    Map<QName, Serializable> props = createPersonProperties(USER1_ANDY);
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();
    props = createPersonProperties(USER2_LEMUR);
    nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();

    // create an authentication object e.g. the user
    if(authenticationDAO.userExists(USER1_ANDY))
    {
        authenticationService.deleteAuthentication(USER1_ANDY);
    }
    authenticationService.createAuthentication(USER1_ANDY, USER1_ANDY.toCharArray());

    if(authenticationDAO.userExists(USER2_LEMUR))
    {
        authenticationService.deleteAuthentication(USER2_LEMUR);
    }
    authenticationService.createAuthentication(USER2_LEMUR, USER2_LEMUR.toCharArray());
    
    if(authenticationDAO.userExists(USER3_PAUL))
    {
        authenticationService.deleteAuthentication(USER3_PAUL);
    }
    authenticationService.createAuthentication(USER3_PAUL, USER3_PAUL.toCharArray());
    
    if(authenticationDAO.userExists(AuthenticationUtil.getAdminUserName()))
    {
        authenticationService.deleteAuthentication(AuthenticationUtil.getAdminUserName());
    }
    authenticationService.createAuthentication(AuthenticationUtil.getAdminUserName(), "admin".toCharArray());
    
    authenticationComponent.clearCurrentSecurityContext();
    
    assertTrue(permissionServiceImpl.getAnyDenyDenies());
}
 
Example 10
Source File: AuthenticationTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setUp() throws Exception
{
    if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
    {
        throw new AlfrescoRuntimeException(
                "A previous tests did not clean up transaction: " +
                AlfrescoTransactionSupport.getTransactionId());
    }
    
    dialect = (Dialect) ctx.getBean("dialect");
    nodeService = (NodeService) ctx.getBean("nodeService");
    authorityService = (AuthorityService) ctx.getBean("authorityService");
    tenantService = (TenantService) ctx.getBean("tenantService");
    tenantAdminService = (TenantAdminService) ctx.getBean("tenantAdminService");
    compositePasswordEncoder = (CompositePasswordEncoder) ctx.getBean("compositePasswordEncoder");
    ticketComponent = (TicketComponent) ctx.getBean("ticketComponent");
    authenticationService = (MutableAuthenticationService) ctx.getBean("authenticationService");
    pubAuthenticationService = (MutableAuthenticationService) ctx.getBean("AuthenticationService");
    authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
    authenticationComponentImpl = (AuthenticationComponent) ctx.getBean("authenticationComponent");
    pubPersonService =  (PersonService) ctx.getBean("PersonService");
    personService =  (PersonService) ctx.getBean("personService");
    policyComponent = (PolicyComponent) ctx.getBean("policyComponent");
    behaviourFilter = (BehaviourFilter) ctx.getBean("policyBehaviourFilter");
    authenticationCache = (SimpleCache<String, CacheEntry>) ctx.getBean("authenticationCache");
    immutableSingletonCache = (SimpleCache<String, NodeRef>) ctx.getBean("immutableSingletonCache");
    // permissionServiceSPI = (PermissionServiceSPI)
    // ctx.getBean("permissionService");
    ticketsCache = (SimpleCache<String, Ticket>) ctx.getBean("ticketsCache");
    usernameToTicketIdCache = (SimpleCache<String, String>) ctx.getBean("usernameToTicketIdCache");

    ChildApplicationContextFactory sysAdminSubsystem = (ChildApplicationContextFactory) ctx.getBean("sysAdmin");
    assertNotNull("sysAdminSubsystem", sysAdminSubsystem);
    ApplicationContext sysAdminCtx  = sysAdminSubsystem.getApplicationContext();
    sysAdminParams = (SysAdminParamsImpl) sysAdminCtx.getBean("sysAdminParams");

    dao = (MutableAuthenticationDao) ctx.getBean("authenticationDao");
    
    // Let's look inside the alfresco authentication subsystem to get the DAO-wired authentication manager
    ChildApplicationContextManager authenticationChain = (ChildApplicationContextManager) ctx.getBean("Authentication");
    ApplicationContext subsystem = authenticationChain.getApplicationContext(authenticationChain.getInstanceIds().iterator().next());
    authenticationManager = (AuthenticationManager) subsystem.getBean("authenticationManager");

    transactionService = (TransactionService) ctx.getBean(ServiceRegistry.TRANSACTION_SERVICE.getLocalName());
    
    // Clean up before we start trying to create the test user
    transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
    {
        @Override
        public Void execute() throws Throwable
        {
            AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
            try
            {
                deleteAndy();
                return null;
            }
            finally
            {
                authenticationComponent.clearCurrentSecurityContext();
            }
        }
    }, false, true);
    
    userTransaction = transactionService.getUserTransaction();
    userTransaction.begin();

    StoreRef storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
    rootNodeRef = nodeService.getRootNode(storeRef);

    QName children = ContentModel.ASSOC_CHILDREN;
    QName system = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "system");
    QName container = ContentModel.TYPE_CONTAINER;
    QName types = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, "people");

    systemNodeRef = nodeService.createNode(rootNodeRef, children, system, container).getChildRef();
    typesNodeRef = nodeService.createNode(systemNodeRef, children, types, container).getChildRef();
    Map<QName, Serializable> props = createPersonProperties("Andy");
    personAndyNodeRef = nodeService.createNode(typesNodeRef, children, ContentModel.TYPE_PERSON, container, props).getChildRef();
    assertNotNull(personAndyNodeRef);
    
    AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
    
    authenticationComponent.clearCurrentSecurityContext();
}
 
Example 11
Source File: AuthDataLoad.java    From SearchServices with GNU Lesser General Public License v3.0 4 votes vote down vote up
@BeforeClass
public static void setup() throws Exception
{
    //Start test haness
    initAlfrescoCore("schema.xml");
    // Root

    NodeRef rootNodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    addStoreRoot(getCore(), dataModel, rootNodeRef, 1, 1, 1, 1);
    //        rsp.add("StoreRootNode", 1);

    // Base

    HashMap<QName, PropertyValue> baseFolderProperties = new HashMap<QName, PropertyValue>();
    baseFolderProperties.put(ContentModel.PROP_NAME, new StringPropertyValue("Base Folder"));
    NodeRef baseFolderNodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName baseFolderQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "baseFolder");
    ChildAssociationRef n01CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef,
                baseFolderQName, baseFolderNodeRef, true, 0);
    addNode(getCore(), dataModel, 1, 2, 1, ContentModel.TYPE_FOLDER, null, baseFolderProperties, null, "andy",
                new ChildAssociationRef[] { n01CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/"
                            + baseFolderQName.toString() }, baseFolderNodeRef, true);

    // Folders

    HashMap<QName, PropertyValue> folder00Properties = new HashMap<QName, PropertyValue>();
    folder00Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 0"));
    NodeRef folder00NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder00QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 0");
    ChildAssociationRef folder00CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
                baseFolderNodeRef, folder00QName, folder00NodeRef, true, 0);
    addNode(getCore(), dataModel, 1, 3, 1, ContentModel.TYPE_FOLDER, null, folder00Properties, null, "andy",
                new ChildAssociationRef[] { folder00CAR },
                new NodeRef[] { baseFolderNodeRef, rootNodeRef },
                new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() },
                folder00NodeRef, true);

    for (long i = 0; i < count; i++)
    {
        addAcl(getCore(), dataModel, 10 + (int) i, 10 + (int) i, (int) (i % maxReader), (int) maxReader);

        HashMap<QName, PropertyValue> content00Properties = new HashMap<QName, PropertyValue>();
        MLTextPropertyValue desc00 = new MLTextPropertyValue();
        desc00.addValue(Locale.ENGLISH, "Doc " + i);
        desc00.addValue(Locale.US, "Doc " + i);
        content00Properties.put(ContentModel.PROP_DESCRIPTION, desc00);
        content00Properties.put(ContentModel.PROP_TITLE, desc00);
        content00Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8",
                    "text/plain", null));
        content00Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Doc " + i));
        content00Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("Test"));
        content00Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("Test"));
        content00Properties.put(ContentModel.PROP_VERSION_LABEL, new StringPropertyValue("1.0"));
        content00Properties.put(ContentModel.PROP_OWNER, new StringPropertyValue("Test"));
        Date date00 = new Date();
        content00Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(
                    DefaultTypeConverter.INSTANCE.convert(String.class, date00)));
        content00Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(
                    DefaultTypeConverter.INSTANCE.convert(String.class, date00)));
        HashMap<QName, String> content00Content = new HashMap<QName, String>();
        content00Content.put(ContentModel.PROP_CONTENT, "Test doc number " + i);
        NodeRef content00NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
        QName content00QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Doc-" + i);
        ChildAssociationRef content00CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
                    folder00NodeRef, content00QName, content00NodeRef, true, 0);
        addNode(getCore(), dataModel, 1, 10 + (int) i, 10 + (int) i, ContentModel.TYPE_CONTENT, new QName[] {
                    ContentModel.ASPECT_OWNABLE, ContentModel.ASPECT_TITLED }, content00Properties,
                    content00Content, "andy", new ChildAssociationRef[] { content00CAR }, new NodeRef[] {
                                baseFolderNodeRef, rootNodeRef, folder00NodeRef }, new String[] { "/"
                                + baseFolderQName.toString() + "/" + folder00QName.toString() + "/"
                                + content00QName.toString() }, content00NodeRef, false);
    }
    getCore().getUpdateHandler().commit(new CommitUpdateCommand(req(), false));

}