HI I'm very new to AEM and working on a project doing the frontend styling. I managed to create a SASS folder with my scss file in it - updated the pom file to compile it to css in the css folder. but what i do not know is how do i link my newly created css file to the project?
Create a clientlib and include your css files in that.
This newly created clientlib should be included in the base page html/jsp or at the component level.
To create a clientlibs for your project, follow below URL.
https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html
To include this clientlib in your component/base page, use below code snippet.
<sly data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}">
<!--for css+js -->
<sly data-sly-call="${clientLib.all # categories='your.clientlib'}</sly>
<!-- only js -->
<sly data-sly-call="${clientLib.js # categories='your.clientlib'}" ></sly>
<!-- only css -->
<sly data-sly-call="${clientLib.css # categories='your.clientlib'}" ></sly>
Related
I am not really familliar with this topic but I want to create a plugin described at this page:
HowTo extend CDT with custom file templates.
So far as described in the Link I got it working. But in the example the template format is directly described in the <template>...</template>-Node:
// ${file_name}
// Test Source
But what I want to do is not to write my file template format into the XML-File of the plugin. Instead I want to have a file that is used with the file temlate, in my example H_Template.h. But I don't know how to include that file. Does anyone know?
I tried to use the attribute <include file="H_Template.h"/> with an relative path to the file from my plugin location. Or is it the relative path to my eclipse folder?
template.xml:
<templates>
<template name="Source template"
id="test.codetemplates.csourcefile"
description=" "
context="org.eclipse.cdt.core.cSource.contenttype_context"
enabled="true">
// ${file_name}
// Test Source
</template>
<template name="Header template"
id="test.codetemplates.headerfile"
description=" "
context="org.eclipse.cdt.core.cHeader.contenttype_context"
enabled="true">
<include file="H_Template.h"/> <!-- <<<<<<<< ??? -->
</template>
</templates>
H_Template.h:
// ${file_name}
// Test Header
There is no support for this. The template code must be included as part of the template.xml file.
The Eclipse code which reads the template is org.eclipse.jface.text.templates.persistence.TemplateReaderWriter.
I have a gwt project with the following directories:
-com.project
-com.project.client
-com.project.shared
-com.project.server
The gwt.xml config file is located in the com.project directory. What value should be in the
<source> tag for path?
Do you mean the tag for source with attribute path in the gwt.xml file? If that's the case, you use those paths for the translatable code (i.e., the code you want compiled from Java to JavaScript). Typically it's just the client and shared code that you want the GWT compiler to handle so you would set the following:
<source path='client' />
<source path='shared' />
If you were referring to another tag, please forgive me. :)
Trying to make Grails + smartgwt work together.
Setup:
Grails 2.2.1 (installed both, gwt + smartgwt plugin)
SmartGWT 3.1
GWT 2.5
After a couple of hours playing around with it, tomcat finally started.
(created application and compiled the modules)
Project resides under:
zuhause:8080/gwt3/
Default module is foo.bar
Default index.gsp looks ok
<script>
var isomorphicDir = "${createLinkTo(dir: 'gwt/foo.bar.fooBar/sc/')}";
</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="${createLinkTo(dir: 'gwt/foo.bar.foobar', file: 'foo.bar.foobar.nocache.js')}"></script>
The nocache.js is found
Inside the compiled "nocache.js" there is a reference to
zuhause:8080/gwt3/static/gwt/foo.bar.foobar/sc/modules/ISC_Core.js 404 (Not Found)
The path reference to "static" is the one I have no idea where it is configured.
The module xml looks like:
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<!-- Smart GWT -->
<inherits name="com.smartgwt.SmartGwt"/>
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
<!-- Specify the module entry point class. -->
<entry-point class="foo.bar.client.foobar"/>
I have scanned my complete project, but "static" has never been defined in one of the config files.
Any idea ?
Thanks in advance
The static is added by the resources plugin.
I'm having trouble using the GWT-Grails plugin. I tried to follow this example exactly, but I end up having this error:
| Error 2012-10-28 00:25:49,567 [http-bio-8080-exec-2] ERROR resource.ResourceMeta - Resource not found: /gwt/g3wt.Application/g3wt.Application.nocache.js
I get this error after I enter these commands: ( I am simply following this guide here )
>grails create-app g3wt
>cd g3wt
>grails install-plugin gwt
>grails create-gwt-module g3wt.Application
>grails create-gwt-page main/index.gsp g3wt.Application
>grails run-app
>grails run-gwt-client
this is the index.gsp code (which is autogenerated anyway):
<html>
<head>
<!-- Integrate with Sitemesh layouts -->
<meta name="layout" content="main" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Example title (change this!)</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="${resource(dir: 'gwt/g3wt.Application', file: 'g3wt.Application.nocache.js')}"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic ui -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
<!-- Add the rest of the page here, or leave it -->
<!-- blank for a completely dynamic interface. -->
</body>
</html>
I understand that the nocache.js cannot be found, so I thought I could try to see where exactly it is. However, using the eclipse search function, it shows that the file is not created at all. Although there is a file named application.js.
Why is the nocache.js not created, and how do I fix this? I've been stumped for a while now, and it's frustrating.
I'm using gwt plugin 0.7.1 and grails 2.1.1, with eclipse 4.2 and a Linux machine.
I was having the same problem and found the answer here.
buildconfig.groovy is in the conf folder. Just comment out the plugin where the runtime is ":resouces..."
Okay, so I got the error to disappear by first running
grails> compile-gwt-modules
Now a different problem occurs. The front-end gwt codes I made, aren't displayed.
You can add in you Confing.groovy:
grails.resources.adhoc.excludes = ['**/gwt/**']
This will solve the problem. But if you use plugin version 0.8 this issue should be resolved.
I just created a new IceFaces application and I'm trying to include a navigation bar in all of the pages. When I use the jsp:directive.include tag the file is included, but when I use jsp:include it does not seem to be loaded. In fact, when I check the HTML source code in my browser, it's like the included file was completely empty. I do not want to use jsp:directive.include because it will not automatically show any updates to the included file.
My environment: Eclipse 3.5, Tomcat 6, JSF 1.2, IceFaces 1.8.
Steps to reproduce the problem and pieces of code:
create a new Dynamic Web Project with the following options:
Target runtime: Apache tomcat v6.0
Dynamic web module version: 2.5
Configuration: ICEfaces project
create a new ICEFaces JSPX file -- the home file. Some code:
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" />
<f:view >
<ice:outputDeclaration doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
<html>
<head>
<title>test file</title>
<link rel="stylesheet" type="text/css"
href="./xmlhttp/css/rime/rime.css" />
</head>
<body>
<jsp:directive.include file="./vertical_navigation.jsp" /> <!-- working -->
<jsp:include page="./vertical_navigation.jsp" /> <!-- not working, no error though -->
</body>
</html>
</f:view>
create the file to be included, also as a new ICEFaces JSPX file. Simplified code:
<ice:form>
<ice:panelGrid columns="1" width="152">
<ice:graphicImage url="./img/image.jpg"></ice:graphicImage>
<ice:panelCollapsible expanded="true">
<f:facet name="header">
<ice:panelGroup>
<ice:outputText value="Customer"/>
</ice:panelGroup>
</f:facet>
<ice:panelGrid columns="1">
<ice:commandLink action="customer"><ice:outputText value="Customer name" /></ice:commandLink>
</ice:panelGrid>
</ice:panelCollapsible>
</ice:panelGrid>
</ice:form>
</body>
</html>
</f:view>
Some remarks:
I'm completely new to JSF, so forgive me for any obvious mistake.
In the home file (the first one) I'm not using both tags at the same time. I pasted both here just to show that I am trying both options.
I created both files as "ICEFaces JSPX file", but the second one was assigned the .jsp extension.
When I use the directive.include tag, the included file is loaded. But if I change it, it's not automatically republished.
To start, you have to separate and distinguish several technologies:
JSP is a Java based view technology which allows you to write HTML/CSS/JS in and use taglibs to call backend Java code and/or control the output flow.
JSPX is the same as JSP, but forces you to write code in XML format. JSP-specific tags are replaced by tags in XML format. JSPX is also called "JSP Document". Here is a basic tutorial which outlines the differences in tags.
JSF is a component based MVC framework which provides components in flavor of taglibs which outputs HTML/CSS/JS.
You cannot use <jsp:include> in a JSPX page. You have to transform the JSPX page into a JSP page. You need to rename the file .jspx to .jsp and replace JSPX specific tags by JSP tags. Here's a kickoff example for JSP with JSF/IceFaces:
<%# page pageEncoding="ISO-8859-1" %>
<%# taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%# taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%# taglib uri="http://www.icesoft.com/icefaces/component" prefix="ice"%>
<!DOCTYPE html>
<f:view>
<html lang="en">
<head>
<title>Title</title>
</head>
<body>
<jsp:include page="include.jsp" />
</body>
</html>
</f:view>