Package org.apache.tapestry5.runtime

Examples of org.apache.tapestry5.runtime.Component


            logger.debug("Processing actions: {}", clientEncodedActions);

            ObjectInputStream ois = null;

            Component component = null;

            try
            {
                ois = clientDataEncoder.decodeClientData(clientEncodedActions);

                while (!eventCallback.isAborted())
                {
                    String componentId = ois.readUTF();
                    boolean cancelAction = ois.readBoolean();
                    ComponentAction action = (ComponentAction) ois.readObject();

                    // Actions are a mix of ordinary actions and cancel actions.  Filter out one set or the other
                    // based on whether the form was submitted or cancelled.
                    if (forFormCancel != cancelAction)
                    {
                        continue;
                    }

                    component = source.getComponent(componentId);

                    logger.debug("Processing: {} {}", componentId, action);

                    action.execute(component);

                    component = null;
                }
            } catch (EOFException ex)
            {
                // Expected
            } catch (Exception ex)
            {
                Location location = component == null ? null : component.getComponentResources().getLocation();

                throw new TapestryException(ex.getMessage(), location, ex);
            } finally
            {
                InternalUtils.close(ois);
View Full Code Here


            // See https://issues.apache.org/jira/browse/TAP5-1632
            javascriptSupport.allocateClientId(name);

        }

        Component activePage = componentSource.getActivePage();

        // This is unlikely but may be possible if people override some of the standard
        // exception reporting logic.

        if (activePage == null)
            return;

        ComponentResources activePageResources = activePage.getComponentResources();

        try
        {

            activePageResources.triggerEvent(EventConstants.PREALLOCATE_FORM_CONTROL_NAMES, new Object[]
View Full Code Here

    {
        FileUploadException uploadException = decoder.getUploadException();

        if (uploadException != null)
        {
            Component page = componentSource.getPage(parameters.getActivePageName());

            ComponentResultProcessorWrapper callback = new ComponentResultProcessorWrapper(resultProcessor);

            page.getComponentResources().triggerEvent(UploadEvents.UPLOAD_EXCEPTION, new Object[] { uploadException },
                                                      callback);

            // If an event handler exists and returns a value, then the callback will be aborted and a response
            // (typically a redirect) will already have been sent to the client.
View Full Code Here

        notBlank(parameterName, "parameterName");
        notNull(resources, "resources");

        String componentId = resources.getId();

        Component container = resources.getContainer();

        // Only provide a default binding if the container actually contains the property.
        // This sets up an error condition for when the parameter is not bound, and
        // the binding can't be deduced.
View Full Code Here

        {
            logger.debug("Processing actions: {}", actionsBase64);

            ObjectInputStream ois = null;

            Component component = null;

            try
            {
                ois = new Base64ObjectInputStream(actionsBase64);

                while (true)
                {
                    String componentId = ois.readUTF();
                    ComponentAction action = (ComponentAction) ois.readObject();

                    component = source.getComponent(componentId);

                    logger.debug("Processing: {} {}", componentId, action);

                    action.execute(component);

                    component = null;
                }
            }
            catch (EOFException ex)
            {
                // Expected
            }
            catch (Exception ex)
            {
                Location location = component == null ? null : component.getComponentResources().getLocation();

                throw new TapestryException(ex.getMessage(), location, ex);
            }
            finally
            {
View Full Code Here

    @Test
    public void block_not_found()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);
View Full Code Here

    @Test
    public void block_found()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Block block = mockBlock();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);
View Full Code Here

    @Test
    public void parameter_is_bound()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Binding binding = mockBinding();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);
View Full Code Here

    @Test
    public void duplicate_block_id()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Block block1 = mockBlock();
        Block block2 = mockBlock();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
View Full Code Here

    @Test
    public void verify_required_parameters_all_are_bound()
    {
        Page page = newPage(PAGE_NAME);
        Component component = mockComponent();
        ComponentModel model = mockComponentModel();
        Binding binding = mockBinding();
        ParameterModel pmodel = mockParameterModel();
        Logger logger = mockLogger();
        Logger eventLogger = mockLogger();
        PageResources pr = mockPageResources(logger, eventLogger);

        train_getLogger(model, logger);
        train_isDebugEnabled(eventLogger, false);

        Instantiator ins = mockInstantiator(component, model);

        train_getParameterNames(model, "barney");
        train_getParameterModel(model, "barney", pmodel);

        component.containingPageDidLoad();

        replay();

        ComponentPageElementImpl cpe = new ComponentPageElementImpl(page, ins, pr);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.runtime.Component

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.