Search in sources :

Example 1 with IFlatVirtualComponent

use of org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent in project webtools.sourceediting by eclipse.

the class FlatComponentDeployable method getExportModelChildren.

public IChildModuleReference[] getExportModelChildren() throws CoreException {
    IFlatVirtualComponent em = getFlatComponent();
    IChildModuleReference[] children = em.getChildModules();
    return children;
}
Also used : IFlatVirtualComponent(org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent) IChildModuleReference(org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference)

Example 2 with IFlatVirtualComponent

use of org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent in project webtools.sourceediting by eclipse.

the class FlatComponentDeployable method getFlatComponent.

/**
 * The export model is what does the grunt of the work
 * @return
 */
protected IFlatVirtualComponent getFlatComponent() {
    if (!shouldCache() || cacheFlattened == null) {
        FlatComponentTaskModel options = new FlatComponentTaskModel();
        options.put(FlatVirtualComponent.PARTICIPANT_LIST, Arrays.asList(getParticipants()));
        FlatVirtualComponent tmp = new FlatVirtualComponent(component, options);
        if (shouldCache())
            cacheFlattened = tmp;
        return tmp;
    }
    return cacheFlattened;
}
Also used : FlatComponentTaskModel(org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel) FlatVirtualComponent(org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent) IFlatVirtualComponent(org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent)

Example 3 with IFlatVirtualComponent

use of org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent in project webtools.sourceediting by eclipse.

the class FlatComponentDeployable method getURI.

/**
 * Returns the URI of the given contained CHILD module.
 *
 * SOFT requirements (NOT API!!) in use by some adopters
 * If the passed in module is equal to this module, return our own deployed name
 *
 * @param module a module
 * @return the URI of the given module, or <code>null</code> if the URI could
 *    not be found
 */
public String getURI(IModule module) {
    ProjectModule md = (ProjectModule) module.loadAdapter(ProjectModule.class, new NullProgressMonitor());
    if (md == this) {
        // guess my own name
        return VirtualReferenceUtilities.INSTANCE.getDefaultProjectArchiveName(this.component);
    }
    try {
        FlatComponentDeployable cd = (FlatComponentDeployable) module.loadAdapter(FlatComponentDeployable.class, new NullProgressMonitor());
        if (cd != null) {
            IFlatVirtualComponent em = getFlatComponent();
            IChildModuleReference[] children = em.getChildModules();
            for (int i = 0; i < children.length; i++) {
                IModule child = gatherModuleReference(component, children[i]);
                if (child != null && child.getId().equals(module.getId()))
                    return children[i].getRelativeURI().toString();
            }
        }
    } catch (CoreException ce) {
    }
    return null;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProjectModule(org.eclipse.wst.server.core.util.ProjectModule) IFlatVirtualComponent(org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent) IModule(org.eclipse.wst.server.core.IModule) CoreException(org.eclipse.core.runtime.CoreException) IChildModuleReference(org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference)

Example 4 with IFlatVirtualComponent

use of org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent in project webtools.sourceediting by eclipse.

the class FlatComponentDeployable method members.

@Override
public IModuleResource[] members() throws CoreException {
    if (component.isBinary())
        return LEGACY_binaryMembers();
    IFlatVirtualComponent em = getFlatComponent();
    IFlatResource[] resources = em.fetchResources();
    return convert(resources);
}
Also used : IFlatVirtualComponent(org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent) IFlatResource(org.eclipse.wst.common.componentcore.internal.flat.IFlatResource)

Aggregations

IFlatVirtualComponent (org.eclipse.wst.common.componentcore.internal.flat.IFlatVirtualComponent)4 IChildModuleReference (org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference)2 CoreException (org.eclipse.core.runtime.CoreException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 FlatVirtualComponent (org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent)1 FlatComponentTaskModel (org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel)1 IFlatResource (org.eclipse.wst.common.componentcore.internal.flat.IFlatResource)1 IModule (org.eclipse.wst.server.core.IModule)1 ProjectModule (org.eclipse.wst.server.core.util.ProjectModule)1