Examples of PackageId


Examples of org.apache.jackrabbit.vault.packaging.PackageId

            name = name.substring(0, name.length() - 4);
        }
        if (!PackageId.isValid(group, name, version)) {
            throw new RepositoryException("Unable to create package. Illegal package name.");
        }
        PackageId pid = new PackageId(group, name, version);
        Node folder = mkdir(Text.getRelativeParent(pid.getInstallationPath(), 1), false);
        try {
            return JcrPackageImpl.createNew(folder, pid, null, false);
        } finally {
            session.save();
        }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

        if (!PackageId.isValid(group, name, version)) {
            throw new RepositoryException("Unable to rename package. Illegal package name.");
        }

        JcrPackageDefinition def = pack.getDefinition();
        PackageId id = def.getId();
        PackageId newId = new PackageId(
                group == null ? id.getGroup() : group,
                name == null ? id.getName() : name,
                version == null ? id.getVersion() : Version.create(version)
        );
        String dstPath = newId.getInstallationPath() + ".zip";
        if (id.equals(newId) && pack.getNode().getPath().equals(dstPath)) {
            log.info("Package id not changed. won't rename.");
            return pack;
        }
        def.setId(newId, false);
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

     * {@inheritDoc}
     */
    private void validateSubPackages(JcrPackageDefinitionImpl def)
            throws RepositoryException, PackageException {
        List<JcrPackage> subs = listPackages(def.getMetaInf().getFilter());
        PackageId id = def.getId();
        for (JcrPackage p: subs) {
            // check if not include itself
            if (p.getDefinition().getId().equals(id)) {
                throw new PackageException("A package cannot include itself. Check filter definition.");
            }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

            String path = getInstallationPath();
            if (path == null) {
                log.warn("Unable to calculate installation path. setting to 'unknown'");
                path = "unknown";
            }
            return new PackageId(path, version);
        } else {
            return new PackageId(group, name, version);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

    /**
     * Load the given properties from the content
     * @param props the properties to load
     */
    protected void loadProperties(Properties props) {
        PackageId id = getId();
        setProperty(props, VaultPackage.NAME_VERSION, id.getVersionString());
        setProperty(props, VaultPackage.NAME_NAME, id.getName());
        setProperty(props, VaultPackage.NAME_GROUP, id.getGroup());
        setProperty(props, VaultPackage.NAME_BUILD_COUNT, get(PN_BUILD_COUNT));
        setProperty(props, VaultPackage.NAME_DESCRIPTION, get(PN_DESCRIPTION));
        setProperty(props, VaultPackage.NAME_REQUIRES_ROOT, get(PN_REQUIRES_ROOT));
        setProperty(props, VaultPackage.NAME_REQUIRES_RESTART, get(PN_REQUIRES_RESTART));
        setProperty(props, VaultPackage.NAME_LAST_MODIFIED, getCalendar(PN_LASTMODIFIED));
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

                 version = "";
            }
            String group = getProperty(NAME_GROUP);
            String name = getProperty(NAME_NAME);
            if (group != null && name != null) {
                id = new PackageId(group, name, version);
            } else {
                // check for legacy packages that only contains a 'path' property
                String path = getProperty("path");
                if (path == null || path.length() == 0) {
                    log.warn("Package does not specify a path. setting to 'unknown'");
                    path = UNKNOWN_PATH;
                }
                id = new PackageId(path, version);
            }
        }
        return id;
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

            String path = getInstallationPath();
            if (path == null) {
                log.warn("Unable to calculate installation path. setting to 'unknown'");
                path = "unknown";
            }
            return new PackageId(path, version);
        } else {
            return new PackageId(group, name, version);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

    /**
     * Load the given properties from the content
     * @param props the properties to load
     */
    protected void loadProperties(Properties props) {
        PackageId id = getId();
        setProperty(props, VaultPackage.NAME_VERSION, id.getVersionString());
        setProperty(props, VaultPackage.NAME_NAME, id.getName());
        setProperty(props, VaultPackage.NAME_GROUP, id.getGroup());
        setProperty(props, VaultPackage.NAME_BUILD_COUNT, get(PN_BUILD_COUNT));
        setProperty(props, VaultPackage.NAME_DESCRIPTION, get(PN_DESCRIPTION));
        setProperty(props, VaultPackage.NAME_REQUIRES_ROOT, get(PN_REQUIRES_ROOT));
        setProperty(props, VaultPackage.NAME_REQUIRES_RESTART, get(PN_REQUIRES_RESTART));
        setProperty(props, VaultPackage.NAME_LAST_MODIFIED, getCalendar(PN_LASTMODIFIED));
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

                 version = "";
            }
            String group = getProperty(NAME_GROUP);
            String name = getProperty(NAME_NAME);
            if (group != null && name != null) {
                id = new PackageId(group, name, version);
            } else {
                // check for legacy packages that only contains a 'path' property
                String path = getProperty("path");
                if (path == null || path.length() == 0) {
                    log.warn("Package does not specify a path. setting to 'unknown'");
                    path = UNKNOWN_PATH;
                }
                id = new PackageId(path, version);
            }
        }
        return id;
    }
View Full Code Here

Examples of org.apache.jackrabbit.vault.packaging.PackageId

        // check if package id is correct
        JcrPackageDefinition jDef = getDefinition();
        if (jDef == null) {
            return true;
        }
        PackageId id = jDef.getId();
        PackageId cId = new PackageId(node.getPath());
        // compare installation paths since non-conform version numbers might
        // lead to different pids (bug #35564)
        if (id.getInstallationPath().equals(cId.getInstallationPath())) {
            if (autoFix && id.isFromPath()) {
                // if definition has no id set, fix anyways
                jDef.setId(cId, autoSave);
            }
            return true;
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.