Package org.apache.jetspeed.components.persistence.store

Examples of org.apache.jetspeed.components.persistence.store.PersistenceStore


            PortletEntityImpl entity = (PortletEntityImpl) entityCache.get(entityId);
            return entity;
        }
        else
        {
            PersistenceStore store = getPersistenceStore();
            prepareTransaction(store);

            Filter filter = store.newFilter();
            filter.addEqualTo("id", entityId.toString());
            Object q = store.newQuery(PortletEntityImpl.class, filter);
            MutablePortletEntity portletEntity = (MutablePortletEntity) store.getObjectByQuery(q);
            if (portletEntity == null)
            {
                return null;
            }
            else
View Full Code Here


        if (entityCache.containsKey(portletEntity.getId()))
        {
            entityCache.remove(entityCache.get(portletEntity.getId()));
        }

        PersistenceStore store = getPersistenceStore();
        try
        {
            prepareTransaction(store);

            entityCache.remove(portletEntity.getId());

            store.deletePersistent(portletEntity);

            store.getTransaction().checkpoint();
        }
        catch (Exception e)
        {
            String msg = "Unable to delete Portlet Entity.";
            log.error(msg, e);

            store.getTransaction().rollback();

            throw new PortletEntityNotDeletedException(msg, e);
        }

    }
View Full Code Here

        mockListener.expects(new InvokeOnceMatcher()).method("afterMakePersistent").isVoid();
        mockListener.expects(new InvokeOnceMatcher()).method("beforeMakePersistent").isVoid();
        mockListener.expects(new InvokeOnceMatcher()).method("afterDeletePersistent").isVoid();
        mockListener.expects(new InvokeOnceMatcher()).method("beforeDeletePersistent").isVoid();
       
        PersistenceStore store2 = new PBStore("jetspeed");
        store2.getTransaction().begin();
        A a2 = new A();
        a2.setName("a2");
        store2.makePersistent(a2);
        store2.getTransaction().commit();
       
        store2.getTransaction().begin();
        store2.deletePersistent(a2);
        store2.getTransaction().commit();
       
        mockListener.verify();
    }
View Full Code Here

            PortletEntityImpl entity = (PortletEntityImpl) entityCache.get(entityId);
            return entity;
        }
        else
        {
            PersistenceStore store = getPersistenceStore();
            prepareTransaction(store);

            Filter filter = store.newFilter();
            filter.addEqualTo("id", entityId.toString());
            Object q = store.newQuery(PortletEntityImpl.class, filter);
            MutablePortletEntity portletEntity = (MutablePortletEntity) store.getObjectByQuery(q);
            if (portletEntity == null)
            {
                return null;
            }
            else
View Full Code Here

        if (entityCache.containsKey(portletEntity.getId()))
        {
            entityCache.remove(entityCache.get(portletEntity.getId()));
        }

        PersistenceStore store = getPersistenceStore();
        try
        {
            prepareTransaction(store);

            entityCache.remove(portletEntity.getId());

            store.deletePersistent(portletEntity);

            store.getTransaction().checkpoint();
        }
        catch (Exception e)
        {
            String msg = "Unable to delete Portlet Entity.";
            log.error(msg, e);

            store.getTransaction().rollback();

            throw new PortletEntityNotDeletedException(msg, e);
        }

    }
View Full Code Here

     * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getAllPortletDefinitions()
     * @return
     */
    public Collection getAllPortletDefinitions()
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Collection pds = store.getExtent(portletDefClass);
        Iterator itrPds = pds.iterator();
        while (itrPds.hasNext())
        {
            try
            {
View Full Code Here

     * @param id
     * @return
     */
    public MutablePortletApplication getPortletApplication( ObjectID id )
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Filter filter = store.newFilter();
        filter.addEqualTo("id", new Long(id.toString()));
        Object query = store.newQuery(portletAppClass, filter);
        return (MutablePortletApplication) postLoad(store.getObjectByQuery(query));
    }
View Full Code Here

     * @param name
     * @return
     */
    public MutablePortletApplication getPortletApplication( String name )
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Filter filter = store.newFilter();
        filter.addEqualTo("name", name);
        Object query = store.newQuery(portletAppClass, filter);
        return (MutablePortletApplication) postLoad(store.getObjectByQuery(query));
    }
View Full Code Here

     * @param ident
     * @return
     */
    public MutablePortletApplication getPortletApplicationByIdentifier( String ident )
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Filter filter = store.newFilter();
        filter.addEqualTo("applicationIdentifier", ident);
        Object query = store.newQuery(portletAppClass, filter);
        return (MutablePortletApplication) postLoad(store.getObjectByQuery(query));
    }
View Full Code Here

     * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletApplications()
     * @return
     */
    public Collection getPortletApplications()
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Collection pas = store.getExtent(portletAppClass);
        Iterator itrPas = pas.iterator();
        while (itrPas.hasNext())
        {
            try
            {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.components.persistence.store.PersistenceStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.