cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply css style from 'web' folder in html of a webscript

mbel
Star Contributor
Star Contributor

Hello,

I have generated maven alfresco amp project and I have folder web with css,scrips and so on.

In order to import some css file in webscript html, what exactly the path to this directory should be?

I tried with some variants but ...nothing is found.

And is this content public how can I reach it in the browser?

Thank you in advance.

1 ACCEPTED ANSWER

ycoulon
Employee
Employee

Hi,

Just create an AIO maven project.

The alfresco amp is created with a demoamp.css file.

I manage to access it using that URL : http://localhost:8080/alfresco/css/demoamp.css

View answer in original post

20 REPLIES 20

This is just a part of the output from alfresco-mmt.

I didn't uninstall the older version just (re-)apply the AMP over the war.

Yann

mbel
Star Contributor
Star Contributor

Ok, I don't understand why it doesn't recognize the file-mapping.properties file.

Even I generated a completely new alfresco- amp project and again when installing it, it doesn't add any of /web/ folder content.

Do I have to register it somewhere or ? 

ycoulon
Employee
Employee

That's strange.

Wich version of the SDK, Alfresco are you using ?

Wich alfresco-mmt.jar are you using ? The one provided with your Alfresco installation ?

For my tests I use the latest alfresco-mmt.jar available from Index of /repositories/public/org/alfresco/alfresco-mmt/5.2.b-EA and 2.2.0 SDK.

Yann

mbel
Star Contributor
Star Contributor

The one provided with Alfresco installation.

I now downloaded the 5.2.b-EA and tried to installed the amp with this version of mmt and again don't see any new files added concerning the /web/ folder.

Can't understand what I am missing.

ycoulon
Employee
Employee

Open your AMP file (it's just a zip) can you find your file-mapping.properties in ?

mbel
Star Contributor
Star Contributor

It is there.

INFO: Checking the war version using /WEB-INF/classes/alfresco/version.properties
Adding files relating to version '1.0-SNAPSHOT' of module 'test-css'
- File '/WEB-INF/lib/test-css-1.0-SNAPSHOT.jar' added to war from amp
- File '/WEB-INF/classes/alfresco/extension/templates/webscripts/helloworld.get.html.ftl' added to war from amp
- File '/WEB-INF/classes/alfresco/extension/templates/webscripts/helloworld.get.desc.xml' added to war from amp
- File '/WEB-INF/classes/alfresco/extension/templates/webscripts/helloworld.get.js' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/context/bootstrap-context.xml' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/context/service-context.xml' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/context/webscript-context.xml' added to war from amp
- Directory '/WEB-INF/classes/alfresco/module/test-css/context' added to war
- File '/WEB-INF/classes/alfresco/module/test-css/model/content-model.xml' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/model/workflow-model.xml' added to war from amp
- Directory '/WEB-INF/classes/alfresco/module/test-css/model' added to war
- File '/WEB-INF/classes/alfresco/module/test-css/module-context.xml' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/alfresco-global.properties' added to war from amp
- File '/WEB-INF/classes/alfresco/module/test-css/log4j.properties' added to war from amp

C:\alfresco-community\bin>

Ok this is the output of alfresco-mmt, no information about your web content.

Can you unzip the AMP file and list the file in it ?

Did  you rebuild your AMP ? Could you try with mvn clean install (or mvn clean package) ?

Yann

mbel
Star Contributor
Star Contributor

Yes, the above is the output of alfresco-mmt and as you can see the web content doesn't appear there, although I see that the file-mapping.properties file is in the amp.

Yes, of course I rebuilt it with mvn clean install -Pamp-to-war.

Here it is the list of the files in the amp.

C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension\templates
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension\templates\webscripts
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension\templates\webscripts\helloworld.get.desc.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension\templates\webscripts\helloworld.get.html.ftl
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\extension\templates\webscripts\helloworld.get.js
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\alfresco-global.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\context
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\context\bootstrap-context.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\context\service-context.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\context\webscript-context.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\log4j.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\model
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\model\content-model.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\model\workflow-model.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\config\alfresco\module\test-css\module-context.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\file-mapping.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\lib
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\lib\test-css-1.0-SNAPSHOT.jar
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\MANIFEST.MF
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\maven
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\maven\testing-css
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\maven\testing-css\test-css
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\maven\testing-css\test-css\pom.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\META-INF\maven\testing-css\test-css\pom.xml
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\test-css-1.0-SNAPSHOT\module.properties

ycoulon
Employee
Employee

Hi,

Thanks for your answer.

According that file list, there is no web folder in your AMP.

Can you list your project file ? (from the root directory).

Maybe the folder in not in the right place.

It should be in src/main/amp

Yann

mbel
Star Contributor
Star Contributor

Hm, It was automatically generated from MAVEN. I aslo havent moved it.

I listed the whole project files but the list is long, so I won't spam with the whole list.

The web folder is there:

....

C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\file-mapping.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\lib
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\lib\test-css-1.0-SNAPSHOT.jar
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\module.properties
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\css
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\css\demoamp.css
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\jsp
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\jsp\demoamp.jsp
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\licenses
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\licenses\README-licenses.txt
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\scripts
C:\Users\maria\Documents\workspace-sts-3.8.1.RELEASE\test-css\target\amp\web\scripts\demoamp.js

......