Package org.enhydra.shark.xpdl.elements

Examples of org.enhydra.shark.xpdl.elements.ExternalPackages


                    xpdlhmain.synchronizePackages(xpdlh);

                    Package realPkg = xpdlhmain.getPackageById(pkg.getId());
                    ExternalPackage ep = null;
                    // insert ExternalPackage
                    ExternalPackages eps = mainPkg.getExternalPackages();
                    File f = new File(xpdlhmain.getAbsoluteFilePath(mainPkg));
                    String parentF = f.getParent();
                    Path newPath = new Path(parentF);
                    String eppath = xpdlhmain.getAbsoluteFilePath(realPkg);
                    String relativePath = Path.getRelativePath(new Path(eppath), newPath);
                    ep = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(eps, "", false);
                    ep.setHref(relativePath);
                    JaWEEAHandler.setExternalPackageEA(ep, realPkg.getId());
                    mainPkg.addExternalPackageMapping(relativePath, realPkg.getId());
                    eps.add(ep);

                    it = pkgsToInsert.iterator();
                    while (it.hasNext()) {
                        Package p = (Package) it.next();
                        boolean changed = adjustXPDL(p);
View Full Code Here


                    xpdlhmain.synchronizePackages(xpdlh);

                    Package realPkg = xpdlhmain.getPackageById(pkg.getId());
                    ExternalPackage ep = null;
                    // insert ExternalPackage
                    ExternalPackages eps = mainPkg.getExternalPackages();
                    File f = new File(xpdlhmain.getAbsoluteFilePath(mainPkg));
                    String parentF = f.getParent();
                    Path newPath = new Path(parentF);
                    String eppath = xpdlhmain.getAbsoluteFilePath(realPkg);
                    String relativePath = Path.getRelativePath(new Path(eppath), newPath);
                    ep = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(eps, "", false);
                    ep.setHref(relativePath);
                    JaWEEAHandler.setExternalPackageEA(ep, realPkg.getId());
                    mainPkg.addExternalPackageMapping(relativePath, realPkg.getId());
                    eps.add(ep);

                    it = pkgsToInsert.iterator();
                    while (it.hasNext()) {
                        Package p = (Package) it.next();
                        boolean changed = adjustXPDL(p);
View Full Code Here

            if (tRem != mainPkg && !tRem.isTransient()) {
                pkgsToRemove.add(tRem);
            }
        }

        ExternalPackages eps = mainPkg.getExternalPackages();
        ExternalPackage ep = mainPkg.getExternalPackage(toRemove.getId());

        if (pkgsToRemove.size() > 0) {
            boolean warningMessage = false;
            it = pkgsToRemove.iterator();
            while (it.hasNext()) {
                Package tRem = (Package) it.next();
                List refs = JaWEManager.getInstance().getXPDLUtils().getReferences(mainPkg,
                        tRem);
                if (refs.size() > 0) {
                    warningMessage = true;
                    break;
                }
            }
            if (warningMessage) {
                int yn = JOptionPane.showConfirmDialog(getJaWEFrame(),
                        settings.getLanguageDependentString("MessageReferencedDoYouReallyWantToDeleteSelectedItem"),
                        settings.getLanguageDependentString("DeletingKey"),
                        JOptionPane.YES_NO_OPTION);
                if (yn != JOptionPane.YES_OPTION) {
                    return;
                }
            }
        }

        try {
            if (ep != null) {
                mainPkg.removeExternalPackageMapping(ep.getHref());
            }
            if (pkgsToRemove.size() > 0) {
                it = pkgsToRemove.iterator();
                while (it.hasNext()) {
                    Package pkg = (Package) it.next();
                    XPDLListenerAndObservable xpdllo = getXPDLListenerObservable(pkg);
                    xpdllo.unregisterFromXPDL();
                    xpdlListenerObservables.remove(xpdllo);
                    xpdlh.closePackageVersion(pkg.getId(), pkg.getInternalVersion());
                }
                setChanged();
                notifyObservers(createInfo(mainPkg,
                        new ArrayList(pkgsToRemove),
                        XMLElementChangeInfo.REMOVED));
            }
            if (ep != null) {
                eps.remove(ep);
                List remove = new ArrayList();
                remove.add(ep);
                setChanged();
                notifyObservers(createInfo(eps, remove, XMLElementChangeInfo.REMOVED));
            }
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.elements.ExternalPackages

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.