Package ariba.ui.aribaweb.core

Examples of ariba.ui.aribaweb.core.AWTemplate


    {
        AWAction[] actionList = (AWAction[])componentReference.userData();
        if (actionList == null) {
            AWElement contentElement = componentReference.contentElement();
            if (contentElement instanceof AWTemplate) {
                AWTemplate contentTemplate = (AWTemplate)contentElement;
                actionList = (AWAction[])contentTemplate.extractElementsOfClass(AWAction.class);
                componentReference.setUserData(actionList);
                AWConcreteTemplate newTemplate = new AWConcreteTemplate();
                newTemplate.init();
                AWElement[] elementArray = contentTemplate.elementArray();
                int elementArrayLength = elementArray.length;
                for (int index = 0; index < elementArrayLength; index++) {
                    AWElement currentElement = elementArray[index];
                    if (currentElement instanceof AWAction) {
                        break;
View Full Code Here


    /**
        This guarantees that the contentElement is always an AWTemplate.
    */
    public AWTemplate subtemplate ()
    {
        AWTemplate template = null;
        AWElement contentElement = contentElement();
        if (contentElement != null) {
            if (contentElement instanceof AWTemplate) {
                template = (AWTemplate)contentElement;
            }
View Full Code Here

    private void initializeElementArray ()
    {
        AWElement contentElement = componentReference().contentElement();
        if (contentElement != null) {
            if (contentElement instanceof AWTemplate) {
                AWTemplate elementsTemplate = (AWTemplate)contentElement;
                AWCycleable[] elementArray = elementsTemplate.elementArray();
                int elementCount = elementArray.length;
                for (int index = 0; index < elementCount; index++) {
                    AWElement currentElement = (AWElement)elementArray[index];
                    if ((currentElement != null) && (currentElement instanceof Column)) {
                        ((Column)currentElement).initializeColumn(this);
View Full Code Here

    }

    public void initWithContext (Context context, AWComponent component)
    {
        Meta meta = context.meta();
        AWTemplate template = component.template();
        String templateId = template.templateName().intern();
        TemplateData data = (TemplateData)meta.identityCache().get(templateId);
        if (data != null && data.template != template) {
            // unload rules
            for (Map.Entry<MetaRules, Meta.RuleSet> entry : data.elementMap.entrySet()) {
                Meta.RuleSet ruleSet = entry.getValue();
                ruleSet.disableRules();
                // FIXME!  Need to support reloading rules with same "natural order"
                // salience as in the original rule set

                // Force page rerendering, because we are invalidating the global
                // match -> property -> componentreference cache and will possibly
                // break the interphase (render -> applyValues) change rule for
                // meta content rendered *before* this
                component.requestContext().forceRerender();
            }
            data = null;
        }
        if (data == null) {
            data = new TemplateData();
            data.template = template;
            meta.identityCache().put(templateId, data);
        }

        Meta.RuleSet ruleSet= data.elementMap.get(this);
        if (ruleSet == null) {
            meta.beginRuleSet(Meta.TemplateRulePriority, template.templateName());
            try {
                new Parser(meta, contentString()).addRulesWithSelector(
                        Arrays.asList(new Rule.Selector(TemplateId, templateId)));
            } catch (Error e) {
                meta.endRuleSet().disableRules();
                throw new AWGenericException(Fmt.S("Error reading rules in <m:Rules> tag in %s -- %s", template.templateName(), e));
            } catch (Exception e) {
                meta.endRuleSet().disableRules();
                throw new AWGenericException(Fmt.S("Exception reading rules in <m:Rules> tag in %s", template.templateName()), e);
            }
            data.elementMap.put(this, meta.endRuleSet());
        }
    }
View Full Code Here

    private boolean initEmbeddedMetaRules(AWComponent component, Context context)
    {
        boolean hasOne = false;
        if (contentElement() instanceof AWTemplate) {
            AWTemplate template = (AWTemplate)contentElement();

            AWElement[] elements = template.elementArray();
            for (int i=0; i < elements.length; i++) {
                AWElement currElement = elements[i];
                if (currElement instanceof MetaRules) {
                    ((MetaRules)currElement).initWithContext(context, component);
                    hasOne = true;
View Full Code Here

    {
        AWComponent context = component;
        for (; context != null; context = context.parent()) {
            AWElement contentElement = context.componentReference().contentElement();
            if (contentElement instanceof AWTemplate) {
                AWTemplate template = (AWTemplate)contentElement;
                if (template.indexOfNamedSubtemplate(templateName, component) != -1) {
                    return context;
                }
            }
        }
        return null;
View Full Code Here

    private AWComponentReference[] extractTabsArray ()
    {
        AWComponentReference[] tabsArray = null;
        AWElement contentElement = componentReference().contentElement();
        if (contentElement instanceof AWTemplate) {
            AWTemplate contentTemplate = (AWTemplate)contentElement;
            tabsArray = (AWComponentReference[])contentTemplate.extractElementsOfClass(AWComponentReference.class);
        }
        else if (contentElement instanceof AWComponentReference) {
            tabsArray = new AWComponentReference[] {
                (AWComponentReference)contentElement,
            };
View Full Code Here

    {
        if (!_initialized) {
            AWElement contentElement = componentReference().contentElement();
            if (contentElement != null) {
                if (contentElement instanceof AWTemplate) {
                    AWTemplate elementsTemplate = (AWTemplate)contentElement;
                    AWCycleable[] elementArray = elementsTemplate.elementArray();
                    int elementCount = elementArray.length;
                    for (int index = 0; index < elementCount; index++) {
                        AWElement currentElement = (AWElement)elementArray[index];
                        if ((currentElement != null)) {
                            if (currentElement instanceof ToggleBoxElement) {
View Full Code Here

TOP

Related Classes of ariba.ui.aribaweb.core.AWTemplate

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.