Package org.apache.cocoon.sunshine.connector

Examples of org.apache.cocoon.sunshine.connector.Resource


                                       String role,
                                       String id,
                                       boolean adminProfile)
    throws ProcessingException, SAXException, javax.xml.transform.TransformerException {
        // calling method is synced
        Resource res = (Resource)config.get(Constants.CONF_STATUS_SAVERESOURCE);
        Element statusProfile = (Element)XMLUtil.getFirstNodeFromPath((DocumentFragment)profile.get(Constants.PROFILE_PROFILE),
                         new String[] {"profile","status-profile"}, false);
        if (res != null && statusProfile != null) {
            DocumentFragment userFragment = statusProfile.getOwnerDocument().createDocumentFragment();
            Element oldParent = (Element)statusProfile.getParentNode();
            Element saveStatus = (Element)statusProfile.cloneNode(true);
            userFragment.appendChild(saveStatus);
            // now filter all not persistent sunlets!
            NodeList list = XMLUtil.getNodeListFromPath(saveStatus, new String[] {"customization","sunlet"});
            String sunletID;
            String sunletNumber;
            Element sunlet;
            Element sunletConfig;
            Map sunletConfigs = (Map)profile.get(Constants.PROFILE_DEFAULT_SUNLETS);
            Map mediaSunletConfigs = (Map)profile.get(Constants.PROFILE_MEDIA_SUNLETS);
            boolean isPersistent;
            for(int i = 0; i < list.getLength(); i++) {
                sunlet = (Element)list.item(i);
                sunletID = sunlet.getAttributeNS(null, "id");
                sunletNumber = sunlet.getAttributeNS(null, "number");
                sunletConfig = this.getSunletConfiguration(sunletID, sunletConfigs, mediaSunletConfigs);
                isPersistent = XMLUtil.getValueAsBooleanOf(sunletConfig, "configuration/persistent", false);
                if (isPersistent == false) {
                    sunlet.getParentNode().removeChild(sunlet);
                }
            }

            try {

                SourceParameters pars;
                pars = new SourceParameters();
                pars.setSingleParameterValue("ID", id);
                pars.setSingleParameterValue("role", role);
                pars.setSingleParameterValue("application", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_APPLICATION_NAME));
                pars.setSingleParameterValue("handler", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_HANDLER_NAME));
                pars.setSingleParameterValue("profile", "user-status");

                this.getResourceConnector().saveXML(res.getResourceType(), null,
                              res.getResourceIdentifier(), pars,
                              userFragment);
            } finally {
                userFragment.removeChild(saveStatus);
            }
        }
