Page tracking using Webtrends v10 - webtrends

How to track page views using WebTrend V10. I need to pass custom parameters using either WT, DCS or DCSext objects.I know Webtrends.multiTrack() method is used to track link click events. But any idea on how to do page view tracking.

The data that Webtrends collects is attached to the objects as properties. The properties are then iterated off the object to formulate the URL used to send the data.
You can add properties to the objects via meta tags.
<meta content="this/is/my/page" name="DCS.dcsuri" />
<meta content="The Title of this Page" name="WT.ti" />
You can do the same manually, but this is trickier, because the objects that need to be modified are not global. The default WT object is Webtrends.dcss.dcsobj_0.WT. If you are running the tag more than once, for captures to different accounts, then you would need to know which object dcsobj_x to update; e.g., dcsobj_0 or dcsobj_1 and so forth.
Obviously, meta tags are best in most cases.

Related

django-cms: link to plugin with hashtag

I have a "contact" link on a webpage, that needs a #idxx hashtag added, so the browsers directly shows contact infos (that is on a about page). As the link is quite static, I've added it with django-cms's {% page_url 'contact' %} tag, and then manually added the hash. BUT: As soon as I change something on the contacts page, and then publish the changes, the plugin's id will change. I already enhance the menu with selected plugins (Institute / About / Contact) Is there an elegant solution for this problem, for example accessing the menu again, only for that specific node?
Real world example: http://www.wti.org
EDIT: I if possible, an solution that is 'invisible' for the user/editor, is preferred. Means: No parent plugins to put things in, no manual ids that users have to set. If possible...
Would a simple solution be to assign the target a static id, e.g. #contactinfo? Many plugins allow to give them a static id. If your target plugin does not, you could have it preceded by an empty Style plugin. I use aldryn-style, available here: https://github.com/aldryn/aldryn-style

emberjs - reusing views/components that need to load data

I am very new to ember.
how do i create a component/view that has to load data, for ex if i need a search box on multiple page (with some extra properties passed in), which hits the database and gets results. every documentation i read says the model has to be passed in to the view. however i do not want to copy the code which loads search results from the backend on every page.
ideally what i want to do
{{view myseachbox... extrafilter="yyy"}}
is setting the controllerBinding to say MySearchController where the functionality of fetching data will be implemented the way to go?
any pointers are appreciated.

How to develop modular web UIs with Django?

When doing larger sites in "big business", you most probalbly work in a team with several developers.
Let's say dev A makes a form to insert new user data, B creates a user list, C makes some privilege administration and D does crazy statistic graphs work with image generation and so on.
Each dev begins to develop his own component, creates a view and a template and tests that independently, until each component works.
Now, the client wants to have all those components on one bit HTML page. How to achieve this?
How to assemble different views/templates in a form of composition so that they remain modular and can be developed and tested independently?
It seems inheritance is not the way to go because all of those UI components are equal and there is no hierarchy.
The idea of the assembling template is something like
<html>
<head>
// include the css for the components and their assembly
</head>
<body>
// include user data form here
<some containers, images, and so on>
// show user list
// show privilege administration in this part
// and finally, the nice statistic graphs
// perhaps, we want to display some other components here in future
</body>
</html>
I have not found an answer on the net yet.
Most people come up with one big template which just implements all of the UI functionality, removing all modularity. Each component shall have its own template and view dealing only with that component developed by one person each, and they then shall be sticked together just like bricks.
I would highly appreciate any hints!
Inclusion tags are the way to do this. Each application defines tags which render their own template fragments, then the master template can assemble them into a single page.

How can I put a block of dynamically generated content into a django template?

