Package org.apache.commons.scxml.model

Examples of org.apache.commons.scxml.model.CustomAction


            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLParser.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here


            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLDigester.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLDigester.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLParser.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLDigester.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLDigester.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLDigester.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

            if (item == null || !(item instanceof CustomAction)) {
                org.apache.commons.logging.Log log = LogFactory.
                    getLog(SCXMLParser.class);
                log.warn(ERR_CUSTOM_ACTION_TYPE);
            } else {
                CustomAction ca = (CustomAction) item;
                scxmlRules.setNamespaceURI(ca.getNamespaceURI());
                String xpfLocalName = STR_SLASH + ca.getLocalName();
                Class klass = ca.getActionClass();
                if (SCXMLHelper.implementationOf(klass,
                        ExternalContent.class)) {
                    addCustomActionRulesTuple(xp + xpfLocalName, scxmlRules,
                        klass, true);
                } else {
View Full Code Here

        // Create a list of the custom Commons SCXML actions defined by the
        // Shale dialog Commons SCXML implementation
        List shaleDialogActions = new ArrayList();

        // <shale:redirect>
        CustomAction redirectAction =
            new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI,
                "redirect", RedirectAction.class);
        shaleDialogActions.add(redirectAction);

        // <shale:view>
        CustomAction viewAction =
            new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI,
                "view", ViewAction.class);
        shaleDialogActions.add(viewAction);

        // Class loader for app developer defined custom Commons SCXML actions
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader == null) {
            loader = ConfigurationParser.class.getClassLoader();
        }

        while (iterator.hasNext()) {

                Map.Entry entry = (Map.Entry) iterator.next();
                String name = (String) entry.getKey();
                DialogMetadata dMetadata = (DialogMetadata) entry.getValue();
                String scxmlconfig = dMetadata.getScxmlconfig();

                // The custom actions available to this dialog is the
                // summation of the ones defined by this Shale dialog module
                // and those defined by the app developer using the dialog
                // configuration file for this dialog
                List customDialogActions = new ArrayList();
                customDialogActions.addAll(shaleDialogActions);

                List devActions = dMetadata.getDialogActions();
                for (int i = 0; i < devActions.size(); i++) {
                    SCXMLAction scxmlAction = (SCXMLAction) devActions.get(i);
                    String actionname = scxmlAction.getName();
                    String uri = scxmlAction.getUri();
                    String actionFQCN = scxmlAction.getActionclassname();
                    if (actionname == null || uri == null || actionFQCN == null) {
                        // shouldn't happen if dialog-config is validated
                        throw new IllegalArgumentException("A custom Commons"
                            + " SCXML action (<scxmlaction> element) in the"
                            + " dialog configuration is missing the 'name',"
                            + " 'uri' or 'actionclassname'");
                    }
                    Class customActionClass = null;
                    try {
                        customActionClass = loader.loadClass(actionFQCN);
                    } catch (Exception e) {
                        throw new IllegalArgumentException("Cannot load "
                            + "custom Commons SCXML action class '"
                            + actionFQCN + "' for action with name '"
                            + actionname + "'");
                    }
                    CustomAction customAction = new CustomAction(uri,
                        actionname, customActionClass);
                    customDialogActions.add(customAction);
                }

                URL resource = new URL(getResource(), scxmlconfig);
View Full Code Here

TOP

Related Classes of org.apache.commons.scxml.model.CustomAction

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.