View Full Code Here


                        SourceParameters pars = new SourceParameters();
                        pars.setSingleParameterValue("profile", "sunlet-base");
                        pars.setSingleParameterValue("application", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_APPLICATION_NAME));
                        pars.setSingleParameterValue("handler", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_HANDLER_NAME));

                        Resource saveResource = (Resource)configuration.get(Constants.CONF_SUNLETBASE_SAVE_RESOURCE);

                        if (saveResource == null) {
                            throw new ProcessingException("sunSpot: No save resource defined for type sunlet-base.");
                        } else {

                            this.getResourceConnector().saveXML(saveResource.getResourceType(),null,
                                 saveResource.getResourceIdentifier(),pars,
                                 sunletsFragment);

                            // now the hardest part, clean up the whole cache
                            this.cleanUpCache(null, null, configuration);
                        }
                    }
                } finally {
                    this.getSunShineComponent().stopWritingTransaction(context);
                }
            }

            // general commands
            if (command != null && command.equals("cleancache") == true) {
                this.cleanUpCache(null, null, configuration);
            }

            String state = this.request.getParameter(SunSpot.REQ_PARAMETER_STATE);
            if (state == null) {
                state = (String)context.getAttribute(ATTRIBUTE_ADMIN_STATE, Constants.STATE_MAIN);
            }

            // now start producing xml:
            AttributesImpl attr = new AttributesImpl();
            consumer.startElement("", Constants.ELEMENT_ADMINCONF, Constants.ELEMENT_ADMINCONF, attr);

            context.setAttribute(ATTRIBUTE_ADMIN_STATE, state);
            consumer.startElement("", Constants.ELEMENT_STATE, Constants.ELEMENT_STATE, attr);
            consumer.characters(state.toCharArray(), 0, state.length());
            consumer.endElement("", Constants.ELEMENT_STATE, Constants.ELEMENT_STATE);

            if (state.equals(Constants.STATE_MAIN) == true) {

                DocumentFragment rolesDF = this.getSunRise().getRoles();
                Node             roles   = null;
                if (rolesDF != null) roles = XMLUtil.getSingleNode(rolesDF, "roles");
                IncludeXMLConsumer.includeNode(roles, consumer, consumer);
            }

            if (state.equals(Constants.STATE_MAIN_ROLE) == true) {

                DocumentFragment rolesDF = this.getSunRise().getRoles();
                Node             roles   = null;
                if (rolesDF != null) roles = XMLUtil.getSingleNode(rolesDF, "roles");
                IncludeXMLConsumer.includeNode(roles, consumer, consumer);

                String role = this.request.getParameter(SunSpot.REQ_PARAMETER_ROLE);
                if (role == null) {
                    role = (String)context.getAttribute(ATTRIBUTE_ADMIN_ROLE);
                }
                context.setAttribute(ATTRIBUTE_ADMIN_ROLE, role);
                if (role != null) {
                    this.sendStartElementEvent(consumer, "roleusers");
                    this.sendStartElementEvent(consumer, "name");
                    this.sendTextEvent(consumer, role);
                    this.sendEndElementEvent(consumer, "name");
                    DocumentFragment userDF = this.getSunRise().getUsers(role, null);
                    Node             users = null;
                    if (userDF != null) users = XMLUtil.getSingleNode(userDF, "users");
                    IncludeXMLConsumer.includeNode(users, consumer, consumer);
                    this.sendEndElementEvent(consumer, "roleusers");
                }
            }

            if (state.equals(Constants.STATE_GLOBAL) == true) {
                profileID = this.getProfileID(SunSpot.BUILDTYPE_VALUE_GLOBAL, null, null, true);
                Map profile = this.retrieveProfile(profileID);
                if (profile == null) {
                    this.createProfile(context, SunSpot.BUILDTYPE_VALUE_GLOBAL, null, null, true);
                    profile = this.retrieveProfile(profileID);
                }
                this.showPortal(consumer, true, context, profile, profileID);
            }

            if (state.equals(Constants.STATE_ROLE) == true) {
                String role = this.request.getParameter(SunSpot.REQ_PARAMETER_ROLE);
                if (role == null) {
                    role = (String)context.getAttribute(ATTRIBUTE_ADMIN_ROLE);
                }
                context.setAttribute(ATTRIBUTE_ADMIN_ROLE, role);
                if (role != null) {
                    consumer.startElement("", Constants.ELEMENT_ROLE, Constants.ELEMENT_ROLE, attr);
                    consumer.characters(role.toCharArray(), 0, role.length());
                    consumer.endElement("", Constants.ELEMENT_ROLE, Constants.ELEMENT_ROLE);
                    profileID = this.getProfileID(SunSpot.BUILDTYPE_VALUE_ROLE, role, null, true);
                    Map profile = this.retrieveProfile(profileID);
                    if (profile == null) {
                        this.createProfile(context, SunSpot.BUILDTYPE_VALUE_ROLE, role, null, true);
                        profile = this.retrieveProfile(profileID);
                    }
                    this.showPortal(consumer, true, context, profile, profileID);
                }
            }
            if (state.equals(Constants.STATE_USER) == true) {
                String role = this.request.getParameter(SunSpot.REQ_PARAMETER_ROLE);
                String id   = this.request.getParameter(SunSpot.REQ_PARAMETER_ID);
                if (role == null) {
                    role = (String)context.getAttribute(ATTRIBUTE_ADMIN_ROLE);
                }
                if (id == null) {
                    id = (String)context.getAttribute(ATTRIBUTE_ADMIN_ID);
                }
                context.setAttribute(ATTRIBUTE_ADMIN_ID, id);
                context.setAttribute(ATTRIBUTE_ADMIN_ROLE, role);
                if (role != null && id != null) {
                    consumer.startElement("", Constants.ELEMENT_ROLE, Constants.ELEMENT_ROLE, attr);
                    consumer.characters(role.toCharArray(), 0, role.length());
                    consumer.endElement("", Constants.ELEMENT_ROLE, Constants.ELEMENT_ROLE);
                    consumer.startElement("", Constants.ELEMENT_ID, Constants.ELEMENT_ID, attr);
                    consumer.characters(id.toCharArray(), 0, id.length());
                    consumer.endElement("", Constants.ELEMENT_ID, Constants.ELEMENT_ID);

                    profileID = this.getProfileID(SunSpot.BUILDTYPE_VALUE_ID, role, id, true);
                    Map profile = this.retrieveProfile(profileID);
                    if (profile == null) {
                        this.createProfile(context, SunSpot.BUILDTYPE_VALUE_ID, role, id, true);
                        profile = this.retrieveProfile(profileID);
                    }
                    this.showPortal(consumer, true, context, profile, profileID);
                }
            }
            // one sunlet
            if (state.equals(Constants.STATE_SUNLET) == true) {
                if (sunletsFragment != null && sunletID != null) {
                    Node sunlet = XMLUtil.getSingleNode(sunletsFragment, "sunlets-profile/sunlets/sunlet[@id='"+sunletID+"']");
                    if (sunlet != null) {
                        IncludeXMLConsumer.includeNode(sunlet, consumer, consumer);
                    }
                } else {
                    state = Constants.STATE_SUNLETS;
                }
            }
            if (state.equals(Constants.STATE_SUNLETS) == true) {
                consumer.startElement("", Constants.ELEMENT_SUNLETS, Constants.ELEMENT_SUNLETS, attr);

                // load the base sunlets profile
                if (sunletsFragment == null) {
                    SourceParameters pars = new SourceParameters();
                    pars.setSingleParameterValue("application", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_APPLICATION_NAME));
                    Resource res = (Resource)configuration.get(Constants.CONF_SUNLETBASE_RESOURCE);
                    if (res == null) {
                        throw new ProcessingException("No configuration for sunSpot-sunlet base profile found.");
                    }
                    sunletsFragment = this.loadXML(res.getResourceType(), null,
                                                   res.getResourceIdentifier(), pars,
                                                   "Error during loading of sunLet base.");
                    context.setAttribute(ATTRIBUTE_ADMIN_SUNLETS, sunletsFragment);
                }
                IncludeXMLConsumer.includeNode(XMLUtil.selectSingleNode(sunletsFragment,
                                   "sunlets-profile"), consumer, consumer);
