Examples of WidgetConfig


Examples of net.rim.tumbler.config.WidgetConfig

            wa.validate();

            // parse/validate config.xml
            Logger.logMessage( LogType.INFO, "PROGRESS_SESSION_CONFIGXML" );
            XMLParser xmlparser = new ConfigXMLParser();
            WidgetConfig config = xmlparser.parseXML( wa ); // raw data, without \

            // create/clean outputs/source
            // Logger.printInfoMessage("BlackBerry WebWorks application packaging starts...");
            FileManager fileManager = new FileManager( bbwpProperties, config.getAccessTable() );
            Logger.logMessage( LogType.INFO, "PROGRESS_FILE_POPULATING_SOURCE" );
            fileManager.prepare();

            // Set 3rd party extension classes
            config.setExtensionClasses( fileManager.getExtensionClasses() );
            config.setExtensionJSFiles( fileManager.getExtensionJSFiles() );
            config.setSharedGlobalJSFiles( fileManager.getSharedGlobalJSFiles() );

            // create autogen file
            WidgetConfigSerializer wcs = new WidgetConfig_v1Serializer( config );
            byte[] autogenFile = wcs.serialize();
            fileManager.writeToSource( autogenFile, AUTOGEN_FILE );

            // create jdw/jdp files
            fileManager.generateProjectFiles( sessionManager.getSourceFolder(), sessionManager.getArchiveName(),
                    config.getName(), config.getVersion(), config.getAuthor(), config.getContent(), config.getBackgroundSource(),
                    config.isStartupEnabled(), config.getIconSrc(), config.getHoverIconSrc(), fileManager.getFiles(),
                    bbwpProperties.getImports() );

            // run rapc
            Logger.logMessage( LogType.INFO, "PROGRESS_COMPILING" );
            Rapc rapc = new Rapc( bbwpProperties, config, fileManager.getCompiledJARDependencies() );
View Full Code Here

Examples of net.rim.tumbler.config.WidgetConfig

public class ConfigXMLParser implements XMLParser {

    private WidgetConfig _widgetConfig;
   
    public ConfigXMLParser() {
        _widgetConfig = new WidgetConfig();
    }
View Full Code Here

Examples of net.rim.tumbler.config.WidgetConfig

            wa.validate();

            // parse/validate config.xml
            Logger.logMessage(LogType.INFO, "PROGRESS_SESSION_CONFIGXML");
            XMLParser xmlparser = new ConfigXMLParser();     
            WidgetConfig config = xmlparser.parseXML(wa); // raw data, without \
           
            // create/clean outputs/source
            // Logger.printInfoMessage("Widget packaging starts...");
            FileManager fileManager = new FileManager(bbwpProperties);
            Logger.logMessage(LogType.INFO, "PROGRESS_FILE_POPULATING_SOURCE");
            fileManager.prepare();

            //
            // Copy the JS extensions.
            //
            Map<String, Vector<String>> entryClassTable = null;
            if (SessionManager.getInstance().isPlayBook()) {
                entryClassTable = copyExtensions(bbwpProperties, config);
            }

            // Set 3rd party extension classes
            if (!SessionManager.getInstance().isPlayBook()) {
                config.setExtensionClasses(fileManager.getExtensionClasses());
            }
           
            // create autogen file
            WidgetConfigSerializer wcs = new WidgetConfig_v1Serializer(config, entryClassTable);
            byte[] autogenFile = wcs.serialize();
            fileManager.writeToSource(autogenFile, AUTOGEN_FILE);

            // create jdw/jdp files
            if (!SessionManager.getInstance().isPlayBook()) {
            fileManager.generateProjectFiles(sessionManager.getSourceFolder(),
                    sessionManager.getArchiveName(), config.getName(), config
                            .getVersion(), config.getAuthor(),config.getContent(),config.getBackgroundSource(),config.isStartupEnabled(), config
                            .getIconSrc(), config.getHoverIconSrc(),
                    fileManager.getFiles(), bbwpProperties.getImports());
            }

