Recently on the forums it was asked how to publish static files to the Weblayout folder using a custom component in 11g. We covered this earlier for 10g. Publishing files is slightly different for 11g. Follow the steps below to publish static files in 11g.
1. In the custom component directory, create a folder “publish”. Files that are placed within this folder will become relative to the weblayout folder.
2. In Component Wizard -> Build -> Build Settings, add a “Component Extra” entry type and link to the above path (customComponentName/publish/).
3. In Component Wizard, under the Resource Definition tab, click the “Add” button to add a new resource.
4. Check the box for “Resource – Static Table (HTML Format)”. Set the “File name” to something such as “resources/customComponent_published_static_files.htm” so that you can easily identify what this resource definition is by looking at the file name. Set the “Load Order” to “1000″. Click “Next”.
5. Set the “Table Name” to something such as “CustomComponent_PublishedStaticFiles”. Make sure the “Merge To” box is checked and set it to “PublishedStaticFiles”. Click “Finish”.
6. Edit the file that was just created with your favorite text editor. You want the second <tr> to contain something like the following:
That is it! Build your component and try it out.
Note: If you have problems with the files publishing (for example they should publish on start-up) you can manually invoke this action by invoking Administration -> Admin Actions – > Weblayout Publishing -> Publish static, string and dynamic files. This will likely take a few minutes to complete.