View Full Code Here

                        Configuration child;

                        // build resource (optional)
                        child = config.getChild("buildprofile", false);
                        if (child != null) {
                            result.put(Constants.CONF_BUILD_RESOURCE, new Resource(this.resolver,
                                                                                   child.getAttribute("uri")));
                        }

                        // base resource, type is optional
                        child = config.getChild("layout-base", false);
                        if (child == null) {
                            throw new ProcessingException("sunSpot: layout-base required for application '" + appName + "'");
                        }
                        result.put(Constants.CONF_LAYOUTBASE_RESOURCE, new Resource(this.resolver,
                                                                                    child.getAttribute("uri")));
                        child = config.getChild("sunlet-base", false);
                        if (child == null) {
                            throw new ProcessingException("sunSpot: sunlet-base required for application '" + appName + "'");
                        }
                        result.put(Constants.CONF_SUNLETBASE_RESOURCE, new Resource(this.resolver,
                                                                                    child.getAttribute("uri")));
                        child = config.getChild("type-base", false);
                        if (child != null) {
                            result.put(Constants.CONF_TYPEBASE_RESOURCE, new Resource(this.resolver,
                                                                                      child.getAttribute("uri")));
                        }

                        // sunlet base save (is optional)
                        child = config.getChild("sunlet-base-save", false);
                        if (child != null) {
                            result.put(Constants.CONF_SUNLETBASE_SAVE_RESOURCE, new Resource(this.resolver,
                                                                                             child.getAttribute("uri")));
                        }

                        // global delta (load required)
                        child = config.getChild("global-delta-load", false);
                        if (child == null) {
                            throw new ProcessingException("sunSpot: global-delta-load required for application '" + appName + "'");
                        }
                        result.put(Constants.CONF_GLOBALDELTA_LOADRESOURCE, new Resource(this.resolver,
                                                                                         child.getAttribute("uri")));
                        child = config.getChild("global-delta-save", false);
                        if (child != null) {
                            result.put(Constants.CONF_GLOBALDELTA_SAVERESOURCE, new Resource(this.resolver,
                                                                                             child.getAttribute("uri")));
                        }
                        child = config.getChild("global-type-delta", false);
                        if (child != null) {
                            result.put(Constants.CONF_GLOBALDELTA_TYPERESOURCE, new Resource(this.resolver,
                                                                                             child.getAttribute("uri")));
                        }

                        // role delta (optional)
                        child = config.getChild("role-delta-load", false);
                        if (child != null) {
                            result.put(Constants.CONF_ROLEDELTA_LOADRESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }
                        child = config.getChild("role-delta-save", false);
                        if (child != null) {
                            result.put(Constants.CONF_ROLEDELTA_SAVERESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }
                        child = config.getChild("role-type-delta", false);
                        if (child != null) {
                            result.put(Constants.CONF_ROLEDELTA_TYPERESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }

                        // User delta
                        child = config.getChild("user-delta-load", false);
                        if (child != null) {
                            result.put(Constants.CONF_USERDELTA_LOADRESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }
                        child = config.getChild("user-delta-save", false);
                        if (child != null) {
                            result.put(Constants.CONF_USERDELTA_SAVERESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }
                        child = config.getChild("user-type-delta", false);
                        if (child != null) {
                            result.put(Constants.CONF_USERDELTA_TYPERESOURCE, new Resource(this.resolver,
                                                                                           child.getAttribute("uri")));
                        }

                        // Personal information
                        child = config.getChild("user-status-load", false);
                        if (child != null) {
                            result.put(Constants.CONF_STATUS_LOADRESOURCE, new Resource(this.resolver,
                                                                                        child.getAttribute("uri")));
                        }
                        child = config.getChild("user-status-save", false);
                        if (child != null) {
                            result.put(Constants.CONF_STATUS_SAVERESOURCE, new Resource(this.resolver,
                                                                                        child.getAttribute("uri")));
                        }

                        // Admin Type profil
                        child = config.getChild("admin-type-base", false);
                        if (child != null) {
                            result.put(Constants.CONF_ADMIN_TYPE_BASE, new Resource(this.resolver,
                                                                                    child.getAttribute("uri")));
                        }

                        // store the config in the session
                        session.setAttribute(Constants.ATTRIBUTE_CONFIGURATION + handlerName + ':' + appName, result);
View Full Code Here

        if (map == null) {
            throw new ProcessingException("sunSpot Configuration not found.");
        }

        // is the configuration build by using a own resource?
        Resource resource = (Resource)map.get(Constants.CONF_BUILD_RESOURCE);
        if (resource != null) {
            if (this.getLogger().isInfoEnabled() == true) {
                this.getLogger().info("Building sunSpot profile: " + resource.getResourceIdentifier());
            }
            this.getResourceConnector().loadXML(resource.getResourceType(),null,
                                       resource.getResourceIdentifier(),pars);
        } else {
            this.buildProfile(type, role, id, adminProfile);
        }

        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

        DocumentFragment layoutFragment;
        DocumentFragment typeFragment;
        DocumentFragment profile;
        Document         profileDoc;
        Element          profileRoot;
        Resource         res;

        SourceParameters pars = new SourceParameters();
        pars.setSingleParameterValue("application", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_APPLICATION_NAME));
        pars.setSingleParameterValue("handler", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_HANDLER_NAME));
        pars.setSingleParameterValue("profile", "sunlet-base");

        // First load the base profiles: sunletProfile + layoutProfile
        res = (Resource)config.get(Constants.CONF_SUNLETBASE_RESOURCE);
        if (res == null) {
            throw new ProcessingException("No configuration for sunSpot-sunlet base profile found.");
        }
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("Loading sunLet base profile");
        }
        sunletsFragment = this.loadXML(res.getResourceType(), null,
                                       res.getResourceIdentifier(), pars,
                                       "Error loading sunLet base profile." + res.getResourceIdentifier());
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("sunLet base profile loaded");
        }
        res = (Resource)config.get(Constants.CONF_LAYOUTBASE_RESOURCE);
        if (res == null) {
            throw new ProcessingException("No configuration for sunSpot-layout base profile found.");
        }
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("loading layout base profile");
        }
        pars.setSingleParameterValue("profile", "layout-base");
        layoutFragment = this.loadXML(res.getResourceType(), null,
                                      res.getResourceIdentifier(), pars,
                                      "Error loading layout base profile " + res.getResourceIdentifier());
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("layout base profile loaded");
        }
        // now create the base profile containing the above profiles
        profileDoc = XMLUtil.createDocument();
        profile = profileDoc.createDocumentFragment();
        profileRoot = profileDoc.createElementNS(null, "profile");
        profile.appendChild(profileRoot);
        profileRoot.appendChild(profileDoc.importNode(XMLUtil.selectSingleNode(layoutFragment,
                                                                  "layout-profile"), true));
        profileRoot.appendChild(profileDoc.importNode(XMLUtil.selectSingleNode(sunletsFragment,
                                                                  "sunlets-profile"), true));

        // if avalailable append the type profile
        if (adminProfile == true) {
            res = (Resource)config.get(Constants.CONF_ADMIN_TYPE_BASE);
            pars.setSingleParameterValue("profile", "admin-type-base");
        } else {
            res = (Resource)config.get(Constants.CONF_TYPEBASE_RESOURCE);
            pars.setSingleParameterValue("profile", "type-base");
        }
        if (res != null) {
            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("loading type base profile");
            }
            typeFragment = this.loadXML(res.getResourceType(), null,
                                        res.getResourceIdentifier(), pars,
                                        "Error loading type base profile " +res.getResourceIdentifier());
            profileRoot.appendChild(profileDoc.importNode(XMLUtil.selectSingleNode(typeFragment,
                              "type-profile"), true));

            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("type base profile loaded");
