[Logo] Infoglue - Official Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: GrahamButcher
Forum Index » Profile for GrahamButcher » Messages posted by GrahamButcher
Author Message
Thought I'd share this as I found it useful, in case anybody else might find it useful. As I'm a noob to java etc, I don't know how robust it is and I'm sure its very messy and could be made more efficient, but it seems to be working for me. Have tried it on versions 2.9.9.2 and the developer bundle (2.9.6 I think)

Background:
The infoglue tag, structure:childPages, didn't give me all I wanted. So I created my own version.

This childPages tag does the same as the structure:childPagess Tag but with extra properties in the returned list of pages and some different attributes. It will also recurse down a sitenode tree for as many levels as you specify as opposed to the 1 of structure:childContents.



Properties

The properties that each node has in the returned list are the same as those for the SiteNodeVO class plus these extra ones:

  • depth - The sub level depth of this node in relation to the start node
    levelWidth - The maximum depth of all nodes in this collection - depth of this node + 1. So if the start node has just one sub node under it, then the start node will have a depth of 0 and a levelWidth of 2. The sub node will have a depth of 1 and a levelWidth of 1
    navigationTitle - The value of the site nodes navigation title attribute
    url - The URL of the site node.
    firstChild - True if this is the first child of each level.
    lastChild - True if this is the last child of each level.
    childNumber - The number of the child. Zero is the first child in each level.
    anyChildren - True if there are any sub nodes to this node.
    depthDifference - The difference in depth between this node and the next one. If this node is depth 3 and the next is depth 4 then the difference will be -1


  • Some important differences between structure:childPages and this tag:

    * This tag does not support the following attributes:
    o propertyName (too complicated to figure out how to do it - could be added later)
    o useInheritance
    o useRepositoryInheritance
    o useStructureInheritance
    * This tag returns the start node as well as the child nodes.
    * This tag will do any number of sub levels.
    * This tag sorts the returned site nodes.
    * This tag returns all the properties of a SiteNodeVO object.
    * This tag does not return contentId and languageId properties in its returned site nodes.

    Notes:

    The start node in the returned list has an empty string for the navigation title and the url. This needs to be added, but haven't figured out how to do it yet.

    Example




    And finally, the source code:

    The bit for the tld file:



    The class that encapsulates SiteNodeVO and adds some more properties:



    And the actual tag code:
    Any chance of a sample piece of code for a component that produces a simple chart (of any kind) using the org.infoglue.deliver.util.charts package?

    Or is this package for internal use only?
    Works like a charm. The deliveryContext tag needs an id to work though:

    I'm having problems with a result set populated from an external (to infoglue) database. The code below works and shows me a list of descriptions from the table. However, when I insert a new row into the table and run this component again, I get the same results as before, as if the result set has been cached. Even if I try a completely different browser (just to eliminate any possibility of browser doing the caching), I get the same old result set. If I change the url in the address bar in some inconsequential way, I then see my newly added row included in the list, but inserting another row then makes this new url no good and so on.

    If I change the component in some inconsequential way (forcing it to be recompiled when requested by the browser), I see the new row, but then any new rows are not picked up juST AS BEFORE.

    I have tried the various response header expires stuff and meta tags, but no effect. I don't know if the caching is being done by infoglue, tomcat, oracle, or what.

    I'm using the developer bundle (version 2.9.5) on a windows machine. The developer bundle uses tomcat 5.5. I have also tried creating the same thing as a custom tag, but it suffers from the same problem. Maybe its the datasource setup, I don't know.

    Any help would be much appreciated.

    I have managed to reduce the problem componet to this:
    I've moved on quite a ways since this noob guide, and I seem to remember that I had to find the password in one of the tomcat configuration files (or was that something else).

    Looking at my development bundle setup, I see there are two users called admin and administrator which I didn't create (I think). So worth trying admin/admin maybe.

    Right just looked in the build.properties file and there are two lines in there:
    database.user=root
    database.password=ijikal

    so that's what I remember, but thats for the mysql database access in the developer bundle.

    Looking around some more, I find in the cms.properties file, the line:
    administratorPassword=@administratorPassword@

    and in another cms.properties file, I find the line:
    administratorPassword=ijikal

    so I reckon administrator/ijikal and admin/ijikal are worth a try also.

    Hi arcotc

    Did you ever create a custom tag? I need a solution for this also. Can't use omnifind as omnifind (open source edition) does not support CAS single sign on which we are using.
    OK - got it working.

    Had to create a component with a slot in it and then add custom parameter component into the slot. I'm such a noob

    Also, component with slot only worked if it had html and body tag - its so picky

    Thanks anyway
    No idea. I have had to learn Java and JSP and EL and Tomcat and I could go on. Suffice it to say, this is taking me ages to learn. I think knowing java puts you miles ahead of me.
    Has anybody had any luck with customfield property type in parameters. I have a test component like so:


    and the markup for the customfield is:


    I have a site node that uses this just component as its base component.

    It doesn't ask for the property to be entered and so has an empty value for background-color.

    How do I enter a value for the property? (I'm using version 2.9.5 if that helps at all).
    Yea, I guess my posted current state was not a good example. I have tried so many things in desparation that I had those settings when I posted.

    I have moved on a little bit more. I have copied JNDIBasicAuthorizationModule and used the copy. I have added a whole stack of trace messages in it to see what is going on. The strangest thing happened only about an hour ago. All of a sudden it works, but only the first time (after a re-build), if I log out then in again then I get:

    org.infoglue.cms.exception.Bug: Uncaught exception!
    at org.infoglue.cms.applications.common.actions.WebworkAbstractAction.execute(WebworkAbstractAction.java:144)
    at webwork.dispatcher.GenericDispatcher.executeAction(Generi.....

    I have only added trace messages, but this one time success happened for the first time after adding trace messages and rebuilding either CASBasicAuthenticationModule or WebworkAbstractAction. I don't know if its a coincidence or what.

    So its progress of a sort, but its now wierder!
    Had one of our sys admin guys looking into this for me and he says that infoglue only authenticates against cn and not against sAMAccountName and he has suggested creating an ldif file from AD, and importing it into the infoglue database directly. Not a tidy solution (and will need periodic refreshing), but if infoglue can't do it then I'm stuck between a rock and a hard place.

    Any chance of telling where in the source code the cn check bit is? Then I can go and alter it to look at sAMAccountName instead.
    Can somebody help me please.

    I'm trying to set up infoglue so that it uses CAS single sign on and uses Active directory. I also want to be able to create some infoglue users that are not in AD for admin purposes.

    I have copied the sample from the 2.9.6 admin guide but do not know what to change to fit my situation.

    In our AD (using JXplorer) we have all the users in World - net - wmfs - WMFS - User Accounts
    Some of the user entries have sub entries of users.

    User Accounts is an OU as is WMFS
    wmfs and net are DC

    A typical user has the following attributes that I think might be relevant:
    cn (eg. Graham Butcher)
    displayName (eg. Graham Butcher)
    distinguishedName (eg. CN=Graham Butcher,OU=User Accounts,OU=WMFS,DC=wmfs,DC=net)
    sAMAccountName (eg. Graham.Butcher) - this is the logon username
    memberOf (eg. CN=Analysts,OU=Global Groups,OU=Group Accounts,OU=WMFS,DC=wmfs,DC=net)

    I have tried numerous things in extra security parameters and the authorizer and authenicator class fields and am at a loss. Currently I have it signing in through CAS, but the user must exist in infoglue for a successful logon. Please help me to stop premature grey hairs and sore head.


    I currently have org.infoglue.cms.security.CASBasicAuthenticationModule in authenticator
    and org.infoglue.cms.security.GenericCombinedAuthorizationModule in authorizer

    This is what I currently have in extra security parameters:

    0.authorizerClassName=org.infoglue.cms.security.CASBasicAuthenticationModule
    1.authorizerClassName=org.infoglue.cms.security.InfoGlueBasicAuthorizationModule
    authenticationMethod=simple
    ldapVersion=3
    connectionURL=ldap://ldap.wmfs.net:389
    connectionName=********
    connectionPassword=********
    userBase=OU=User Accounts, OU=WMFS, DC=wmfs, DC=net
    userListSearch=(CN=*)
    userCacheTimeout=1800
    userSearchScope=SUBTREE_SCOPE
    userAttributesFilter=sAMAccountName,distinguishedName,CN,sn,memberOf
    userNameAttributeFilter=sAMAccountName,distinguishedName
    usersAttributeFilter=sAMAccountName
    userFirstNameAttributeFilter=givenName
    userLastNameAttributeFilter=sn
    userMailAttributeFilter=mail
    memberOfAttributeFilter=memberOf
    userNamePattern=sAMAccountName=infoglue.user,OU=User Accounts,OU=WMFS,DC=wmfs,DC=net

    This is the error message I get if I try to sign in as a user that is in AD but not in infoglue:
    The CAS-authenticated user intranet.user was not located in the authorization system's user database.
    Eclipse told me that getInstance was not a recognized method. We must be using different versions I guess. I'm using 2.9.5.
    Cheers for the try catch hint.

    Heres the tag code that I knocked up yesterday for getting the content id of any component by name (just in case its of use to anybody else):


    And here's an example of its use:

    jaric - you da man

    For the record, the actual code that I used to get the root content and keep the compiler happy was:


    The rest I can do - cheers much
    All I want to do is programatically get a component id of a component that I know the name of.

    Something like:
    <content:getComponent name="myContent" />

    Is there something, anything in infoglue that does this. I can write my own tag if I need to, in which case I need to know how I iterate through each content. This I can do, if I can find out the top (root) content id. I don't want to hard code content ids as when this is put onto the production version of infoglue, the id will be different.n I have tried:
    public int doEndTag() throws JspException
    {
    InfoGlueComponent igc = getComponentLogic().getInfoGlueComponent();
    //while (igc.getParentComponent() != null)
    //igc = igc.getParentComponent();

    produceResult(igc.getId());
    return EVAL_PAGE;
    }

    but all I get is 0 (zero).
    Help me, somebody, please. Head very sore from bashing against brick walls all day.
     
    Forum Index » Profile for GrahamButcher » Messages posted by GrahamButcher
    Go to:   
    Powered by JForum 2.1.8 © JForum Team