Examples of PersistenceStore


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

     * @param ident
     * @return
     */
    public PortletDefinitionComposite getPortletDefinitionByIdentifier( String ident )
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        Filter filter = store.newFilter();
        filter.addEqualTo("portletIdentifier", ident);
        Object query = store.newQuery(portletDefClass, filter);
        PortletDefinitionComposite portlet = (PortletDefinitionComposite) store.getObjectByQuery(query);
        if (portlet != null)
        {
            if (portlet.getPortletApplicationDefinition() == null)
            {
                final String msg = "getPortletDefinitionByIdentifier() returned a PortletDefinition that has no parent PortletApplication.";
View Full Code Here

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

     * @param name
     * @return
     */
    public PortletDefinitionComposite getPortletDefinitionByUniqueName( String name )
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);

        String appName = PortletRegistryHelper.parseAppName(name);
        String portletName = PortletRegistryHelper.parsePortletName(name);

        // build filter
        Filter filter = store.newFilter();
        filter.addEqualTo("app.name", appName);
        filter.addEqualTo("name", portletName);
        Object query = store.newQuery(portletDefClass, filter);
        PortletDefinitionComposite portlet = (PortletDefinitionComposite) store.getObjectByQuery(query);
        if (portlet != null)
        {
            if (portlet.getPortletApplicationDefinition() == null)
            {
                filter = store.newFilter();
                filter.addEqualTo("name", appName);
                query = store.newQuery(portletAppClass, filter);
                MutablePortletApplication app = (MutablePortletApplication) store.getObjectByQuery(query);
                if (null == app)
                {
                    final String msg = "getPortletDefinitionByUniqueName() returned a PortletDefinition that has no parent PortletApplication.";
                    log.error(msg);
                    throw new IllegalStateException(msg);
View Full Code Here

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

     * @param newApp
     * @throws RegistryException
     */
    public void registerPortletApplication( PortletApplicationDefinition newApp ) throws RegistryException
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);
        try
        {
            store.makePersistent(newApp);
            store.getTransaction().checkpoint();
        }
        catch (LockFailedException e)
        {
            throw new RegistryException("Unable to lock PortletApplicaiton for makePersistent: " + e.toString(), e);
        }
View Full Code Here

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

     * @param app
     * @throws TransactionStateException
     */
    public void removeApplication( PortletApplicationDefinition app ) throws RegistryException
    {
        PersistenceStore store = getPersistenceStore();
        prepareTransaction(store);

        String appNodePath = MutablePortletApplication.PREFS_ROOT + "/" + ((MutablePortletApplication) app).getName();
        try
        {
            if (Preferences.systemRoot().nodeExists(appNodePath))
            {
                Preferences node = Preferences.systemRoot().node(appNodePath);
                log.info("Removing Application preference node " + node.absolutePath());
                node.removeNode();
            }
        }
        catch (BackingStoreException e)
        {
            throw new RegistryException(e.toString(), e);
        }

        try
        {
            store.deletePersistent(app);           

        }
        catch (LockFailedException e)
        {
            throw new RegistryException("Unable to lock PortletApplication for deletion: " + e.toString(), e);
View Full Code Here

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

     */
    public void updatePortletApplication( PortletApplicationDefinition app ) throws RegistryException
    {
        try
        {
            PersistenceStore store = getPersistenceStore();
            prepareTransaction(store);
            store.lockForWrite(app);
            store.getTransaction().checkpoint();
        }
        catch (LockFailedException e)
        {
            throw new RegistryException("Unable to lock PortletApplicaiton for update: " + e.toString(), e);
        }
View Full Code Here

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

    public void savePortletDefinition( PortletDefinition portlet ) throws FailedToStorePortletDefinitionException
    {
        try
        {
            PersistenceStore store = getPersistenceStore();
            prepareTransaction(store);
            store.lockForWrite(portlet);
            store.getTransaction().checkpoint();
        }
        catch (LockFailedException e)
        {
            throw new FailedToStorePortletDefinitionException(portlet, e);
        }
View Full Code Here

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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.