View Full Code Here

        // calling method is synced
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN buildGlobalProfile profileRoot="+profileRoot+", config="+config+", adminProfile="+adminProfile);
        }
        DocumentFragment globalFragment;
        Resource res = (Resource)config.get(Constants.CONF_GLOBALDELTA_LOADRESOURCE);
        if (res == null) {
            throw new ProcessingException("No configuration for sunSpot-role delta profile found.");
        }
        SourceParameters pars = new SourceParameters();
        pars.setSingleParameterValue("application", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_APPLICATION_NAME));
        pars.setSingleParameterValue("handler", (String)this.request.getAttribute(org.apache.cocoon.sunshine.sunrise.Constants.REQUEST_ATTRIBUTE_HANDLER_NAME));
        pars.setSingleParameterValue("profile", "global-delta");

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("loading global profile");
        }
        globalFragment = this.loadXML(res.getResourceType(), null,
                                      res.getResourceIdentifier(), pars,
                                      "Error loading global profile " + res.getResourceIdentifier());
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("global profile loaded");
        }
        this.importProfileDelta(profileRoot, globalFragment, "global-delta", "layout-delta");
        this.importProfileDelta(profileRoot, globalFragment, "global-delta", "sunlets-delta");
        this.addProfilePart(profileRoot, globalFragment, "global-delta", "portal-profile");
        this.addProfilePart(profileRoot, globalFragment, "global-delta", "personal-profile");

        // types
        res = (Resource)config.get(Constants.CONF_GLOBALDELTA_TYPERESOURCE);
        if (adminProfile == false && res != null) {
            pars.setSingleParameterValue("profile", "global-type-delta");
            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("loading global type profile");
            }
            globalFragment = this.loadXML(res.getResourceType(), null,
                                          res.getResourceIdentifier(), pars,
                                          "Error loading global type profile " + res.getResourceIdentifier());
            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("global type profile loaded");
            }
            this.addProfilePart(profileRoot, globalFragment, "global-delta", "type-profile");
        }
