Package com.day.cq.wcm.api.components

Examples of com.day.cq.wcm.api.components.Component


     * {@inheritDoc}
     */
    @Override
    public int doEndTag() throws JspException {
        SlingHttpServletRequest request = TagUtil.getRequest(pageContext);
        Component component = WCMUtils.getComponent(request.getResource());
        if (componentHelper.isEditMode(request)) {
            JspWriter writer = pageContext.getOut();
            String placeholder;

            String bodyContentString = bodyContent != null ? bodyContent.getString() : null;
View Full Code Here


        Font[] fonts = new Font[]{
                new Font("Myriad Pro", 15 * scale, Font.BOLD),
                new Font("MyriadPro-Light", 18 * scale)};

        // load background image from docroot
        Component c = WCMUtils.getComponent(ctx.resource);
        Layer bg = ImageHelper.createLayer(c.getLocalResource("background.png"));

        // load additional image
        Image image = new Image(ctx.resource);
        image.setItemName(Image.NN_FILE, "image");
        image.setItemName(Image.PN_REFERENCE, "imageReference");
View Full Code Here

        Paint subtitleColor = new Color(0xffa9afb1, true);
        Font subTitleFont = new Font("Tahoma", 7);
        int subTitleBase = 20;

        // load background image from docroot
        Component c = WCMUtils.getComponent(ctx.resource);
        Layer bg = ImageHelper.createLayer(c.getLocalResource("navimage_bg.jpg"));

        // draw the title text (4 times bigger)
        Rectangle2D titleExtent = titleFont.getTextExtent(0, 0, 0, 0, title, Font.ALIGN_LEFT, 0, 0);
        Rectangle2D subtitleExtent = subTitleFont.getTextExtent(0, 0, 0, 0, subtitle, Font.ALIGN_LEFT, 0, 0);
        // check if subtitleExtent is too width
View Full Code Here

    ComponentConfiguration componentConfiguration = new ComponentConfiguration(logger);

    if ((resourceType != null) && (path != null)) {
      ComponentManager componentManager = request.getResourceResolver().adaptTo(ComponentManager.class);
      if (componentManager != null) {
        Component component = componentManager.getComponent(resourceType);
        if (component != null) {
          componentConfiguration.readFromComponent(component);
        } else {
          logger.warn("Cannot read component configuration for '{}' at {}", resourceType, path);
        }
View Full Code Here

    ComponentConfiguration componentConfiguration = new ComponentConfiguration(logger);

    if ((resourceType != null) && (path != null)) {
      ComponentManager componentManager = request.getResourceResolver().adaptTo(ComponentManager.class);
      if (componentManager != null) {
        Component component = componentManager.getComponent(resourceType);
        if (component != null) {
          componentConfiguration.readFromComponent(component);
        } else {
          logger.warn("Cannot read component configuration for '{}' at {}", resourceType, path);
        }
View Full Code Here

TOP

Related Classes of com.day.cq.wcm.api.components.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.