I want to build a multi page website and I need a way to refer to another GWT page (panel) how can I do it such that the links are static?
There are three issues in your questions:
how to specify the url of a gwt page.
how to ensure that url is static.
how to create a link to that gwt page from another gwt page.
A GWT url is effected by the module name and package namespace and can be modified by the rename-to attribute. Say, the GWT module description file is named whatever.gwt.xml; and whatever module is placed at package namespace zoom.wonderful.world . The url of the module would be http ://hostnamespace:port/zoom.wonderful.world.whatever. But you can use the rename-to attribute to change it , the url would be http ://hostnamespace:port/holycow.
But ... your module is not accessible by url unless you have an entrypoint - i.e. a gwt java file that implements EntryPoint.
You can have more than one entry point in a module, but under most circumstances my opinion says that you should not unless you wish to begin a career into the most confusgated GWT code contest. The ui representations of all the entry points in a module would overlap. A similar confusgating overlap effect is available if you inherit an entry point.
Behind my mind, I keep asking why you deliberately ask "static url", because the url of the entry point of a module is indeed static.
Then in your other "gwt page", you merely include list the "static urls" of all the "gwt pages" either
- in the hosting html file (which launches the module javascript-compiled files)
- or, within a gwt widget that allows url links or html code to be included.
http://h2g2java.blessedgeek.com/2011/02/uibinder-check-list.html
Related
I want to rewrite a Variable set in a Block Form with a Field that is set in individual nodes of a certain Content Type. In Drupal7 I was able to hack the module PHP and everything worked well but in Drupal8 not so well. The block never refreshes by rewriting a new field.
I feel I must be missing some built-in solution with Views and a preprocess hook without hacking at the module.
The module I am working to integrate is the YouTube Video Transcript module (https://www.drupal.org/project/transcript). The Transcript module follows exactly the setup described in the Drupal article "Creating custom blocks" (https://www.drupal.org/docs/8/creating-custom-modules/creating-custom-blocks).
OLD DRUPAL7 HACK
at \transcript\Plugin\Block\TranscriptBlock.php
function transcript_show() {
...
$node = menu_get_object();
$video_id = $node->field_myfield_id['und'][0]['value'];
Im building a very custom CMS on top of Symfony CMF Components/Bundles. I read almost everything i could about the CMF Components/Bundles and i have the "architecture" kinda defined. Im experienced/familiarized with Symfony2 components.
The CMS should provide a way to manage multiple sites.
A Site contains Pages.
A Page, requires a title and may have content. A page can also have blocks associated(Those already provided by the Block Bundle, and others with custom functionality developed by me for the CMS).
For now i defined two Documents(Site and Page).
Based on the application requirements im using the CoreBundle, BlockBundle, RoutingBundle, DoctrinePHPCRBundle, and DoctrinePHPCRAdminBundle.
Based on this requirements the expected Repository Tree should be something like:
/sites
/site1 ( nodename of the Site Document )
/pages ( all pages of this site )
/page1 ( nodename of a Page Document )
/page2
/routes ( all routes of this site )
/site2
/pages
...
The configurations for CoreBundle:
cmf_core:
persistence:
phpcr:
basepath: /sites
enabled: true
Because i need nodes(/pages, /routes) for each site, how can i initialize them? My first idea was onPostPersist event of a Site document i initialize the required nodes.
use PHPCR\Util\NodeHelper;
...
public function initSiteNodes(ManagerRegistry $registry, Site $site)
{
$session = $registry->getConnection();
NodeHelper::createPath($session, $site->getId()./pages);
NodeHelper::createPath($session, $site->getId()./routes);
$session->save();
}
So my questions are:
Is this architecture feasible and is SonataAdminBundle prepared for such a structure?
Great to hear you are building a custom CMS on top of the CMF. This is one of the main intended use cases for it.
For your usecase, one important thing to note is that the route base paths can be an array of paths. If you know the sites that will exist, you can simply configure base paths for all of them.
If they can be dynamically created, you will need some more work. You could check if the expression language can help you, or write a symfony request listener that comes very early and sets the right base path on the cmf_routing.phpcr_candidates_prefix service.
The sonata phpcr-odm admin was not really optimized for multisite use cases. However, with the help of the permission system, you should be able to control who may see what.
You could also write to the symfony-cmf-users mailing list. A couple of people did multisite projects with the CMF and might have additional ideas or inputs. And feel free to open pull requests or issues on the corresponding CMF repositories if you see things that could be improved.
Given the following example manifest:
CACHE MANIFEST
# v1 2011-08-14
# This is another comment
index.html
cache.html
http://somedomain.com/abc/xyz/
/style/css
controller/view/1
# Use from network if available
NETWORK:
/api
# Fallback content
FALLBACK:
/ fallback.html
Will "/style/css" and "/controller/view/1" work, or does it require actual file names? I keep reading about putting "files" there, but on other sites I read "URI". I'm assuming URI is correct. So, are full AND relative URIs allowed? Any cross-browser/device issues to be aware of?
BTW 1: Yes, I'm aware that "file names" are just part of a URI, and names don't dictate content (image.png could download a text file, for example, if one wanted to). I only want to confirm that URIs work well in the CACHE MANIFEST section, thanks.
BTW 2: I'm aware that Mozilla states URI for the cache manifest, so as mentioned, I just want to confirm.
https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache
You can use a dynamic manifest file which is actually designed to work with MVC. I've not had chance to use it myself but it looks really good!
http://deanhume.com/home/blogpost/mvc-and-the-html5-application-cache/59
i am using jdk1.7.0_45 for building javafx project,loads pre created html site from my application,found passing this url file:///E:/web/index.html
but which is not my requirement,need to load from my app,so please tell me anyone,the folder name need to place in javafx app.
thanks
I'm assuming that the question is that you want to package a static HTML file with your application and display it in a WebView.
You can do it with code like this (Scala syntax but the meaning should be clear):
val url = getClass getResource "index.html"
webView.getEngine load url.toString
In this example, the index.html file (and any related content) must reside in the same package as the class of the code. E.g. if the class is mypackage.myapp.MyApp, the file must be in the mypackage.myapp package.
If your build system provides an e.g. resources folder, it would be good practice to use that for static content such as this. I.e., for this example, create a package mypackage.myapp in the resources folder and place the html file there.
`I've installed the DateTime Field module to Orchard and assigned two fields to my custom part, but when navigating to the Admin Edit page for the custom type implimenting the custom part, I recieve an error like this:
A 'stylesheet' named 'jQueryUtils_TimePicker' could not be found.
When looking in the Contrib.DateTime.cshtml View, I find that the following two resources are required, but I can't find them in the jQuery module's resource manifest.
Style: jQueryUtils_TimePicker
Script: jQueryUtils_TimePicker
Where are these meant to be defined and stored?
Thanks in advance.
P.S.
If I change both to jQueryUI_TimePicker (for which there is a script and style defined in the jquery module resource manifest), then it doesn't throws an error, but the time picker doesn't work.
Contrib.DateTimeField is obsolete since 1.4 so you shouldn't use it.
The DateTimeField has been integrated in Orchard.Fields has a core feature.