Examples of RuntimeProject


Examples of com.volantis.mcs.runtime.RuntimeProject

    }

    public void startElement(String systemId) {

        // Get the project of the enclosing elements. This must never be null.
        RuntimeProject enclosingProject = (RuntimeProject)
                projectStack.getCurrentProject();
        if (enclosingProject == null) {
            throw new IllegalStateException("Current project " +
                    "must never be null");
        }

        // Check whether the base URL is different from the enclosing one, if
        // it is then we need to find the project associated with it, otherwise
        // it is the same as the enclosing one.
        boolean baseURLChanged = baseURLTracker.startElement(systemId);
        RuntimeProject newProject;
        if (baseURLChanged) {
            MarinerURL baseURL = baseURLTracker.getBaseURL();
            String baseURLAsString = baseURL.getExternalForm();
            newProject = projectManager.getProject(baseURLAsString,
                                enclosingProject);
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        // themes and layouts. These need to be set up before we get any
        // per-page versions.

        // Get the current project.
        MarinerPageContext pageContext = getPageContext(context);
        final RuntimeProject runtimeProject = (RuntimeProject)
                pageContext.getCurrentProject();

        if (runtimeProject != null) {
            // Add any project specified style sheets into the list of
            // theme style sheets. These must be added before any style
            // sheets that are specified in the head.
            addProjectStyleSheets(context, runtimeProject);

            // Extract any default layout from the project.
            // This will be overridden with an any explicit layout
            // provided in the head.
            layoutName = runtimeProject.getDefaultProjectLayoutLocation();
            if (logger.isDebugEnabled()) {
                logger.debug("Project layout: " + layoutName);
            }
        }
        // else, presumably this is only for test...?
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        }

        PolicyBuildersResponse response =
                buildersReader.getPolicyBuilders(null, url);

        final RuntimeProject project = (RuntimeProject) response.getProject();

        PolicyBuilders builders = response.getBuilders();
        if (builders != null) {
            Iterator iterator = builders.getPolicyBuilders().iterator();
            while (iterator.hasNext()) {
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        String name = builder.getName();
        if (logger.isDebugEnabled()) {
            logger.debug("Adding to the map: " + name + " builder " + builder);
        }

        RuntimeProject currentProject = projectProvider.getCurrentProject();
        ActivatedPolicy activatedPolicy = (ActivatedPolicy)
                activator.activate(currentProject, builder, currentProject);

        repository.put(name, activatedPolicy);
    }
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

    protected RuntimeProject getProject(HttpGetMethod method) {

        // Look at the special header to see whether the remote server has
        // identified the project that contains the policy. If it has not then
        // assume that the remote server
        RuntimeProject project;
        Header header = method.getResponseHeader(
                RemoteProjectLoader.MCS_PROJECT_HEADER);
        if (header == null) {
            project = projectManager.getGlobalProject();
        } else {
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        // If the project is the global project then it
        // maybe that the policy is actually in a different project
        // but the request was deferred until now in order to allow
        // the project identification to be combined with retrieval
        // of the policy in order to save time on the server.
        RuntimeProject global = projectManager.getGlobalProject();
        if (project == global) {
            project = getProject(method);
        }
        return project;
    }
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

    public PolicyBuilderResponse getPolicyBuilder(
            Project project, String name) {

        PolicyBuilder builder = null;

        RuntimeProject runtimeProject = (RuntimeProject) project;
        if (!runtimeProject.isRemote()) {
            throw new IllegalStateException("Project is not remote");
        }

        // If the name is project relative then make it absolute.
        if (name.startsWith("/")) {
            name = runtimeProject.makeAbsolutePolicyURL(name);
        }
       
        HttpGetMethod method = methodFactory.createGetMethod(name);
        Throwable throwable = null;
        try {
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

     * @return the script asset reference or null
     */
    private static ScriptAssetReference getScriptAssetReference(
            final String policyName, final MarinerPageContext pageContext) {

        final RuntimeProject project = pageContext.getCurrentProject();
        final MarinerURL baseURL = pageContext.getBaseURL();
        final PolicyReferenceFactory factory =
            pageContext.getPolicyReferenceFactory();
        final RuntimePolicyReference reference =
            factory.createLazyNormalizedReference(
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        //   Test Expectations
        // =====================================================================
        RuntimeProjectConfigurator configurator =
                new RuntimeProjectConfiguratorImpl(localConstraintsMap,
                        remoteConstraintsMap, urlMapperMock, policyCacheMock);
        RuntimeProject project = configurator.createGlobalProject(
                policySourceFactoryMock);

        assertNotNull(project.getPolicySource());
        assertTrue("Must be remote", project.isRemote());
        assertTrue("Must contain orphans", project.getContainsOrphans());
        assertNull(project.getAssetsBaseURL());
        assertNull(project.getGeneratedResourcesBaseDir());

        assertNull(project.getPrefixURL(VariantType.AUDIO));
        assertNull(project.getPrefixURL(VariantType.IMAGE));
        assertNull(project.getPrefixURL(VariantType.SCRIPT));
        assertNull(project.getPrefixURL(VariantType.TEXT));
        assertNull(project.getPrefixURL(VariantType.VIDEO));
    }
View Full Code Here

Examples of com.volantis.mcs.runtime.RuntimeProject

        // =====================================================================
        RuntimeProjectConfigurator configurator =
                new RuntimeProjectConfiguratorImpl(localConstraintsMap,
                        remoteConstraintsMap, urlMapperMock, policyCacheMock);

        RuntimeProject project = configurator.buildProject(configuration, null,
                policySourceFactoryMock);
        assertSame(xmlPolicySourceMock, project.getPolicySource());
        assertFalse(project.isRemote());
        assertSame(localConstraintsMap,
                project.getCacheControlConstraintsMap());
        assertSame(groupMock, project.getCacheGroup());
        // todo add other tests.
    }
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.