I want to include things like twitter status, or delicious tags, in my django templates.
These things are dynamic, yet regular. How would this be done?
There are a number of ways to handle this, so you can choose a method that best matches your own personal style or requirements:
Template context variable: as answered by Alex you can put your content into a context variable that is included in the context of every template created by every view. Django even provides a mechanism for doing this automatically, called a context processor. Pros: very straightforward. Cons: won't dynamically refresh new content on client browsers.
AJAX dynamic loading: as mentioned by Alex and Dave you can dynamically load your content using AJAX methods. As an example using jQuery, you would put a placeholder in your template something like <div id="twitterfeed"></div> and then in a javascript block in your template put $("#twitterfeed").load("{% url twitterfeed %}"); where twitterfeed is a url so named in your urls.py. Pros: will dynamically update browsers. Cons: can be tricky if you don't know Javascript.
Inclusion tag: Django provides a type of template tag called an inclusion tag, which is basically a custom template tag that can render dynamic content. In a way it's similar to a context variable, except your code to generate the content will only be called when you use the custom template tag in your template instead of being called for every view. Another benefit is the content is generated from a template of its own. You could do this with a normal context variable of course, but it's not as clean (IMHO) as using an inclusion tag. Pros: very straightforward, clean. Cons: won't dynamically refresh new content on client browsers.
The simplest approach is to use {{ mycontent }} in your template (where you want the dynamically generated content to appear) and put the correspondence between mycontent and its value in the context you use to render the template -- i.e., the most fundamental part of django's templating.
If what you mean is that you want Ajax support whereby Javascript on the page continuously refreshes such content according to what the server wants it to be at any given time, I suggest looking into dojango, the Dojo/Django integration project -- it's not yet as fully mature as each of Dojo and Django are on their own (not version 0.4 yet), but it is already usable and useful.
A common technique is to leave a placeholder div in the generated content, then fill the div in on the client side via an AJAX call from Javascript that you include in the page.
That gives you the benefit of having a cacheable (fast loading) primary page, with separate dynamic bits. Depending on how live you want the dynamic bits, you can can even cache them for shorter durations.

Are there any good tutorials for using sitemesh in a grails application?

I'm a pretty experienced Grails developer, but most of my experience has been with using grails for serving up JSON/XML to a flex app and some relatively simple HTML websites.
I've been diving deeper into using the sitemesh integration in grails and I'm struggling a little to find best practices for some more complex configurations, and I'm curious if there are any good tutorials or examples out there. The original Sitemesh website isn't that useful as the tags it talks about aren't directly exposed in grails.
A google search is mostly showing old mailing list posts and some vanilla sitemesh stuff which is helping me to move a little further along, but it's a lot of trial and error.
I fully understand how the basic g:layoutTitle, g:layoutHead, and g:layoutBody tags work. Those are easy and well documented.
The kinds of things that I'd like to see examples for:
g:applyLayout - the documentation on this is weak and I don't fully understand the uses suggested in the main docs. How is this different than setting the meta name='layout' content='foo' property?
g:pageProperty - some better examples on how to pull and use properties into the main template by setting the values as meta tags in the page that's being decorated. The grails docs on pageProperty show only the onload attribute from the body being brought forward. I think you can also use meta tag values here as well, anything else?
can you use multiple levels of sitemesh layouts? My testing seems to make me think that I can't, but that seems to reduce reusability. I think that the answer here is some usage of the g:applyLayout, but that's where I'm struggling the most.
the g:pageProperty is a very powerful, but very poorly documented thing. Lets say in my layout I specify where to put some content like this:
<html>
<body>
<g:pageProperty name="page.header" />
</body>
Now in my page I can specify some content:
<content tag="header">
<!-- header -->
</content>
Sitemesh will take the content tag, regardless of actual position in the HTML of the page and place it where it needs to go in the flow of the layout.
Even better, if within my page I render a template that also specifies a content area with a tag of "header", it will overwrite the first declaration, and it will be the template's content that will be rendered in the final layout.
Well, I can answer a bit:
Your first and third questions are related, as you can't chain layouts using the meta tag.
Your final page should have a meta tag as you suggest, but if you want to layer a layout on top of another layout, you put a g:applyLayout tag at the top of the child layout, pointing at the parent.
In your edit.gsp, you'd have:
<meta name="layout" content="editTemplate" />
and in editTemplate.gsp, you'd have:
<g:applyLayout name="baseTemplate" >
<!-- the html for the editTemplate -->
</g:applyLayout>
so edit.gsp would use editTemplate.gsp, which would use baseTemplate.gsp as a base layout. You can chain those as needed.
I haven't used g:pageProperty at all, so I can't throw you better examples there, sorry.
The Sitemesh together with Grails is a very very powerful feature. The more I use it - the more I love it. You can decorate any part of our web site: you can have layout for error messages, tooltips, news lines, comments, etc, etc. Just to note that you can do even that with in your pages and have multiple levels of decoration (no <content> needed):
/view/layout/inline-error-message.gsp
<span class="errorMessageInSomeFancyBox">
<span class="errorIcon"></span>
<g:layoutBody />
<span>
/views/book/create.gsp
<%-- let's decorate our error message with some fancy box --%>
<g:applyLayout name="inline-error-message">${some.error.message}</g:applyLayout>
See our Rabbtor Showcase App for a few very good examples on
creating nested layouts
rendering templates
applying layouts to specific parts of a page
. This app is actually a showcase for our tool Rabbtor which enables using GSP outside Grails but parts related with Sitmesh are also valid for Grails.