Package org.wso2.carbon.registry.core.jdbc.dataobjects

Examples of org.wso2.carbon.registry.core.jdbc.dataobjects.ResourceDO


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


            // existence of the resource id doesn't mean the existence of the
            // resource, so need to verify resource existence

            // load the meta data for the existing resource
            ResourceDO oldResourceDO = resourceDAO.getResourceDO(resourceID);

            if (oldResourceDO != null) {
                // the resource does exists
                resourceExists = true;
                prepareUpdate(resource, resourceID, oldResourceDO);
                update(resourceID, (ResourceImpl) resource, oldResourceDO);
            }
        }
        if (!resourceExists) {

            // now we are checking whether there is an entry with the inverse type
            ResourceIDImpl inverseResourceID = resourceDAO.getResourceID(purePath,
                    !(resource instanceof CollectionImpl));
            if (inverseResourceID != null) {
                ResourceDO inverseResourceDO = resourceDAO.getResourceDO(inverseResourceID);
                if (inverseResourceDO != null) {
                    // well, in fact there is an inverse type => we are deleting the resource
                    deleteSubTree(inverseResourceID, inverseResourceDO, false);
                }
            }
View Full Code Here

    public void delete(String path) throws RegistryException {

        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
View Full Code Here

    public void prepareVersionRestore(String path) throws RegistryException {

        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
View Full Code Here

     */
    public void prepareDumpRestore(String path) throws RegistryException {
        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
View Full Code Here

        if (resourceID.isCollection()) {
            // recursively call for all the resources in the tree..
            ArrayList<ResourceIDImpl> childIDs = resourceDAO.getChildPathIds(resourceID);
            for (ResourceIDImpl childID : childIDs) {
                ResourceDO childResourceDO = resourceDAO.getResourceDO(childID);
                if(childResourceDO != null){
                    recursionRepository.deleteSubTree(childID, childResourceDO,
                            keepAuthorization);
                }
            }
View Full Code Here

            throw new AuthorizationFailedException(msg);
        }

        // check for existence of target path, if target exist delete them
        ResourceIDImpl targetExistingResourceID = resourceDAO.getResourceID(targetPath);
        ResourceDO targetExistingResourceDO;
        if (targetExistingResourceID != null) {
            targetExistingResourceDO = resourceDAO.getResourceDO(targetExistingResourceID);
            if (targetExistingResourceDO == null && targetExistingResourceID.isCollection()) {
                // we have to check the possibility non collection having this path
                targetExistingResourceID = resourceDAO.getResourceID(targetPath, false);
View Full Code Here

                contentId = resourceDAO.addContentBytes(new ByteArrayInputStream(contentBytes));
            }
            resourceImpl.setDbBasedContentID(contentId);
        }

        ResourceDO resourceDO = resourceImpl.getResourceDO();
        resourceDAO.addResourceDO(resourceDO);
        resourceImpl.setVersionNumber(resourceDO.getVersion());

        // adding the properties.
        resourceDAO.addProperties(resourceImpl);

        // adding comments
View Full Code Here

     * Method to get the resource data object.
     *
     * @return the resource data object.
     */
    public ResourceDO getResourceDO() {
        ResourceDO resourceDO = new ResourceDO();
        resourceDO.setPathID(this.getPathID());
        resourceDO.setName(this.name);
        resourceDO.setVersion(this.versionNumber);
        resourceDO.setMediaType(this.mediaType);
        resourceDO.setAuthor(this.authorUserName);
        resourceDO.setCreatedOn(this.createdTime);
        resourceDO.setLastUpdater(this.lastUpdaterUserName);
        resourceDO.setLastUpdatedOn(this.lastModified);
        resourceDO.setDescription(this.description);
        resourceDO.setContentID(this.dbBasedContentID);

        return resourceDO;
    }
View Full Code Here

            ps = conn.prepareStatement(sql);
            ps.setLong(1, version);
            ps.setInt(2, CurrentSession.getTenantId());

            ResourceDO resourceDO = null;
            result = ps.executeQuery();
            if (result.next()) {
                resourceDO = new ResourceDO();

                resourceDO.setPathID(result.getInt(DatabaseConstants.PATH_ID_FIELD));
                resourceDO.setName(result.getString(DatabaseConstants.NAME_FIELD));
                resourceDO.setVersion(version);
                resourceDO.setMediaType(result.getString(DatabaseConstants.MEDIA_TYPE_FIELD));
                resourceDO.setAuthor(result.getString(DatabaseConstants.CREATOR_FIELD));
                resourceDO.setCreatedOn(
                        result.getTimestamp(DatabaseConstants.CREATED_TIME_FIELD).getTime());
                resourceDO.setLastUpdater(result.getString(DatabaseConstants.LAST_UPDATER_FIELD));
                resourceDO.setLastUpdatedOn(
                        result.getTimestamp(DatabaseConstants.LAST_UPDATED_TIME_FIELD).getTime());
                resourceDO.setDescription(result.getString(DatabaseConstants.DESCRIPTION_FIELD));
                resourceDO.setContentID(result.getInt(DatabaseConstants.CONTENT_ID_FIELD));
            }

            return resourceDO;

        } catch (SQLException e) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.jdbc.dataobjects.ResourceDO

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.