            // run mxmlc to compile ActionScript into SWF
            Logger.logMessage(LogType.INFO, "PROGRESS_COMPILING");
View Full Code Here

Examples of net.rim.tumbler.config.WidgetConfig

public class ConfigXMLParser implements XMLParser {

    private WidgetConfig _widgetConfig;
   
    public ConfigXMLParser() {
        _widgetConfig = new WidgetConfig();
    }
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

        //
        try {
            //
            PageConfig pageConfig = (PageConfig) request.getSession().getAttribute("pageConfig");
            String widgetId = (String) request.getAttribute("widgetId");
            WidgetConfig widgetConfig = pageConfig.getWidgetConfigById(widgetId);
            //
            WidgetRequest widgetRequest = new WidgetRequest(request, widgetConfig, "action");
            WidgetResponse widgetResponse = new WidgetResponse(response);
            //
            String lookupPath = urlPathHelper.getLookupPathForRequest(request);
            String queryString = urlPathHelper.getOriginatingQueryString(request);
            String actionPath = "/widget" + lookupPath + "?" + queryString;
            ServletContext widgetContext = getServletContext();
            if (StringUtils.hasText(widgetConfig.getContext())) {
                widgetContext = getServletContext().getContext(widgetConfig.getContext());
                if (widgetContext == null) {
                    return;
                }
            }
            //
            widgetRequest.setAttribute("requestType", "action");
            widgetRequest.setAttribute("widgetConfig", widgetConfig);
            //
            Navigator navigator = Navigator.reset();
            //
            for (WidgetActionInterceptor actionInterceptor : widgetActionInterceptors) {
                actionInterceptor.beforeAction(request, response);
            }
            widgetContext.getRequestDispatcher(actionPath).forward(widgetRequest, widgetResponse);
            //
            for (WidgetActionInterceptor actionInterceptor : widgetActionInterceptors) {
                actionInterceptor.afterAction(request, response);
            }
            //
            if (!StringUtils.hasText(navigator.getNavigateTo())) {
                widgetResponse.flushBuffer();
                return;
            }
            //
            String pathExpr = widgetConfig.getNavigationMap().get(navigator.getNavigateTo());
            if (StringUtils.hasText(pathExpr)) {
                Expression expression = expressionParser.parseExpression(pathExpr, ParserContext.TEMPLATE_EXPRESSION);
                EvaluationContext evaluationContext = createEvaluationContext();
                String path = (String) expression.getValue(evaluationContext, request);
                //
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

    @Override
    public void setValue(String value_) {
        value_ = "/widget" + value_;
        //
        WidgetConfig widgetConfig = (WidgetConfig) pageContext.getRequest().getAttribute("widgetConfig");
        //
        if (value_.contains("?")) {
            value_ += "&widgetId=" + widgetConfig.getId();
        } else {
            value_ += "?widgetId=" + widgetConfig.getId();
        }
        //
        super.setValue(value_);
    }
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

        if (request instanceof WidgetRequest && response instanceof WidgetResponse) {
            WidgetRequest widgetRequest = (WidgetRequest) request;
            WidgetResponse widgetResponse = (WidgetResponse) response;
            //
            if ("render".equals(widgetRequest.getRequestType())) {
                WidgetConfig widgetConfig = widgetRequest.getWidgetConfig();
                WidgetResponse cachedWidgetResponse = (WidgetResponse) widgetCache.get(widgetConfig);
                if (cachedWidgetResponse != null) {
                    FileCopyUtils.copy(cachedWidgetResponse.getResponseAsByteArray(), widgetResponse.getOutputStream());
                    return false;
                }
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

        if (request instanceof WidgetRequest && response instanceof WidgetResponse) {
            WidgetRequest widgetRequest = (WidgetRequest) request;
            WidgetResponse widgetResponse = (WidgetResponse) response;
            //
            if ("render".equals(widgetRequest.getRequestType())) {
                WidgetConfig widgetConfig = widgetRequest.getWidgetConfig();
                if (widgetConfig.getCache() > 0) {
                    widgetCache.put(widgetConfig, widgetResponse);
                }
            }
        }
    }
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

    }

    private Object getWidgetPrefValue(MethodParameter methodParameter, NativeWebRequest webRequest) {
        WidgetPref widgetPreference = methodParameter.getParameterAnnotation(WidgetPref.class);
        if (widgetPreference != null) {
            WidgetConfig widgetConfig = (WidgetConfig) webRequest.getAttribute("widgetConfig", WebRequest.SCOPE_REQUEST);
            String widgetPreferenceName = getWidgetPreferenceName(methodParameter, widgetPreference);
            if (widgetConfig != null) {
                String defaultValue = widgetPreference.defaultValue();
                Object value = widgetConfig.getPreferences().get(widgetPreferenceName);
                if (StringUtils.hasText(defaultValue) && value == null) {
                    value = defaultValue;
                }
                //
                if (widgetPreference.required()) {
View Full Code Here

Examples of org.focusns.common.web.page.config.WidgetConfig

                String target = widgetEle.getAttribute("target");
                String mode = widgetEle.getAttribute("mode");
                String cache = widgetEle.getAttribute("cache");
                String order = widgetEle.getAttribute("order");
                //
                WidgetConfig widgetConfig = new WidgetConfig(positionConfig);
                widgetConfig.setStyleId(styleId);
                widgetConfig.setStyleClass(styleClass);
                widgetConfig.setContext(context);
                widgetConfig.setTarget(target);
                widgetConfig.setMode(mode);
                widgetConfig.setCache("".equals(cache) ? 0 : Integer.parseInt(cache));
                widgetConfig.setOrder("".equals(order) ? 0 : Integer.parseInt(order));
                // preference element
                Element preferenceEle = DomUtils.getChildElementByTagName(widgetEle, "preference");
                if (preferenceEle != null) {
                    for (Element prefEle : DomUtils.getChildElements(preferenceEle)) {
                        String name = prefEle.getAttribute("name");
                        String value = DomUtils.getTextValue(prefEle);
                        widgetConfig.getPreferences().put(name, value);
                    }
                }
                // navigation
                Element navigationEle = DomUtils.getChildElementByTagName(widgetEle, "navigation");
                if (navigationEle != null) {
                    Map<String, String> navigationMap = new HashMap<String, String>();
                    List<Element> eventEles = DomUtils.getChildElementsByTagName(navigationEle, "event");
                    for (Element eventEle : eventEles) {
                        String eventOn = eventEle.getAttribute("on");
                        String eventTo = DomUtils.getTextValue(eventEle);
                        navigationMap.put(eventOn, eventTo);
                    }
                    widgetConfig.setNavigationMap(navigationMap);
                }
                // validation
                Element validationEle = DomUtils.getChildElementByTagName(widgetEle, "validation");
                if (validationEle != null) {
                    widgetConfig.setValidationForm(validationEle.getAttribute("formId"));
                    Element targetEle = DomUtils.getChildElementByTagName(validationEle, "target");
                    if (targetEle != null) {
                        widgetConfig.setValidationTarget(DomUtils.getTextValue(targetEle).trim());
                    }
                    Element groupsEle = DomUtils.getChildElementByTagName(validationEle, "groups");
                    if (groupsEle != null) {
                        List<String> validationGroups = new ArrayList<String>();
                        List<Element> groupEles = DomUtils.getChildElementsByTagName(groupsEle, "group");
                        for (Element groupEle : groupEles) {
                            validationGroups.add(DomUtils.getTextValue(groupEle).trim());
                        }
                        widgetConfig.setValidationGroups(validationGroups);
                    }
                }
                //
                positionConfig.addWidgetConfig(widgetConfig);
                // pageConfig.addWidgetConfig(position, widgetConfig);
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.