View Full Code Here

            if (this.getLogger().isDebugEnabled() == true) {
                this.getLogger().debug("start authentication");
            }

            final Resource authenticationResource = myHandler.getAuthenticationResource();
            final String   authenticationResourceName = authenticationResource.getResourceIdentifier();
            final int      authenticationResourceType = authenticationResource.getResourceType();
            final SourceParameters authenticationParameters = authenticationResource.getResourceParameters();
            if (parameters != null) {
                parameters.add(authenticationParameters);
            } else {
                parameters = authenticationParameters;
            }
View Full Code Here

            this.getLogger().debug("BEGIN getUsers role="+role+", ID="+ID);
        }
        DocumentFragment frag = null;

        if (this.handler != null && this.handler.getLoadUsersResource() != null) {
            final Resource loadUsersResource = this.handler.getLoadUsersResource();
            final SourceParameters loadParameters = loadUsersResource.getResourceParameters();
            SourceParameters parameters = (loadParameters == null) ? new SourceParameters()
                                                                     : (SourceParameters)loadParameters.clone();
            if (this.applicationName != null)
                parameters.setSingleParameterValue("application", this.applicationName);
            if (ID != null) {
                parameters.setSingleParameterValue("type", "user");
                parameters.setSingleParameterValue("ID", ID);
            } else {
                parameters.setSingleParameterValue("type", "users");
            }
            if (role != null) parameters.setSingleParameterValue("role", role);
            frag = this.getResourceConnector().loadXML(loadUsersResource.getResourceType(), null,
                                                       loadUsersResource.getResourceIdentifier(), parameters);
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getUsers fragment="+(frag == null ? "null" : XMLUtils.serializeNodeToXML(frag)));
        }
