Package com.dotcms.repackage.org.apache.struts.config

Examples of com.dotcms.repackage.org.apache.struts.config.ModuleConfig


        String actionClassType = actionMapping.getType();

        //Injects the action classes inside the dotCMS context
        injectContext( actionClassType );

        ModuleConfig moduleConfig = getModuleConfig();
        //We need to unfreeze this module in order to add new action mappings
        unfreeze( moduleConfig );

        //Adding the ActionConfig to the ForwardConfig
        moduleConfig.addActionConfig( actionMapping );
        //moduleConfig.freeze();

        actions.add( actionMapping );
        Logger.info( this, "Added Struts Action Mapping: " + actionClassType );
    }
View Full Code Here


     */
    protected void unregisterActionMappings () throws Exception {

        if ( actions != null ) {

            ModuleConfig moduleConfig = getModuleConfig();
            //We need to unfreeze this module in order to add new action mappings
            unfreeze( moduleConfig );

            for ( ActionConfig actionConfig : actions ) {
                moduleConfig.removeActionConfig( actionConfig );
            }
            moduleConfig.freeze();
        }

    }
View Full Code Here

     */
    public static MessageResources getMessageResources(HttpServletRequest request,
                                                       ServletContext app)
    {
        /* Identify the current module */
        ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
        return (MessageResources)app.getAttribute(Globals.MESSAGES_KEY +
                                                  moduleConfig.getPrefix());
    }
View Full Code Here

                                                       String bundle)
    {
        MessageResources resources = null;

        /* Identify the current module */
        ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);


        if (bundle == null) {
            bundle = Globals.MESSAGES_KEY;
        }

        // First check request scope
        resources = (MessageResources) request.getAttribute(bundle + moduleConfig.getPrefix());

        if (resources == null) {
            resources = (MessageResources) app.getAttribute(bundle + moduleConfig.getPrefix());
        }

        return resources;
    }
View Full Code Here

    {
        /* Match against the list of sub-application prefixes */
        String prefix = ModuleUtils.getInstance().getModuleName(urlPath, app);

        /* Expose the resources for this sub-application */
        ModuleConfig config = (ModuleConfig)
            app.getAttribute(Globals.MODULE_KEY + prefix);

        return config;
    }
View Full Code Here

    public static String getActionMappingURL(ServletContext application,
                                             HttpServletRequest request,
                                             String action)
    {
        StringBuffer value = new StringBuffer(request.getContextPath());
        ModuleConfig config =
            (ModuleConfig)request.getAttribute(Globals.MODULE_KEY);
        if (config != null)
        {
            value.append(config.getPrefix());
        }

        /* Use our servlet mapping, if one is specified */
        String servletMapping =
            (String)application.getAttribute(Globals.SERVLET_KEY);
View Full Code Here

     */
    public static String getForwardURL(HttpServletRequest request,
                                       ServletContext app,
                                       String forward)
    {
        ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app);
        //TODO? beware of null module config if ActionServlet isn't init'ed?
        ForwardConfig fc = moduleConfig.findForwardConfig(forward);
        if (fc == null)
        {
            return null;
        }

View Full Code Here

      String attributeName = (String)itr.next();

      req.removeAttribute(attributeName);
        }

    ModuleConfig moduleConfig =
      (ModuleConfig)getPortletContext().getAttribute(Globals.MODULE_KEY);

    req.setAttribute(Globals.MODULE_KEY, moduleConfig);

    return strutsAttributes;
View Full Code Here

        {
            /* Is there a form bean associated with this mapping? */
            this.formName = config.getAttribute();
        }

        ModuleConfig mconfig = ModuleUtils.getInstance().getModuleConfig(request, app);
        this.resources = (ValidatorResources)app.getAttribute(ValidatorPlugIn.
                VALIDATOR_KEY +
                mconfig.getPrefix());

    }
View Full Code Here

        String formName = form.getName();

        jsFormName = formName;
        if(jsFormName.charAt(0) == '/') {
            String mappingName = StrutsUtils.getActionMappingName(jsFormName);
            ModuleConfig mconfig = ModuleUtils.getInstance().getModuleConfig(request, app);

            ActionConfig mapping = (ActionConfig) mconfig.findActionConfig(mappingName);
            if (mapping == null) {
                throw new NullPointerException("Cannot retrieve mapping for action " + mappingName);
            }
            jsFormName = mapping.getAttribute();
        }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.struts.config.ModuleConfig

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.