View Full Code Here

            this.getLogger().debug("BEGIN getRoles");
        }
        DocumentFragment frag = null;

        if (this.handler != null && this.handler.getLoadRolesResource() != null) {
            final Resource loadRolesResource = this.handler.getLoadRolesResource();
            final SourceParameters loadParameters = loadRolesResource.getResourceParameters();
            SourceParameters parameters = (loadParameters == null) ? new SourceParameters()
                                                                     : (SourceParameters)loadParameters.clone();
            if (this.applicationName != null)
                parameters.setSingleParameterValue("application", this.applicationName);
            parameters.setSingleParameterValue("type", "roles");
            frag = this.getResourceConnector().loadXML(loadRolesResource.getResourceType(), null,
                                                       loadRolesResource.getResourceIdentifier(), parameters);
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getRoles fragment="+frag);
        }
View Full Code Here

        // calling method is syned
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN addRole role="+name+", parameters="+parameters);
        }
        if (this.handler != null && this.handler.getNewRoleResource() != null) {
            final Resource newRoleResource = this.handler.getNewRoleResource();
            final SourceParameters handlerPars = newRoleResource.getResourceParameters();
            if (parameters == null) parameters = new SourceParameters();
            parameters.add(handlerPars);

            if (this.applicationName != null)
                parameters.setSingleParameterValue("application", this.applicationName);
            parameters.setSingleParameterValue("type", "role");
            parameters.setSingleParameterValue("role", name);

            this.getResourceConnector().loadXML(newRoleResource.getResourceType(), null,
                                                newRoleResource.getResourceIdentifier(), parameters);
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END addRole");
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sunshine.connector.Resource

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.