Feedback

This page is for comments, questions, or discussion items below. Related discussion pages include:

  • FAQ - Answers to Frequently Asked Questions. Please check the FAQ page before posting questions or bug reports.
  • Bug Reports - Please report any bugs on this page.
  • Feature Requests - If there is a feature that you would like to see added please discuss it on this page. See the Roadmap for a list of planned features.
  • How to Help - For those interested in implementing a specific feature.
  • Roadmap - A list of planned features for future releases.

It would be easiest if any new discussion was listed under its own heading, which can be done by entering the following code:

==This is a new Heading==

[Edit]Archives

This page tends to get crowded, so several discussions that have been resolved have been moved elsewhere:

Also see the Archived Feedback page for more old discussions.

[Edit]Templates conditions

Hi, I am trying to do some templates and infoboxes. I managed to create an infobox template with proper positioning, however I can not find a way to use conditions in it, for example to show {{{picture}}} only if the value is present. mediawiki offers this via parser functions. Example : this only shows value of some_field property if user specified its value

{{#if:{{{some_field<includeonly>|</includeonly>}}}|{{{some_field}}}
however this does not work for JAMwiki. So is there any way to include a property value only if it is specified? Any other info about using Templates (especially infoboxes) would be greatly appreciated. In case I was not clear enough , I would like to get this done: wikipedia:Infobox company

Thank you, Matus

JAMWiki doesn't yet implement Mediawiki's parser functions (soon, hopefully), so in the mean time you should be able to use Template:If, which is what was used on Mediawiki prior to the creation of the parser functions. For example:
{{if
|test=
|then=test is not empty
|else=test is empty
}}

Result: test is empty

{{if
|test=text
|then=test is not empty
|else=test is empty
}}

Result: test is not empty

-- Ryan 03-Apr-2008 10:51 PDT
Thanks a lot Ryan, good luck with development Matus 04-Apr-2008 01:41 PDT

Hi I've available some Mediawiki parser functions in the package info.bliki.wiki.template. In the expr subpackage I've started a parser for Mediawiki expressions (like in #Expr: and #Ifexpr). See testcases at the end of TemplateParserTest.java. You can test the #Expr: expression parser interactively with the Console application. -- Axel Kramer 06-Jun-2008 00:07 PDT

[Edit]Citations

I am looking at the code for WikiReference and how it appears to serve as a container for some content, where a vector of citations is passed to the parser. My goal is to implement something along the lines of Purple Numbers that grant fine-grained addressability to sentences, paragraphs, images, etc. Is there an explanation of how WikiReference objects could be extended to support that?

To be honest I haven't looked at the reference code in a while, so I'll need to refresh my memory to answer your question. I'm a bit fried from working at the moment, but I'll make a note to look through it some time in the next couple of days unless you figure out what you need without any additional input. Let me know if you come up with anything interesting! -- Ryan 06-Mar-2007 21:56 PST
Thanks! It seems to me that the trick, at least for me, is to wade through all the code to figure out when and where citations come into being, then decide if the WikiReference objects are appropriate to modify to include an identifier, if one doesn't already exist, such that a tweaked JSP code would write purple numbers usable for external direct reference. --Jack 07-Mar-2007 14:36 PST

[Edit]Wiki / database integration

I'm developing a web based database front end that integrates with a wiki. Basically, the idea is that every record can have an associated wiki page. There's a one to many relationship between wiki pages and db records (each wiki page can be linked to from more than one record) and wiki titles can be included in db reports.

JAMWiki is used because amongst other things its db schema is simple to understand and integrate with. You can query the db storage directly to retrieve titles and content. However, somewhere along the way I'll probably look at the interface to choose which wiki page to link to a db record. What would be good would be if I could use the Lucene search engine in JAMWiki to search for content just like you do in JAMWiki itself. I've had a look and can call the JSP search results page by URL directly with a search string. However, for integration I'll need to use a modified template with a different design and probably some JavaScript. Is it / could it be possible to include a parameter in the request to use an alternative JSP results template?

Does anyone have any alternative ideas?

A video showing the product is here: http://www.gtportalbase.com/video/gtwp_section_leader.htm. The wiki stuff is about halfway through.

82.32.115.35 21-Apr-2007 12:29 PDT

Apologies for not responding to this issue sooner. It should be possible to re-work the search engine code to allow anyone to create an alternative search engine implementation by simply implementing the SearchEngine interface, although that's currently untested and incomplete in the existing code. In any case, it would be nice if someone who wanted to customize the search code could simply change a Special:Admin option, which would also allow JAMWiki to integrate more easily with sites that already have their own search engines. -- Ryan 06-May-2007 21:43 PDT

[Edit]Using permissions to hide pages

Our department wants to put non-public data into JW which can only be viewed by members of our department. It is not plain to me whether it's possible to define rolls to fit to this. -- Frank 14-Sep-2007 04:26 PDT

Currently that level of granularity is not available. If it's absolutely a requirement for you then it might be achievable by creating a new role for the department (ROLE_DEPARTMENT_FOO), assigning that role to department members, and then requiring that all hidden topics for that department use a specific prefix, such as "DepartmentFoo/Topic". You would then need to manually modify the /WEB-INF/applicationContext-acegi-security.xml file to add the following lines to the "filterInvocationInterceptor" section such as:

<value>
    PATTERN_TYPE_APACHE_ANT
    /**/Special:Admin=ROLE_SYSADMIN
    /**/Special:Edit=ROLE_EDIT_EXISTING,ROLE_EDIT_NEW
    /**/Special:Login=ROLE_ANONYMOUS,ROLE_USER
    /**/Special:Maintenance=ROLE_SYSADMIN
    /**/Special:Manage=ROLE_ADMIN
    /**/Special:Move=ROLE_MOVE
    /**/Special:RecentChangesFeed=ROLE_ANONYMOUS,ROLE_USER
    /**/Special:Roles=ROLE_SYSADMIN
    /**/Special:Setup=ROLE_ANONYMOUS,ROLE_USER
    /**/Special:Translation=ROLE_TRANSLATE
    /**/Special:Upload=ROLE_UPLOAD
    /**/Special:Upgrade=ROLE_ANONYMOUS,ROLE_USER
    /**/DepartmentFoo/**=ROLE_DEPARTMENT_FOO
    /**/Special:*DepartmentFoo/**=ROLE_DEPARTMENT_FOO
    /**/*.jsp=ROLE_ANONYMOUS,ROLE_USER
    /**=ROLE_VIEW
</value>

Note that any changes to this file will require a server restart before they are active. This approach is definitely a hack, I haven't tested it so it may have issues, and there will probably still be ways for a motivated individual to work around it, but if it's a requirement for your company then this might be a decent temporary solution until that functionality is eventually available in JAMWiki (and note that it's not imminent, but will probably be added at some point by someone). Hope that helps. -- Ryan 14-Sep-2007 06:19 PDT
One additional note, upgrades can't support customizations and will overwrite the /WEB-INF/applicationContext-acegi-security.xml file, so if you take this approach you will also need to remember to re-add your customizations after any upgrade. -- Ryan 14-Sep-2007 06:22 PDT
Thank you....... testing at last....it works! I'm confident that this will expedite JWs acceptance in our company. -- Frank 21-Sep-2007 02:48 PDT

Hi!

I post a question on Tech:User Permissions#Hide the Register Link (on top) for the same situation described by Frank. This workaround work for me too.

Thanks for this tips!!! --Rafael Torres 21-Jul-2008 07:09 PDT

[Edit]Implementing a UserHandler to access external user data

I am trying to setup a JAMWiki for http://publicpress.org , a site that already has a user base with its own set of usernames/passwords etc. I implemented a UserHandler but it only seems to get invoked if I try to login with a user that I have created using JAMWiki. I don't really care about the "All Users" listing etc, so there is a way to easily make JAMWiki completely depend on my UserHandler? It seems to do some checking against some notion of an internal list of users, then not finding the user I want to authenticate, doesn't even call my UserHandler.

JAMWiki needs to maintain an internal list of authors so that the wiki can determine how to credit each user. It is possible, however, to use an external system for authenticating those users. It sounds like the feature you need is for JAMWiki to automatically create a jam_wiki_user record for any user who is authenticated but does not yet exist in the JAMWiki database.
That's a pretty basic feature, but since no one has requested it before it was never included in the default wiki code. If it's something you'd be interested in adding let me know, otherwise if you're willing to wait a bit I can investigate when next I have time to sit down and write code. In either case, it's a feature that will eventually get added, it was just waiting for someone to come along who needed it :) -- Ryan 22-Oct-2007 21:25 PDT

[Edit]LDAP Setup

I would love to use my LDAP server to authenticate my JAMWiki users - but I was unable to find something like a howto/sample configuration/etc.? Did I miss anything? More precisely my current questions are:

  • What do I use as "LDAP Factory-Class"? Do I have to provide this class or is there any already included?

(The other LDAP options on the admin page are pretty much straight forward.)

  • How (if) does the role-management with LDAP work? Do I have to provide special attributes? Put the users into special groups?

Thanks! -- Andy 03-Nov-2007 00:26 CET

The LDAP code is unfortunately incomplete and not particularly well-tested; when it was put in place it allowed a user's password and login to be verified against an LDAP server, but LDAP roles were never integrated. With respect to the LDAP factory class, LDAP implementations generally provide a JAR file that contains a factory class used for creating LDAP connection - that's the class to specify.
Any feedback you have about the current state of the LDAP implementation and what is missing or needs improvement would be appreciated - integrating with Acegi's LDAP support is on the to-do list, but since it hasn't been a heavily requested feature no one has gotten around to implementing it yet. -- Ryan 04-Nov-2007 08:05 PST
Thanks Ryan - that is somehow the situation I derived from reading the infos in the wiki. Is anybody out there really using LDAP with JAMWiki? Or am I completely on my own? I would appreciate some more details on how to use it, which LDAP implementation(s) have been used successfully and where to start integrating Acegis. Thanks. -- Andy 04-Nov-2007 18:50 CET
I can't honestly say I recall seeing any success reports with LDAP, although generally people only report problems. The biggest issue with the LDAP code is that it was started at the same time the Acegi integration was being done, and in the future the preferred method for handling LDAP would be through Acegi so no further work has been done. If you're saying it doesn't work I can hide it in the next release, and hopefully revisit it in the future. Sorry for the confusion, and thanks for the feedback! -- Ryan 08-Nov-2007 07:15 PST
Since LDAP is a current discussion issue I looked through the latest Acegi code in Subversion, and it looks like LDAP and tighter integration with Spring are major focuses of development for them, so when they release version 2.0 it will be a good time to revisit JAMWiki's security model and work on things like better LDAP integration. In the mean time I think JAMWiki may need to continue along with a somewhat incomplete LDAP integration, although it apparently IS functional given the comments below. -- Ryan 08-Nov-2007 21:21 PST

I've been looking through the code. As an intermediate solutions I would suggest something similar to this:

  • Extend the UserHandler to also retrieve roles for the user (e. g. lookupWikiUser(userName)).
  • Make the UserDetailsService (JAMWikiDaoImpl, InMemoryDaoWithDefaultRoles) use the UserHandler (instead of the DataHandler).
  • Extend the DatabaseUserHandler+LdapUserHandler to use the DataHandler to implement the extended UserHandler interface.
  • Create an AcegiLdapUserHandler to use Acegis methods to retrieve the data from LDAP. This would probably require a few more configuration properties but could also reuse a few of the LdapUserHandler.

Would such a UserHandler-Implementation still need to create all users in the database (as the InMemoryDaoWithDefaultRoles does)?

What do you think? Did I miss anything? If I find a few hours I could try to provide you with a patch? --Andy 10-Nov-2007 06:34 PST

These suggestions all seem sensible, and the first two look like they would be good ideas from even just an organizational standpoint. I'd like to try to use as much of the Acegi LDAP classes as possible, but it sounds like that's something you've considered. My understanding is that Acegi LDAP is still incomplete and is being further fleshed out for Acegi 2.0, so once that release is done I'd ideally like it to be relatively painless to transition JAMWiki code to allow Acegi to handle all of the authentication and authorization details.
The biggest issue, which you've pointed out, is that there needs to be a way to tie edits to users in the JAMWiki database, which is why user accounts were split into jam_wiki_user and jam_wiki_user_info in the first place. I suspect there will be some pain in making sure that a wiki user object exists for all authenticated users, but would need to spend some time looking at code to figure out exactly what's needed.
I'll have more time tomorrow to work on writing code, so I'll hopefully be able to look more closely at your proposal then. That said, I don't have an LDAP server that I use regularly, so it sounds like you have a better grasp of the issues and have looked into this issue. If the changes above work for you and can be implemented in a way that doesn't break existing implementations then I'd say give it a try - if you have a Sourceforge ID let me know what it is and I can give you Subversion access so that you can create your own branch and test things out. -- Ryan 10-Nov-2007 12:40 PST

Hello Ryan,

I'm looking into how to get LDAP working on our Jamwiki installation but am unsuccessfull. Taking into account the date of the last post in this issue, I'm wondering, is there any change/progress on this item? Just commenting out the standard authentication and activating the LDAP authentication doesn't work for me, although credentials are correct and used on various servers in our network. Do I need to install additional things for the Spring Security to work or is it completely integrated in Jamwiki? Kind regards, Eric 22-06-09

JAMWiki 0.7.0 completely overhauled the login and authentication code, so have a look at Configuration#LDAP / CAS / OpenID for some basic information about configuring LDAP, as well as links to the Spring Security reference guide. I don't personally use LDAP, but during 0.7.0 development I did a fair amount of testing with LDAP, and since then a number of users have reported that it works for them. -- Ryan • (comments) • 22-Jun-2009 07:20 PDT

[Edit]When will the production release happen?

Hi Ryan,

We are using JAMWiki for a quite a long time. Apart from the bugs i have posted we don't face much problems in it. We are expecting the production release of JAMWiki soon. Can you tell when is the production release planned for JAMWiki? Also some of the bugs remain unfixed. Particularly the DB2 issues and the setup issue. Really had good experience working with JAMWiki. Thank you.

--yesesnono 12-Nov-2007 02:53 PST

Thanks for the positive feedback! The DB2 issues are actually problematic - I tried downloading an evaluation version from IBM, but it requires XP Professional, which I don't have on my laptop. We use XP Professional at work, so one weekend where I'm feeling particularly motivated I'll set up DB2 and try to resolve the remaining problems.
In terms of a "production release", I assume you mean a 1.0 release? The current code should be solid enough for day-to-day use in a production environment. Initially I figured 1.0 would happen when JAMWiki implemented all major Mediawiki functionality, including the ability to import and export topics from one system to another, send email notifications, use parser functions, etc. Lately, however, work is keeping me busy enough that I can't put in the time necessary to focus on a roadmap of major features, so I've just been bumping the sub-major version number whenever a significant update is made to the software (example: 0.6.0 included significant changes to user authentication and authorization). As a result, 1.0 may actually mean "four more major updates to the code base", and wherever we're at when that happens will be 1.0. Aside from the psychological value of a "1.0" it's not something I worry about too much, but if others have opinions please add them, and if changes to versioning are needed then they can definitely be considered. -- Ryan 12-Nov-2007 08:20 PST

[Edit]A suggestion

Hi Ryan, Please, update before the next release, as did some corrections and may not be the last. I have a suggestion: the home page of the wiki could be translated to different languages. I think that would get a lot more people interested in JAMWiki.

Just to clarify, are you referring to jamwiki.org, or to new JAMWiki installs? The two options are:
  1. For new JAMWiki installs, the starting page and other pages can be translated as described on How to Help#Default Topics.
  2. If there is an interest in translating jamwiki.org I'd be happy to set up language-specific virtual wikis. My only concern is whether there are currently enough contributors to support translated versions of the web site.
In any case, thanks yet again for all of your work. It will all be included in the next release, and I've added you to the CREDITS file for both Spanish and Galician as "Manuel Meixide (mmeixide)" - let me know if you would prefer a different credit. -- Ryan 18-Dec-2007 20:05 PST

One never know if there are people interested in translating jamwiki.org... before trying it. For instance, the www.delilinux.de page, wiki and forum were only in German and English few months ago. I translated it to Galician (fully) Spanish and Portuguese (most of it). Now you can check there that several more languages were included later. About the credits: Would it be possible to include "from bagonix.net and ciberirmandade.org" ?--mmeixide 22-Dec-2007 04:40 PST

It can't hurt to give it a try :) I'm not sure that it would be feasible to translate everything that's on jamwiki.org, but for things like user documentation it would definitely make sense to make that available in other languages. I don't have time to come up with a complete list right now (it's the holidays), but things that would be good to translate include:
That's off the top of my head and in a bit of a rush (Christmas Eve and all)... if there are suggestions or anything else please let me know, otherwise I'll look into the technical issues after the holidays. Thanks for the original suggestion! -- Ryan 24-Dec-2007 21:26 PST

I am back from holidays travel but I have some more free days. I have been checking MediaWiki, and they have translated the starting page to 32 languages but other pages are less translated (for instance "Navigation" page is translated to 11 languages). I agree that the pages you have selected are the more interesting to be transtated. I will start to translate it to Galician and Spanish if you create the pages (or if you tell me how to do it). I have found also a volunteer to work with the Portuguese one.--mmeixide 03-Jan-2008 00:47 PST

Welcome back! I'll try to set up virtual wikis (ie http://jamwiki.org/gl/ and http://jamwiki.org/es/) for Galician and Spanish this weekend. In the mean time, if you're anxious to do a few more translations, at the moment the default topics that JAMWiki installs with for Spanish and Galician will still be in English - what that means is that a new installation will have translations for all of the fields that you've translated, but the default StartingPoints, LeftMenu, BottomArea and Special:Specialpages will be in English... soooo, if you're willing it would be great to get those four files translated. How to Help#Default Topics has instructions - just download the English version from the Sourceforge link provided, and I'll then include translated versions for the next release. Let me know if that's not clear or if you have any questions, and again, thanks a million for all of your help. -- Ryan 05-Jan-2008 08:02 PST

Hi again! I have translated the "Default Topics", both Galician and Spanish, and uploaded it here, with the Special:Upload page. I hope it is there... I will continue as soon as the virtual wikis are ready--mmeixide 07-Jan-2008 09:36 PST

Sorry, I totally forgot about setting up the virtual wikis - if I forget to do do it tonight after work please leave lots of nasty messages for me :) Thanks for the default page translations - I'll put all of those into Subversion when I get home. -- Ryan 07-Jan-2008 11:23 PST
I've set up the Galician virtual wiki and the Spanish virtual wiki, although I'm going to have to put together a script so that http://jamwiki.org/ will redirect appropriately - that may not happen for a few more days. I've also added bagonix.net and ciberirmandade.org in your entry in the pom.xml file, although there wasn't enough room in the CREDITS.txt file for both (80 characters per line), so let me know if you'd prefer to have one of the URLs in there. Let me know any suggestions you have for further publicizing any translated files - I suspect at a minimum a "languages" box like Mediawiki offers will be needed. -- Ryan 07-Jan-2008 22:01 PST

I can't edit some pages where I forgot to translate some links: http://jamwiki.org/wiki/gl/Special:TopicsAdmin http://jamwiki.org/wiki/gl/Special:Allpages http://jamwiki.org/wiki/gl/Special:Specialpages

There are also some other minor changes that I don't know how to do: I can't change the Page title: LeftMenu, that should be: Menú esquerdo I can't change the Page title: BottomArea, that should be: Pé de páxina

May I have to download the pages again, correct it and upload it again?

The same comments go to the Spanish translation, that was made in paralell and with the same criteria


About your questions: Credits: I prefer bagonix.net (that is our local linux group thet will open to public soon) Publicizing translated files: I agree that a "languages" box like Mediawiki offers will be needed. What I have done with other translations is to publicize it in the net, in apppropiate places, and put a link in the wiki to all that places. That helps to publicize what has been done, to get more users for the trtanslated versions, and to encourage new translations. You can see an example here: http://www.delilinux.org/wiki/doku.php?id=galego:reports:reviews ... that's all for now, and happy new year, if I forgot to say that before (probably I did :) --mmeixide 12-Jan-2008 12:05 PST

Thanks (again!) for all of your work. At the moment I don't think the code will support translating the names for pages like BottomArea, so that's something I'll need to look into for 0.6.4. I'll keep you updated as progress is made on that effort, but it will probably be several weeks (at least) before it gets done. A "languages" box similar to what's on Wikipedia should be easier, and I'm hoping to get that ready early in the 0.6.4 development process.
I'll update the credits information shortly for inclusion in the 0.6.3 release, and happy New Year to you as well! -- Ryan 13-Jan-2008 15:47 PST

Sorry I have explained it in a wrong way: I don't mean to change the page name, but the page title that appears in the page. I changed it in some pages, but I forgot to do it in some others. The same happens with some links that I forgot to change, and now I can't edit them. Anyway, if there is no way to change, it doesn't matter so much, as most of it is already translated.--mmeixide 14-Jan-2008 16:03 PST

Sorry, I lost track of this discussion and forgot to respond - feel free to add gentle reminders if I fail to respond after a day or two! Regarding the pages that you mentioned:
Feel free to make any changes you need using the latest version of these pages in Subversion, and then just upload them here and I'll make the required updates. The items I still have to do to support the translated versions of jamwiki.org are:
  • Add an "other languages" box.
  • Add support for links of the form [[es:StartingPoints]] to populate the "other languages" box.
  • Update my scripts to make sure that when new wiki code is uploaded to jamwiki.org it doesn't overwrite the virtual wiki configuration.
  • Potentially add support for changing the default topic name for other languages.
The above items may take a while, depending on how busy things are at work, but they should eventually get done. Let me know if I've forgotten anything, and as always thanks for all of your contributions. -- Ryan 19-Jan-2008 17:56 PST

[Edit]Incremental backup

We are interested in using a Wiki onboard of a research vessel, and in land at the same time. To sincronice both, we need incremental backups. My question is if JAMWiki has that feature.--mmeixide 18-Jan-2008 00:29 PST

--mmeixide 08-Feb-2008 00:40 PST There is no answer? :)--mmeixide 08-Feb-2008 00:40 PST

Sorry, I didn't see this question. I haven't used JAMWiki in this mode, so it isn't supported out of the box. The three things that would need to be synced if you wanted to try this are: 1) the database 2) the file upload folder 3) the search index (or you force the search engine to re-spider after each sync from Special:Maintenance). -- Ryan 08-Feb-2008 08:28 PST

[Edit]Admin Add/Create User

Hi there! We are hoping to use JAMWiki in a 'closed' Wiki scenario (I know it's kind of against the spirit of the application!). I have removed all permissions from the anonymous user, which appears to stop all unauthorised access to the wiki, but there doesn't appear to be a way for the admin user to create legitimate accounts for users. Any help gratefully received.

At the moment there isn't any way to register another person. What you might be able to do is to remove permission checks for the Special:Account page and let people register themselves - to do so you could modify /WEB-INF/applicationContext-acegi-security.xml and update the "filterInvocationInterceptor" to look like the following:

	<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
		<property name="authenticationManager">
			<ref local="authenticationManager" />
		</property>
		<property name="accessDecisionManager">
			<ref local="accessDecisionManager" />
		</property>
		<property name="objectDefinitionSource">
			<value>
				PATTERN_TYPE_APACHE_ANT
				/**/Special:Admin=ROLE_SYSADMIN
				/**/Special:Edit=ROLE_EDIT_EXISTING,ROLE_EDIT_NEW
				/**/Special:Login=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Maintenance=ROLE_SYSADMIN
				/**/Special:Manage=ROLE_ADMIN
				/**/Special:Move=ROLE_MOVE
				/**/Special:RecentChangesFeed=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Roles=ROLE_SYSADMIN
				/**/Special:Setup=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Translation=ROLE_TRANSLATE
				/**/Special:Upload=ROLE_UPLOAD
				/**/Special:Upgrade=ROLE_ANONYMOUS,ROLE_USER
				/**/*.jsp=ROLE_ANONYMOUS,ROLE_USER
				/**/*.css=ROLE_ANONYMOUS,ROLE_USER
				/images/**=ROLE_ANONYMOUS,ROLE_USER
				/upload/**=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Account=ROLE_ANONYMOUS,ROLE_USER
				/**=ROLE_VIEW
			</value>
		</property>
	</bean>

An admin user could then add specific permissions to that account. Alternatively, if there is some way that JAMWiki could be updated to accommodate your use case feel free to propose a solution, and if time permits and it's not too difficult to implement it could be included in an upcoming release. -- Ryan 29-Jan-2008 12:38 PST

[Edit]MySQL Timestamp error

Issue with a new install after saving my database configuration (MySQL 4.1.22). I'm on Tomcat 6.0.16, JDK 1.6.04 and JAMWiki 0.6.3. The error I get is:


java.lang.Exception: Failure while executing CREATE TABLE jam_wiki_user 
( wiki_user_id INTEGER NOT NULL, 
  login VARCHAR(100) NOT NULL, 
  display_name VARCHAR(100), 
  create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, 
  last_login_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, 
  create_ip_address VARCHAR(39) NOT NULL, 
  last_login_ip_address VARCHAR(39) NOT NULL, 
  remember_key VARCHAR(100) NOT NULL, 
  default_locale VARCHAR(8), 
  CONSTRAINT jam_p_wuser PRIMARY KEY (wiki_user_id) )

...

Caused by: java.sql.SQLException: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

Anyone seen this?

This mysql page http://dev.mysql.com/doc/refman/4.1/en/timestamp.html might help.

-Doug Donohoe (doug (at) donohoe (dot) info

Thanks for the detailed report. The MySQL scripts actually only use one CURRENT_TIMESTAMP for that table, so it looks like you may have accidentally selected the wrong "database type" setting. Alternatively, if the database type that was selected is definited MySQL there could possibly be another issue, although MySQL setup has been fairly reliable for most users. -- Ryan 23-Feb-2008 13:13 PST


Whoops. I overlooked the database type drop-down list. That fixed the problem. Perhaps in the future the configuration step can try and auto detect based on the JDBC driver. Thanks for the hint.
That seems to be a fairly common mistake, so it's definitely worth considering some ways to simplify. Unfortunately development time is not in plentiful supply, and changes to the setup process require a ton of testing, so it may be a while before that gets revisited, but I'll keep this suggestion around. -- Ryan 24-Feb-2008 08:39 PST

[Edit]User Defined Roles

I installed JAMWiki 0.6.3 and was impressed with ease of installation and configuration. Up and running in five minutes.

I work with a number of developers and we are using a few different Wikis to track code snippets and as a knowledge base for support of our systems. I noticed the ability to create user defined roles and I was interested in using roles to provide a private area for a select group. We keep password information for our systems that we want to share with a few developers. So I need the capability to limit viewing to the users with a specific role. Similar to the Admin functionality and is already built into JAMWiki. I could easily set up a user defined role and assign it to users but I could not find documentation on how the role is then used against a specific page. If this type of functionality available or is this still under development? If you can point me to any additional documentation I would appreciate it.

Thanks for a great Wiki. --Tom 28-Feb-2008 08:35 PST

Thanks for the kind words - it's definitely nice to get some positive feedback in the midst of the bug reports and rants that are more common :) Regarding creating pages that are limited to a select group, unfortunately there isn't much documentation on that yet, but you could do something like the following:
  1. Create a role such as "ROLE_RESTRICTED".
  2. Assign your developers to this role.
  3. Modify the /WEB-INF/applicationContext-acegi-security.xml file and modify the "filterInvocationInterceptor" bean section to restrict a certain path to users with ROLE_RESTRICTED:

		<property name="objectDefinitionSource">
			<value>
				PATTERN_TYPE_APACHE_ANT
				/**/Special:Admin=ROLE_SYSADMIN
				/**/Special:Edit=ROLE_EDIT_EXISTING,ROLE_EDIT_NEW
				/**/Special:Login=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Maintenance=ROLE_SYSADMIN
				/**/Special:Manage=ROLE_ADMIN
				/**/Special:Move=ROLE_MOVE
				/**/Special:RecentChangesFeed=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Roles=ROLE_SYSADMIN
				/**/Special:Setup=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Translation=ROLE_TRANSLATE
				/**/Special:Upload=ROLE_UPLOAD
				/**/Special:Upgrade=ROLE_ANONYMOUS,ROLE_USER
				/**/*.jsp=ROLE_ANONYMOUS,ROLE_USER
				/**/*.css=ROLE_ANONYMOUS,ROLE_USER
				/images/**=ROLE_ANONYMOUS,ROLE_USER
				/upload/**=ROLE_ANONYMOUS,ROLE_USER
				/**/Restricted/**=ROLE_RESTRICTED
				/**=ROLE_VIEW
			</value>
		</property>

You would then need to restart your app server, but that should force a login with ROLE_RESTRICTED for any user trying to access a page such as /wiki/en/Restricted/List_of_Passwords. One caveat is that you will need to remember to update this file again any time you upgrade as it will be overwritten by the upgrade process - hopefully in the future this can be made more "out of the box" so that users won't have to change internal files. If you need further customization you can take a look at the Acegi project's documentation for some guidelines of how to configure their security files. Please let me know if you encounter any issues or have any questions. -- Ryan 28-Feb-2008 10:24 PST

Ryan, thanks for the information on roles. Works great and provided exactly the functionality I was looking for. --Tom 02-Mar-2008 13:48 PST

[Edit]How to add some enhancements?

I'd like to add database/SQL support to my JAMWiki (either using a JNDI connection or a JDBC one), then I'd like to display the retrieved data as a table and as a chart, in some case I'd like to make use of pivot tables and/or charts (eg. jPivot).

Then I'd like to add semantic functionallity (Jena and SDB).

How would I accomplish this at the time being? If not as some kind of an extension, maybe via the a detour, like incorprating JSP/JS/etc. code or pages.
--Sil68 02-Apr-2008 03:22 PDT

I'm not 100% sure I understand the proposed enhancement - in this proposal, what wiki functionality would be used? Or is this proposal simply an add-on that would exist in a wiki site? If it's not using existing wiki functionality then you would need to create a new servlet & JSP to perform the desired functionality, and that could then be incorporated into the wiki as (for example) a "Special:MyDataRetrieval" page, or something similar. If that's what is needed then the two key things to look at are the /WEB-INF/jamwiki-servlet.xml file and Spring's SimpleUrlHandlerMapping servlet. Also take a look at the org.jamwiki.servlet.JAMWikiServlet, which extends Spring's AbstractController servlet. -- Ryan 02-Apr-2008 08:24 PDT
I'm thinking here of something like (in case of a JNDI resource):

{{DBType=JNDI
|Resource=jdbc/MyDB
|Page-Break=30
|SQL=SELECT col1, col2, col4 FROM mytable WHERE col3 = 'xyz';
}}

or (in case of a JDBC connection):


{{DBType=JDBC
|URL=jdbc:h2:tcp://localhost:9029/MyDB
|User=sa
|Password=""
|Page-Break=30
|SQL=SELECT col1, col2, col4 FROM mytable WHERE col3 = 'xyz';
}}

with "Page-Break" meaning to repeat the header of the resulting table after every 30 rows.

As for the semantic enhancement, there's the Semantic MediaWiki extension available; on the Java/JSP side there exists amongst others makna built on top of Jena and SDB. And I'd like to add this functionality to JAMWiki (there are some special pages and tags).--Sil68 02-Apr-2008 12:35 PDT

Looking at the current JAMWiki code I'm honestly not sure what the best way for implementing your functionality would be. I've been focused on changes to the parser during the 0.6.6 release cycle to make it more flexible, and it's now very close to the point where a hook could be added for third-party developers to create their own tags, but I was thinking that those tags would be in XML format - ie: <mytag attribute1="" attribute2="" />. Allowing custom tags isn't something I was planning on working on just yet, but if there's an interest then I can try to provide a bit more insight into how I envisioned that working.
I haven't looked at what Mediawiki's solution to your issue would be, but if possible I'd prefer to follow their lead. Sadly I can't commit a lot of time to this work right now as my day job keeps me busy 50+ hours a week, but if you're interested in creating a branch and working on something I'd be happy to give you Subversion access and help out where possible. -- Ryan 02-Apr-2008 21:23 PDT
Well, I could give it a shot, toying around a bit, maybe I can produce something nice & shiny!? ;) At least for Jena/SDB I was able to provide a H2 database backend support.--Sil68 03-Apr-2008 06:38 PDT
Just let me know your Sourceforge ID if you're interested and I'll make sure you get access to create a branch. Nice and shiny is always good, and once you get going hopefully there will be some indication of how best to integrate this sort of functionality in the future. :) -- Ryan 03-Apr-2008 20:18 PDT
Sil68--Sil68 07-Apr-2008 07:44 PDT
Done. Let me know if you have any problems. -- Ryan 07-Apr-2008 13:03 PDT
Shall I just do a checkout of the regular trunk, and then, if I "produced" something "worth" check it in as a branch?--Sil68 13-Apr-2008 11:48 PDT
It's up to you - you can either checkout the trunk and work locally, or create a branch from the trunk in the repository which you would then need to sync from trunk occasionally. If you create a branch and work there it gives others a chance to review what you're doing and potentially provide suggestions or patches, but merging can be a hassle and many people prefer to develop privately to allow more experimentation without creating a lot of noise. Either way, do whatever you're more comfortable with, and hopefully all will go well. -- Ryan 13-Apr-2008 12:56 PDT
Well, Ryan, it seems that I'm fishing in other water for a too long a time already; I can't find my way back again to developing! :(( --Sil68 25-Apr-2008 11:48 PDT

[Edit]Assuring Security by testing

Hi devs,

I've been investigating JAMWiki within my Bachelor's thesis "Application of security test tools in open source" at the Free University of Berlin (FU Berlin). Basically, I am looking for security measures which have been taken to prevent security leaks/vulnerabilities especially with security test tools which provide fuzzing capabilities for SQL injection, parameter tampering, path traversal etc.

So far, I have searched the repository and the homepage. Surefire runs JUnit test cases which are not designed to do any security testing. The homepage revealed some ideas about fuzzing (not available thru lucene anymore) but no measures in this direction have been taken.

Are any measures taken whatsoever to assure security with testing tools, a special test plan or functional requirements?

Thanks in advance,

Michael

With respect to security, here are several general areas of focus within JAMWiki:
  • Several of the unit tests are designed to detect XSS vulnerabilities (originally suggested by NickJ). These tests can be found in the source code in the /jamwiki-core/src/test/resources/data/topics/ directory and contain "XSS" in the name.
  • All user passwords are encrypted using strong password encryption.
  • Prepared statements are used for all database queries to avoid SQL injection.
  • The Acegi security framework is used to control access to pages.
  • Javascript within wiki syntax is disabled by default.
If there are additional automated tools that can be used then that would definitely be of interest, and if legitimate holes are found then it would be a priority to close them. Hopefully that answers your question! -- Ryan 30-Apr-2008 07:59 PDT
Ryan,
thanks for your quick reply. I svn co the source again and found the 2 testcases for XSS. It seems to me like a good starter. Were you already able to tackle down any holes by it?
The four security measures you take are great, removes most of the attack are. Btw you mean you ciphering the passwords with a one-way hash function like SHA1 and not encrypting them. Encrypting means, I can decrypt them with a password. Don't you?
It answer the question pretty. I assume right now that there is no explicit security testing with and without appropriate testing tools except those XSS test resources.
What may be of your interest, is Absinthe, Wfuzz and some other tools stated here.
Most of the test cases are there as a result of a previous bug report - the XSS unit tests resulted from bug reports from NickJ, who also does a lot of security testing on Mediawiki. And yes, the passwords are ciphered - sorry, I'm awful with terminology (my talent is in writing code - remembering names is something I fail miserably at). The default cipher for passwords is SHA-512, but for older JDKs and systems that don't support SHA-512 it falls back to SHA-1.
There isn't currently explicit security testing using the tools you've mentioned, but anyone interested in adding it is welcome to do so. Additionally, I've had fuzz-testing on my to-do list forever, but haven't found the time to implement anything. -- Ryan 30-Apr-2008 10:51 PDT
Ryan, thanks for the link over to NickJ. He has his own website with the fuzzer "mangleme". I'll try to run some tools on JAMWiki and will report to you in the next couple of weeks. Mike

[Edit]How Can I Reset the Administrative Password?

I set up jamwiki late one night a couple of weeks ago. Now I'm ready to spend a little more time configuring it, but I can't remember the administrative password. I've tried everything I can think of, but no luck. Is there anything I can do to reset the password other than starting over with a new installation?

If you've forgotten your admin password then the only way to re-gain access to the wiki is to set up a new version. Sorry! JAMWiki 0.6.6 will include the ability for an admin to reset a user's password, but without the admin password you'll be locked out of all admin functionality. -- Ryan 09-May-2008 22:16 PDT

JAMWiki stores user passwords in the database (in the jam_wiki_user and jam_wiki_user_info tables), so if you have access to the database you can see and edit the encrypted passwords. I used this to reset the admin password to the know password of a non-admin user using the following sql:

update jam_wiki_user_info set encoded_password = (select encoded_password from jam_wiki_user_info where login = 'user-id-with-known-password') where wiki_user_id = 1;
update jam_wiki_user set remember_key = (select remember_key from jam_wiki_user where login = 'user-id-with-known-password') where wiki_user_id = 1;
commit;

If you're using the HSQL database it may be necessary to shut down the appserver first (to get exclusive access to the database files).

Thanks, I used that approach when resetting user passwords prior to the "reset password" feature being added in 0.6.6, so it should also solve the problem for forgotten admin passwords. -- Ryan 20-Jul-2008 20:35 PDT

Was there a default password? Is there any chance I may not have changed it, or did I have to enter a password at some point?

If I need to start over, what's the least I need to do? It appears that the only change that's taken place to the files in the jamwiki webapp folder is that /jamwiki/WEB-INF/classes/jamwiki.properties has been created. Everything else has a modification date of 3/16 or older. Can I just delete that file and restart Tomcat?

How much of the database do I need to get rid of to make it think it hasn't been set up yet? Tables or just the data?

Thanks!

There isn't a default password - that's something you would have been asked for at setup. To set up a fresh install that re-uses an existing database you can try shutting down your app server, deleting your jamwiki.properties file, and then starting up again. You'll get the setup screen, and if you enter the same database settings as before JAMWiki will detect that there is a database already installed and give you a warning message that a database was found, so no new database will be setup. If you click OK that should (hopefully) solve the problem, although I've never tried this using a different admin account / password, so that might be a problem. Hope that works! -- Ryan 10-May-2008 08:08 PDT

Thanks again, Ryan. I had already dropped all the tables before I read this, since I didn't have any data there yet, so I can't tell you if it works to just delete jamwiki.properties. I thought I'd at least have to delete the admin identity from the user and user_info tables, but maybe not. Anyway, I've got it up and running again.

In case you're interested, I'm running it in Tomcat 6.0.14 with PostgreSQL 8.3.1 on Mac OS X 10.4.11.

[Edit]Removing the self registration

It would be better if jamwiki provides a support for approval on registration. so that we can control the unknown users editing the content(in our case our corporate knowledge base).

For time being could you please help me on removing the link "register" on top right corner in wiki pages. --Durga 28-May-2008 11:50 PDT

The easiest way to prevent self-registration is probably to add a permission for the Special:Account page to your /WEB-INF/applicationContext-acegi-security.xml. This will prevent any non-logged in users from accessing the registration page:
	<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
		<property name="authenticationManager" ref="authenticationManager" />
		<property name="accessDecisionManager" ref="accessDecisionManager" />
		<property name="objectDefinitionSource">
			<value><![CDATA[
				PATTERN_TYPE_APACHE_ANT
				/**/Special:Admin=ROLE_SYSADMIN
				/**/Special:Edit=ROLE_EDIT_EXISTING,ROLE_EDIT_NEW
				/**/Special:Login=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Maintenance=ROLE_SYSADMIN
				/**/Special:Manage=ROLE_ADMIN
				/**/Special:Move=ROLE_MOVE
				/**/Special:RecentChangesFeed=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Roles=ROLE_SYSADMIN
				/**/Special:Setup=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Translation=ROLE_TRANSLATE
				/**/Special:Upload=ROLE_UPLOAD
				/**/Special:Upgrade=ROLE_ANONYMOUS,ROLE_USER
				/**/Special:Account=ROLE_USER
				/**/*.jsp=ROLE_ANONYMOUS,ROLE_USER
				/**/*.css=ROLE_ANONYMOUS,ROLE_USER
				/images/**=ROLE_ANONYMOUS,ROLE_USER
				/upload/**=ROLE_ANONYMOUS,ROLE_USER
				/**=ROLE_VIEW
			]]></value>
		</property>
	</bean>
Hope that helps. The next major release of JAMWiki (0.7.0) will include an upgrade to the latest Acegi version, and I would like to improve support for use-cases like yours as part of that development cycle. -- Ryan 28-May-2008 13:33 PDT
this is not working. since the jamwiki pulling all the info of the current user and not allowing me to add new user when i try to go to Special:Account page in wiki. please tell me where can i remove the register link from wiki, if required i will bookmark and go there whenever required. --Durga 30-May-2008 11:36 PDT
I misunderstood your original question - sorry! At present it isn't possible to register another user. That functionality has been requested by several different users, so it might be something that can be added during the next release cycle. -- Ryan 01-Jun-2008 22:24 PDT
We did this by editing the 'registration.jsp'. Removed the registration form and replaced it by a custom message. There are 3 disadvantages: 1) you have to repeate this step after every jamwiki upgrade 2) to create new users you have to restore the original JSP (this happens not very often here) 3) a jamwiki 'insider' might still fake a webrequest to create a new user --HB 15-Sep-2008 04:46 PDT
Thanks for following up. As part of the 0.7.x release cycle I've got it on my to-do list to investigate whether or not implementing the functionality that you need is feasible - at a minimum I'd like to provide admin options to hide the registration (and a few other) links, and potentially also allow sysadmins to create user accounts. -- Ryan 15-Sep-2008 08:45 PDT

[Edit]Email Notifications

It would be nice if the user is notified if any change in his topic/pages. Example i posted my feedback here. and i need to continuesly come and visit this page to see if anyone replied to this thread. --Durga 28-May-2008 11:52 PDT

See Tech:Email. There are a number of people asking for this feature, so it is likely that it will be added to an upcoming release, although there will probably be several months before it is officially released. -- Ryan 28-May-2008 13:27 PDT

[Edit]JAMWiki 0.7.0

[Edit]Current Plans

I'll be heading off on a much-needed vacation starting this weekend and lasting until mid-July, so development on the next version of JAMWiki probably won't start in earnest until I return. While I'm gone I'll probably be restricting edits on jamwiki.org to registered users to cut down on any spam, although I'll try to check in occasionally to see how things are going - if anyone else notices spam, unanswered user queries or other issues I'd be grateful for any help in resolving things.

The big plan for the next release is upgrading Acegi, hopefully making LDAP integration simpler in the process and adding some flexibility for those who want to add more control over users. In addition, folks at my workplace are grumbling about not being able to set email alerts when topics are changed, so that may be climbing up the priority list. And as always I suspect that a few contributors may show up with great ideas for features or changes of their own to implement. -- Ryan 04-Jun-2008 21:57 PDT

[Edit]Status Update (September 2008)

While a final release of JAMWiki 0.7.0 remains at least a couple of months away, there is a significant amount of work that has already been completed - see the Changelog for the latest updates. The upgrade to Spring Security 2.0 is more-or-less done, although a major piece of work remains in making JAMWiki utilize Spring Security's LDAP and OpenID integrations.

I usually only release the first beta when all database schema updates have been made, and since at this point it's not clear if additional schema changes will be required I'm holding off on a beta. However, if anyone is interested in testing but cannot build from source, please add a comment here and I can put something together. As always, feedback and bug reports are appreciated. -- Ryan 12-Sep-2008 22:35 PDT

[Edit]JAMWiki 0.6.7 Beta 1

In order to get bugfixes out without having to wait longer for 0.7.0 to be finished I've merged all bugfixes from trunk to a 0.6.7 branch. The first beta is available below:

There won't be any new features in this release, but a list of bugfixes and translation updates are available in the CHANGELOG. Feedback is appreciated - barring any surprises I'll make a final release in the next 1-2 weeks. -- Ryan 17-Sep-2008 22:15 PDT

[Edit]JAMWiki 0.6.7 Final

The release notes are done and I've done a quick test of a clean install and an upgrade (both seem fine), so as far as I'm aware JAMWiki 0.6.7 is ready for release. I'll wait until tomorrow to do the final push, so if anyone has a bug report, translation update, or other change that needs to go in speak up now. -- Ryan 27-Sep-2008 15:26 PDT

[Edit]How can i translate the Special:Specialpages on my JAMWiki ?

Is possible translate the contentes of Special:Specialpages ? thanks! --Rafael Torres 21-Jul-2008 07:23 PDT

????--EDVJAR 28-Jul-2008 12:11 PDT

At present Special:Specialpages is set up by default in the language of the user who first installed JAMWiki. Obviously an enhancement is needed so that this page can be localized - this should be easy to do, so if I don't get to it soon then I'd be glad to help someone else who might be interested in working on it. -- Ryan 14-Sep-2008 09:25 PDT
Note that BottomArea and LeftMenu might also benefit from having localized versions... -- Ryan 14-Sep-2008 09:26 PDT
revision 2333 implements the ability for Special:Specialpages to be localized. Presently the page is translated for English, German, Spanish, Galician, Hungarian, and Japanese. This change will be included in the JAMWiki 0.7.0 release. -- Ryan 29-Sep-2008 21:53 PDT

[Edit]API for Creating/Editing Pages

Hey, great piece of work you've got going here. I'm relatively new to the whole wiki deployment scene and I was wondering if it was possible to edit or create pages using code? Sort of an API for adding data to a page without direct user involvement. Say that some data became available, could I automatically take that data and insert it into a page without a user having to know that the data is now available?

Nothing like that is yet available, and my personal to-do list is long enough that I probably wouldn't get to it for quite some time, but if you're willing to put together some use-cases or a proposal for the type of functionality you'd need then it would go a long way towards getting the process started - simply start an article such as Tech:Editing APIs and link it from the Feature Requests page so that others can view it and comment. It's generally not a particular speedy process, but I've been very surprised at how many features are implemented by one-time contributors who read an existing feature request and create an implementation. -- Ryan 01-Aug-2008 11:10 PDT
Thanks for getting the ball rolling on this one. I suspect it may be a while before someone takes it and starts implementing, but I have no doubts that it will eventually get done. Please continue to update the tech request with any other ideas you have or any info about similar implementations. -- Ryan 02-Aug-2008 13:36 PDT

[Edit]Virtual Wiki automation without restarting container

Is there a way to automate virtual wikis so the web.xml doesn't have to be updated and the container restarted? I want to automate the creation of virtual wikis and I don't want any of these manual steps in there. -Will 10/30/2008 2:00 MST

I'm sure it's possible, but without digging into the code no ideas for implementing this come immediately to mind. If you've got ideas then patches are welcome; alternatively the way I work is to implement those things that I'm most interested in OR that people continually bug me about. Since I don't personally do much with virtual wikis, frequent reminders is probably the best way to prod me into coding this functionality :) -- Ryan 30-Oct-2008 21:44 PDT

[Edit]Upload folder outside of WAR

I tried to set upload directory to a folder outside WAR. Upload were working fine, downloads were failing. This was obviously because, upload is expected to happen within war. It is fairly easy to keep uploads outside the war by writing a downloadservlet or implementation of JAMWikiServlet which would be responsible to download the files requested. I just implemented this feature to keep uploads outside of war. All I changed is constructing the link for files and images to point it to a download servlet with request parameter as actual file url of the file. It works perfectly for image (inline) and file download. Is there a plan to implement this? Would my implementation be welcomed? BTW, I like JAMWiki after I evaluated JSPWiki and XWiki. I liked its simplicity and code. Way to JAMWiki!!! -- Satish 12-Nov-2008 22:14 EST

Thanks for the kind words. If you have working code available that you are willing to release under the LGPL license then it's definitely something that could be integrated into a future release. Feel free to upload it, and provided the code can be implemented cleanly (ie without requiring changes to too much existing code) then adding it to the next release should be fairly simple. Alternatively, see How to Help for details about getting Subversion access. -- Ryan 12-Nov-2008 20:47 PST
I too think having the upload directory outside of the WAR directory makes much more sense for administration and security reasons. I currently have JAMWiki set up with both the database and upload directories outside of the WAR tree. I have to use Apache HTTPD to serve the upload directory, but it's working ok, for the most part. --Tim 31-Dec-2008 11:50 PST

[Edit]Preventing search

I'm using a role to keep a few pages that are restricted so a number of developers in my group can share passwords on our Wiki. I just realized that the restricted pages are being indexed for searching so if I do a search for a keywork like "password" I often get hits on my restricted pages and each hit provides enough context that the passwords are usually visible in the search page. Is there any functionality provided by the search engine to stop indexing of specific pages or better yet to stop searching based on a role? I've been using JAMWiki for about a year now and I'm really impressed at how solid it is and how easy the upgrades have gone. Thanks. --Tom Schueller 03-Dec-2008 23:31 PST

Thanks again for the kind words - glad the software is working well for you. As to preventing search of certain topics, two disclaimers: first, at present the system currently isn't designed to offer that capability, and second, I haven't given this issue extensive thought so there may be a better or easier solution. That said, my first thought is that it wouldn't be hard to modify the org.jamwiki.search.LuceneSearchEngine.findResults() method to include Lucene's QueryFilter method to exclude topics with certain names. Alternatively you might be able to use Javascript to add an exclusion (such as "-specific_term_to_exclude") to all queries. Longer term some sort of configurable plugin system will probably need to be built, but if a quick fix is needed then this solution should (hopefully!) be enough to get you going. -- Ryan 04-Dec-2008 20:10 PST

[Edit]Still the old problem with the StartPage

Hi Ryan, there is still the old problem with the StartingPage. I did install the jamwiki 0.6.7 on my local computer and everything went fine but the StartingPoints - Page had a questionmark and also the link in the left-navigation bar! Wenn I did change the web.xml to use the german context - changed en to de - I got a really strange StartingPoints-page after the restart of the tomcat6.

<script type="text/javascript">
function cancel() {
	history.go(-1);
}
</script>

<div class="contents">
	<div class="message">Ein Systemfehler ist aufgetreten. Die Fehlermeldung lautet:</div>
	<div class="message red">Ein unbekannter Systemfehler ist aufgetreten.  Die Fehlermeldung lautet: java.lang.NullPointerException.</div>

	<form><input type="button" onClick="cancel();" value="Zurück" /></form>
</div>

	<br />
	</div>
</div>

and the logs say:

2009-01-04 15:39:47,259 CONFIG: org.jamwiki.utils.WikiLogger - JAMWiki log initialized from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/logging.properties with pattern %t/jamwiki.log.%g
2009-01-04 15:39:47,401 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/jamwiki.properties
2009-01-04 15:39:47,467 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/sql.ansi.properties
2009-01-04 15:39:47,474 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/sql.ansi.properties
2009-01-04 15:39:47,476 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/sql.ansi.properties
2009-01-04 15:39:47,479 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/sql.mysql.properties
2009-01-04 15:40:22,903 SEVERE: org.jamwiki.servlets.ServletUtil - Servlet error
java.lang.NullPointerException
       at org.jamwiki.servlets.TopicServlet.view(TopicServlet.java:57)
       at org.jamwiki.servlets.TopicServlet.handleJAMWikiRequest(TopicServlet.java:45)
       at org.jamwiki.servlets.JAMWikiServlet.handleRequestInternal(JAMWikiServlet.java:74)
       at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
       at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
       at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
       at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
       at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
       at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.jamwiki.authentication.JAMWikiExceptionMessageFilter.doFilter(JAMWikiExceptionMessageFilter.java:71)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
       at org.jamwiki.authentication.JAMWikiAnonymousProcessingFilter.doFilter(JAMWikiAnonymousProcessingFilter.java:54)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
       at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jamwiki.servlets.JAMWikiFilter.doFilter(JAMWikiFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:636)
2009-01-04 15:40:22,981 SEVERE: org.jamwiki.servlets.ServletUtil - No virtual wiki found for de
2009-01-04 15:40:23,078 CONFIG: org.jamwiki.WikiConfiguration - Configuration values loaded from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/jamwiki-configuration.xml
2009-01-04 15:40:23,096 WARNING: org.jamwiki.servlets.ServletUtil - error getting cached page de / LeftMenu
java.lang.NullPointerException
       at org.jamwiki.servlets.ServletUtil.cachedContent(ServletUtil.java:254)
       at org.jamwiki.servlets.ServletUtil.buildLayout(ServletUtil.java:101)
       at org.jamwiki.servlets.ServletUtil.loadDefaults(ServletUtil.java:563)
       at org.jamwiki.servlets.ServletUtil.viewError(ServletUtil.java:771)
       at org.jamwiki.servlets.JAMWikiServlet.handleRequestInternal(JAMWikiServlet.java:79)
       at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
       at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
       at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
       at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
       at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
       at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.jamwiki.authentication.JAMWikiExceptionMessageFilter.doFilter(JAMWikiExceptionMessageFilter.java:71)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
       at org.jamwiki.authentication.JAMWikiAnonymousProcessingFilter.doFilter(JAMWikiAnonymousProcessingFilter.java:54)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
       at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jamwiki.servlets.JAMWikiFilter.doFilter(JAMWikiFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:636)
2009-01-04 15:40:23,260 INFO: org.jamwiki.parser.jflex.JFlexParser - Parse time (parseHTML) for BottomArea (0.066 s.)
2009-01-04 15:40:24,927 CONFIG: org.jamwiki.Environment - Loading properties from /var/lib/tomcat6/webapps/jamwiki/WEB-INF/classes/interwiki.properties

So, is this the old bug - we talked about earlier (identified with my first webtests?). Anyway I will install the 0.7.0 version now and try again. -- greetings from 95.114.106.229 04-Jan-2009 06:51 PST

This seems to be very serious! A lot of pages are defekt or only work if I login as registered user - but most of the time I get forwarded to the englisch context. -- greetings Mbert.

2009-01-04 16:21:42,740 SEVERE: org.jamwiki.servlets.ServletUtil - No virtual wiki found for de
2009-01-04 16:21:42,741 WARNING: org.jamwiki.servlets.ServletUtil - error getting cached page de / LeftMenu
java.lang.NullPointerException
       at org.jamwiki.servlets.ServletUtil.cachedContent(ServletUtil.java:254)
       at org.jamwiki.servlets.ServletUtil.buildLayout(ServletUtil.java:101)
       at org.jamwiki.servlets.ServletUtil.loadDefaults(ServletUtil.java:563)
       at org.jamwiki.servlets.ServletUtil.viewError(ServletUtil.java:771)
       at org.jamwiki.servlets.JAMWikiServlet.handleRequestInternal(JAMWikiServlet.java:79)
       at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
       at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
       at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
       at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
       at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
       at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
       at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.jamwiki.authentication.JAMWikiExceptionMessageFilter.doFilter(JAMWikiExceptionMessageFilter.java:71)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
       at org.jamwiki.authentication.JAMWikiAnonymousProcessingFilter.doFilter(JAMWikiAnonymousProcessingFilter.java:54)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
       at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
       at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
       at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jamwiki.servlets.JAMWikiFilter.doFilter(JAMWikiFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:636)

Hi Ryan, for me it is at this moment impossible to use the german context (de) with jamwiki 0.6.7. can you please fix it? After my update to ubuntu 8.10 I'm a little bit lost in space with my jamwiki installation - upgrading to 0.6.7 .... ;-/ -- mbert 05-Jan-2009 00:55 PST

I'll take a closer look at this issue after I get off of work. From the stack traces it isn't immediately obvious to me what's wrong, although one thing to check might be verifying that permissions on all JAMWiki directories (particularly the "File System Directory") are allowing read/write access to Tomcat. -- Ryan 05-Jan-2009 07:41 PST
The line in TopicServlet that is failing is the following:
VirtualWiki virtualWiki = WikiBase.getDataHandler().lookupVirtualWiki(virtualWikiName);
topic = virtualWiki.getDefaultTopicName();
It appears that there isn't a database record for your "de" virtual wiki... just to confirm, the web.xml should probably look something like the following:
<servlet-mapping>
     <servlet-name>jamwiki</servlet-name>
     <url-pattern>/en/*</url-pattern> 
</servlet-mapping>
<servlet-mapping>
     <servlet-name>jamwiki</servlet-name>
     <url-pattern>/de/*</url-pattern> 
</servlet-mapping>
And if you go to Special:Maintenance on your wiki (using "en" or "de") you should see records for both of these virtual wikis:
Name Default Topic
en StartingPoints
de StartingPoints
If you've changed the default topic then it would show something different. Anyhow, let me know if you've got anything different from what's shown above. -- Ryan 05-Jan-2009 19:30 PST

[Edit]Version 0.7.0 Problem with the login

Hi Ryan, I just made the post and did login with my account. It seem to work, but wenn I did my post and signed with:

~~~~

it was not recognized as my account-shorts... And with the save action I was loged out. -- 95.114.106.229 04-Jan-2009 07:03 PST

Hi Ryan, its seems to be related to the cookies. If I allow the firefox to accept cookies from my lokal installation the session goes on. But this is different than bevor, right? -- greetings Mbert
I've never done any testing with cookies disabled, so I'll need to check it out. It's possible that disabling cookies might prevent Spring Security from tracking login status, which would explain the behavior you're seeing. -- Ryan 04-Jan-2009 08:09 PST

Hi Ryan, this is afaik an acceptable behavior - if expected and documented. I wonder that I do not pass that way earlier ;-). -- mbert 04-Jan-2009 09:03 PST

[Edit]Special:History

On the Special:History-Page the username of the author is listed (usernames are stored in [jam_recent_change]). Wouldn't it be nice if the displayName of the user (if a displayName exists) would be printed instead? --hp 08-Jan-2009 23:30 PST

The current implementation was done to match Mediawiki - I believe that they use the login to prevent malicious users from trying to impersonate other editors since logins are unique and cannot be faked. It might be possible to provide a configuration option that allows site administrators to change this behavior; I'll move this comment to the Feature Requests page so that others can comment. -- Ryan 09-Jan-2009 07:24 PST
I can see small friendly user bases and some businesses enjoying a feature like this. If implemented I would make it more generalized and use a template string to determine how identity is displayed across the entire wiki. For example, in signatures, various special pages, and at the top by your account when you are logging in.
You could make it simple and have a check box to switch between two template strings. For example you can pick either by Id or by Name. Or you could make it very flexible and allow the administrator to enter the template string in a text field. Some examples
"$(userid)" displays as wrh2
"$(FirstName)$(LastName)" displays as Ryan Holliday
"$(LastName),$(FirstName) ($(userid))" displays as Holliday, Ryan (wrh2)
"$(LastName),$(FirstName) (?(userid))" displays as Holliday, Ryan unless there is a duplicate Holliday, Ryan in which case it displays as above
This would allow an administrator to format it however they want. Either way, by default it would be user name. j_teer 09-Jan-2009 12:23 PST
The new custom signatures for JAMWiki 0.7.0 work very similar to the solution you proposed - if/when the ability to use non-logins on history page is implemented it wouldn't be hard to do something similar there. -- Ryan • (comments) • 12-Jan-2009 19:35 PST

[Edit]File Links with Spaces

I'm creating an internal website and am new to jamwiki. Attempting to link to existing internal files [File://], but folders and file names have spaces. Is there a way to get around the spaces for File links. I tried + and %20, but those must only work with external links.

I believe that this is the same issue as this bug report. I will try to get it fixed for the next release. Thanks for the feedback! -- Ryan 09-Jan-2009 07:20 PST

[Edit]File Links

I have a similar problem accessing files links that belong to a network and local drive. I have tried by putting the internal URL link File://device/path/fileName, and I was surprised to see that it doesn't work with firefox but it does work with explorer. This link http://kb.mozillazine.org/Links_to_local_pages_don%27t_work#Firefox_1.5.2C_Mozilla_1.8.2C_and_newer gives some solutions that require firefox extensions. Is there any other known solution for this issue?

12-Jan-2009 Alessandra


[Edit]H2 database

tapaya 28-Jan-2009 11:49 PST

Currently running Windows XP / Tomcat 6.0 / HSQLDB (internal db) / Sun JDK 1.4 / JAMWiki 0.6.7.
I tried to move from the internal HSQLDB to a H2 database, so I did the following:

  1. copied h2-1.1.107.jar to C:\Programme\Apache Software Foundation\Tomcat 6.0\webapps\jamwiki-war-0.6.7\WEB-INF\lib\
  2. configured JAMWiki such that the jamwiki.properties contained the following:
    ...
    database-type=org.jamwiki.db.AnsiDataHandler
    db-password=
    db-user=sa
    dbcp-max-active=10
    dbcp-max-idle=3
    dbcp-min-evictable-idle-time=600
    dbcp-num-tests-per-eviction-run=5
    dbcp-test-on-borrow=true
    dbcp-test-on-return=true
    dbcp-test-while-idle=true
    dbcp-time-between-eviction-runs=120
    dbcp-when-exhausted-action=2
    default-topic=StartingPoints
    driver=org.h2.Driver
    ...
    homeDir=C\:\\Programme\\Apache Software Foundation\\Tomcat 6.0\\webapps\\jamwiki-war-0.6.7\\JAMWiki-Systemdateien
    ...
    persistenceType=DATABASE
    print-new-window=true
    props-initialized=true
    ...
    url=jdbc\:h2\:tcp\://localhost/~/../../Programme/Apache Software Foundation/Tomcat 6.0/webapps/jamwiki-war-0.6.7/JAMWiki-Systemdateien/h2/jamwiki
    use-preview=true
    use-spam-filter=true
    user-handler=org.jamwiki.db.DatabaseUserHandler
    ...
    
  3. re-started Tomcat
  4. started H2
  5. pointed my browser at http://localhost:8148/jamwiki-war-0.6.7/en/
  6. --> error message javax.servlet.jsp.JspException: java.lang.Exception: Failure while executing select * from jam_virtual_wiki

What was I missing?
Can anyone provide step-by-step instructions on how to use H2 database?

You would either need to do a fresh install with H2 (delete your old jamwiki.properties file) or else migrate the data from your old setup using the database migration tool on Special:Maintenance; the approach outlined above will assume that all tables already exist in the database, which won't be the case for a new instance. Note that the migration tool is experimental, so while it should work any bug reports would be appreciated. -- Ryan • (comments) • 28-Jan-2009 12:57 PST
I tried what you said (this time on my Mac): I set up a fresh JAMWiki including the .../apache-tomcat-6.0.18/webapps/jamwiki-war-0.6.7/WEB-INF/lib/h2-1.1.107.jar. The first access now yields "... Failure while executing CREATE UNIQUE INDEX jam_u_wuser_login on jam_wiki_user (lower(login)) ..." (cp. screenshot). What now? -- tapaya 28-Jan-2009 14:10 PST

Thanks for re-trying. If you're willing to continue help debugging, any error message & stack trace from your log files (the default log file path is shown at the bottom of your screenshot) would be helpful. Others have had success installing with H2, so there is either something unique about your setup or else there is an unresolved H2 bug that simply hasn't affected others. -- Ryan • (comments) • 28-Jan-2009 14:44 PST
Back at work on my Windows machine I noticed that the error message is different than on the Mac; whatever, here's the last entries in the jamwiki.log.0:
2009-01-29 09:08:24,504 SEVERE: org.jamwiki.jsp - Error in JSP page
javax.servlet.jsp.JspException: java.lang.Exception: Failure while executing select * from jam_virtual_wiki
...
...
...
Caused by: org.h2.jdbc.JdbcSQLException: Tabelle JAM_VIRTUAL_WIKI nicht gefunden
Table JAM_VIRTUAL_WIKI not found; SQL statement:
select * from jam_virtual_wiki [42102-107]
        at org.h2.message.Message.getSQLException(Message.java:103)
        at org.h2.message.Message.getSQLException(Message.java:114)
        at org.h2.message.Message.getSQLException(Message.java:77)
        at org.h2.command.Parser.readTableOrView(Parser.java:4245)
        at org.h2.command.Parser.readTableFilter(Parser.java:973)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1504)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1601)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1498)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1343)
        at org.h2.command.Parser.parseSelect(Parser.java:1331)
        at org.h2.command.Parser.parsePrepared(Parser.java:392)
        at org.h2.command.Parser.parse(Parser.java:288)
        at org.h2.command.Parser.parse(Parser.java:260)
        at org.h2.command.Parser.prepareCommand(Parser.java:232)
        at org.h2.engine.Session.prepareLocal(Session.java:406)
        at org.h2.engine.Session.prepareCommand(Session.java:367)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1048)
        at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:71)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
        at org.jamwiki.db.DatabaseConnection.executeQuery(DatabaseConnection.java:169)
        ... 72 more

So it seems like the JAM_VIRTUAL_WIKI table doesn't exist; I was under the impression that any tables be created when first accessed ... -- tapaya 29-Jan-2009 00:31 PST

The JAMWiki setup process is triggered when no jamwiki.properties file is found - the error above looks like a wiki with an existing setup was used on a new database - let me know if that's incorrect. The screenshot posted yesterday looks like a failure during setup with H2, which may be a bug - there have been numerous reports of successful setups with H2, but it's not a database that I've ever used so I can't personally confirm whether there might be any issues with that database. If there are logs available that report the specific failure (the logs will contain the error from the database) then it might be easier to determine if the problem is a JAMWiki bug, a database configuration error, a security/permission error, etc. -- Ryan • (comments) • 29-Jan-2009 08:13 PST
You're right, when I remove the existing jamwiki.properties and go through the initial JAMWiki setup with H2 again, I always get the very error message from my screenshot. I hope my jamwiki.log.0 will shed some light on this! --tapaya 30-Jan-2009 00:55 PST
Thanks, the log is hugely helpful. It doesn't show any configuration errors, but for some reason it's unable to execute this line in the /WEB-INF/classes/sql.ansi.properties file:
CREATE UNIQUE INDEX jam_u_wuser_login on jam_wiki_user (lower(login))
The specific database error message is:
Syntax Fehler in SQL Befehl CREATE UNIQUE INDEX JAM_U_WUSER_LOGIN ON JAM_WIKI_USER (LOWER([*]LOGIN))  ; erwartet )
Syntax error in SQL statement CREATE UNIQUE INDEX JAM_U_WUSER_LOGIN ON JAM_WIKI_USER (LOWER([*]LOGIN))  ; expected ); SQL statement:
CREATE UNIQUE INDEX jam_u_wuser_login on jam_wiki_user (lower(login))  [42001-107]
I suspect that your version of H2 may not support using "lower" as a unique key, but I'll need to check the provided error code (42001-107) and investigate further. If you have time you can try changing that line in your /WEB-INF/classes/sql.ansi.properties file to the following and re-testing:
CREATE UNIQUE INDEX jam_u_wuser_login on jam_wiki_user (login)
One additional question - what version of H2 are you using? I'm surprised that others have not hit this issue, so I'm wondering if you have an older version. I'll look into this further this weekend, thanks for all of your patience. -- Ryan • (comments) • 30-Jan-2009 07:03 PST
I tried what you said, now the error message is different. I'll attach my jamwiki.log.0 again. I'm using the latest version of H2 (1.1.107). --tapaya 30-Jan-2009 08:05 PST
Thanks again. The message this time is:
NULL nicht zulssig fr Feld REMEMBER_KEY
NULL not allowed for column REMEMBER_KEY [90006-107]
I'm not sure why that would ever happen, so I'll need to try to replicate this weekend. Thank you very much for your patience. -- Ryan • (comments) • 30-Jan-2009 08:12 PST
I installed H2 today and got the errors you've indicated when I chose the "ANSI" database. Choosing "HSQL" worked, however - I'll update JAMWiki 0.7.0 to add a separate option for H2 that uses the HSQL configuration. Thanks for all of your help in debugging. -- Ryan • (comments) • 31-Jan-2009 22:34 PST
Could you please outline all the steps you've taken to get it working (I'm still getting errors when choosing HSQL)? And please let me know about your software setup! I'm especially wondering whether you start H2 on JAMWiki access or in a separate JVM. Thanks for all you help! --tapaya 02-Feb-2009 00:51 PST
First I installed the JAMWiki 0.6.7 WAR file. I had done some earlier tests with H2 so I shutdown the H2 server, cleared out the old H2 database files from my home directory, and then restarted H2 from the command prompt. Next I copied the "h2-1.1.107.jar" file to my /WEB-INF/lib directory, then started the app server (Tomcat), viewed the http://localhost/wiki/ page to start the setup process, and chose "HSQL" as the database type and used "org.h2.Driver" as the JDBC driver and "jdbc:h2:tcp://localhost/~/jamwiki" as the URL. After that the setup proceeded as normal. I also updated the 0.7.0 code to add a database option specifically for H2, and setup with H2 using that option that worked as well. This was all done on a Windows Vista laptop using Tomcat. Hope that helps! -- Ryan • (comments) • 02-Feb-2009 07:49 PST
Finally, I've got it all running! I wasn't aware that one must provide an administrator password. I've written up the steps I'd taken here. Thanks again for your help, Ryan! --tapaya 03-Feb-2009 03:25 PST
Glad it's working, and thanks for being so patient! Would it be OK if I moved the configuration information to Installation#Database Configuration? You've done a great job with the writeup and I suspect it will be very helpful to others. -- Ryan • (comments) • 03-Feb-2009 07:37 PST
It would be great if you put my writeup some place where everybody can find it quickly! Thanks! --tapaya 03-Feb-2009 15:11 PST

[Edit]H2 migration failure

I tried to move my wiki from the internal HSQLDB to a H2 (cp. Installation#H2). This worked fine with a fresh JAMWiki installation with no user data. But now that my database (jamwiki.data) has grown for some time it fails with the error message Referential integrity constraint violation: JAM_F_CAT_CHILD_ID: PUBLIC.JAM_CATEGORY FOREIGN KEY(CHILD_TOPIC_ID) REFERENCES PUBLIC.JAM_TOPIC(TOPIC_ID) [23002-107] (here's the entire jamwiki.log.0). Looks like a bug in the database migration code, right? --tapaya 04-Feb-2009 02:09 PST

I'll need to update the documentation - migration will only work on an empty JAMWiki database (no users, no setup, etc). Once there is data in a database then migration will fail as it will be trying to do things that are not allowed, such as copying topics that have the same IDs or creating users when users with the same login already exist. Actually, looking at the log you've uploaded it does appear that there is a problem - there is a relationship between topics and versions that is failing. I'll investigate. -- Ryan • (comments) • 04-Feb-2009 07:39 PST
I am unfortunately not going to have much time to devote to JAMWiki this weekend - is it critical that you complete a migration soon, or can it wait a while? Currently the migration option is labeled "experimental" because it was contributed by another developer and I have not researched it closely or built any unit tests for it. My plan was to re-visit this functionality during the JAMWiki 0.8.x cycle, but I'm more than happy to look into it more closely in the coming week or two if it will help you out. -- Ryan • (comments) • 05-Feb-2009 20:41 PST
It would be really nice to migrate to H2 asap, because I'm evaluating things here. However, as a workaround I could seek for a way to run 2 separate instances of JAMWiki concurrently (maybe 2 Tomcat instances?). Any thoughts? --tapaya 06-Feb-2009 04:55 PST
The issue appears to be the order in which tables are created during migration in JAMWiki 0.6.7 - the code is trying to populate the category table before the topic table is populated. I've already fixed this for 0.7.0 but am doing additional testing now to verify that there aren't any other issues. As a result, this isn't something that can be fixed without waiting for the new release. However, running two instances of JAMWiki concurrently (your second option above) is very easy - simply set up two separate applications on your Tomcat server. For example, on this server I run both jamwiki.org and a personal server. jamwiki.org is deployed under /wiki/ while my personal version is deployed as a separate application. Hopefully this solution will work for you. Thanks again for the testing and bug reports. -- Ryan • (comments) • 08-Feb-2009 19:54 PST
Now that was easy: I basically unpacked the jamwiki WAR file in tomcat's webapps folder a second time and named it differently ("wiki") ... and there's my second JAMWiki instance! I just put a link in there to the old (HSQLDB based) instance and made the old wiki read-only (i.e. changed role permissions) and I'm all set. Of course, this is only a workaround (migrating the old stuff would still be more elegant and comfortable) but it works ... Thanks a lot, Ryan! --tapaya 09-Feb-2009 02:32 PST
revision 2468 should resolve the remaining migration issues - with these changes I'm now able to successfully migrate the full jamwiki.org history to H2; before these updates I was getting various database and out of memory errors. The fixes will be included in JAMWiki 0.7.0. -- Ryan • (comments) • 09-Feb-2009 21:53 PST

[Edit]adding a custom banner

I want to put a custom banner across the top of my wiki. I have searched everywhere and tried updating the css but I can not work out how to do this. Is this feature supported? If so, how can i do this?

There is no built-in support for that feature. Your best option is probably to update the /WEB-INF/jsp/wiki.jsp file and the StyleSheet topic to get the look that you want. Hope that helps! -- Ryan • (comments) • 05-Feb-2009 20:38 PST

[Edit]Mention File System Links in Documentation

IMHO Wiki Syntax#Links should mention that one can not only link to HTTP sites but also to the file system (at least on Windows and provided that the browser settings allow it):

What it looks like What you type
file:///C:/link/to/some/file/or/folder
[file:///C:/link/to/some/file/or/folder]

--tapaya 17-Feb-2009 07:50 PST

If you're willing to make the necessary updates I'd be grateful for any help with documentation, otherwise I'll try to update it next time I have a chance. Thanks for pointing this out. -- Ryan • (comments) • 17-Feb-2009 21:28 PST

[Edit]User Roles Problem

I am trying to use the user roles feature (just the standard one supplied by jamwiki - no external database, ldap etc yet) but i dont seem to be able to add a role to a user. When i use the Search for a user in the Roles page it never finds any user, except the admin user ( which is the user i am logged in as , so maybe is filtering on current user or something). I have upgraded to 0.7.0 so i dont know if this is a bug in the beta - or if i am just doing something wrong (i havent used the user roles before).

This feature seems to be working on jamwiki.org, but it's entirely possible that there may be a bug somewhere - could you let me know the user name you're searching for? Searching for something like "w" or "wrh2" both find my user on jamwiki.org as well as any similar users, so I'd be interested in knowing exactly how to reproduce this issue. Thanks for the feedback! -- Ryan • (comments) • 25-Feb-2009 18:31 PST
I am just starting to get into the user security stuff, so I have the admin user - admin, plus rebecca, rebeccac, and jamesw. I go to the jamwiki-war/en/Special:Roles , go to the section Search for users by login: and enter rebecca and hit search. Nothing comes up. (although same problem which ever user i search for except admin, which works).
When i go to jamwiki-war/en/Special:Listusers i get the following list:
  1. User:admin
  2. User:jamesw
  3. User:rebecca
  4. User:rebeccac
Thanks, that's helpful! I'll have to investigate further, hopefully tomorrow evening. -- Ryan • (comments) • 25-Feb-2009 22:21 PST
The fix mentioned below (changing sql.ansi.properties) solved this problem. It seems to be working fine now.
Thanks for the confirmation! I'm currently out of the country (but getting surprisingly good wireless!) so a 0.7.1 bugfix release may have to wait until I return, but I'll try to get any fixes that are ready rolled into a release by the end of the month. -- Ryan • (comments) • 08-Mar-2009 22:42 PDT

[Edit]Page based permissions

I can't find any easy way to set up permissions per page (jamwiki 0.7.0). I looked at the spring security, i am just trying to get the hang of it, but i think i understand how to set the roles for a page but not really how to allow all users to view all pages, and all users to edit by default, but only allow some users to edit particular pages.

I guess one way would be to set the filter to :

<intercept-url pattern="/**" access="ROLE_VIEW" />
<intercept-url pattern="/**/Special:Edit" access="ROLE_EDIT_EXISTING,ROLE_EDIT_NEW" />
<intercept-url pattern="/**/Special:Edit?topic=SpecialPage1" access="ROLE_SPECIAL_EDIT" />
<intercept-url pattern="/**/Special:Edit?topic=SpecialPage2" access="ROLE_SPECIAL_EDIT" />
<intercept-url pattern="/**/Special:Edit?topic=SpecialPage3" access="ROLE_SPECIAL_EDIT" />

Is this the right way to do it (I am the person above with the user roles problem so i can't test it at the moment (as i can't assign any new roles to users) but is this the right idea or is there a better way to do this? It seems a bit painful if there are a lot of pages - is there a way to group the pages together?

From the "manage" tab you can mark pages as admin-only or read-only, but you're right that finer-grained permissions currently require Spring Security configuration. The order that filters are defined matters, so define the least specific filters ("/**") last. Also, you can use wildcards to simplify things, so instead of the three Edit patterns specified you could do:
<intercept-url pattern="/**/Special:Edit?topic=SpecialPage*" access="ROLE_SPECIAL_EDIT" />
A simpler approach might be to protect within a subdirectory, such as:
<intercept-url pattern="/**/Special:Edit?topic=Special/*" access="ROLE_SPECIAL_EDIT" />
I'm not sure if that fully answers your questions, so let me know, and thanks for the feedback! -- Ryan • (comments) • 25-Feb-2009 22:25 PST
This didn't work, but i guess jamwiki doesn't use the spring security by default. What do i have to do to 'turn on' the spring security system? (sorry i really a newbie to this stuff)
Spring Security is definitely used by default, so you shouldn't have to "turn on" anything. If you'd like you can upload your applicationContext-security.xml file and I can take a look, although please wait until after 7:00 PM Pacific time to do so - one of my co-workers pointed out the fact that there is a bug in the current code that breaks non-image uploads, and I haven't yet pushed the fix to jamwiki.org. -- Ryan • (comments) • 26-Feb-2009 07:10 PST
Have you actually tested that this works. I played around with the applicationContext-security.xml file for a while and found some weird behaviour.
I restored the original file from the jamwiki-war. When I changed the permissions for edit to :
<intercept-url pattern="/**/Special:Edit" access="ROLE_SYSADMIN" />
This worked - I was logged in as rebecca - a user with edit role but not sysadmin, whenever i tried to edit a page i was asked to log in (although i think better behaviour would be to say permission denied considering i was already logged in - but anyway that is less of a big deal). Then i added the * after the Edit to make sure that the wild character was working. like this:
<intercept-url pattern="/**/Special:Edit*" access="ROLE_SYSADMIN" />
Same behaviour as above. Then I added the question mark like this :
<intercept-url pattern="/**/Special:Edit?*" access="ROLE_SYSADMIN" />
And it no longer worked - i was not asked to log in and was allowed to edit.
So is it possible the question mark is causing problems - is it a special character? Do i need to somehow escape the question mark? I tried the standard backslash escape ("/**/Special:Edit\?*") but that didn't work.
Update - I have been looking around and found that in the http element adding path-type="regex" (it uses ant by default) should support more flexible pattern matching in the intercept-url, but when i set the path type to regex, i get an exception in catalina.out and the app doesn't load. Will investiage further and put up any answers i find.

Looks like you're right - Spring Security won't match against query parameters using ANT pattern matching, so you have to change the ANT patterns to regular expressions. The following works for me:


	<http auto-config="false" entry-point-ref="authenticationEntryPoint" path-type="regex">
		<intercept-url pattern="/(.)+/Special\:Edit(.)+StartingPoints" access="ROLE_NEW_ROLE" />
		<intercept-url pattern="/(.)+/Special\:Admin" access="ROLE_SYSADMIN" />
		<intercept-url pattern="/(.)+/Special\:Edit" access="ROLE_EDIT_EXISTING,ROLE_EDIT_NEW" />
		...
	</http>

When I run this locally it isn't redirecting me to the login page on error - instead I get sent to a generic 403 error page - so that's something that needs to be fixed, but otherwise I think it's working as expected. Thanks for your patience! -- Ryan • (comments) • 26-Feb-2009 18:56 PST

Great, got it working now. Thanks for your help. I'll look into the sign sign on stuff now.

A quick note - while investigating the above issues it turns out that for non-logged-in users the system properly redirects to the login page when access is denied. For loggged-in users a generic 403 error is thrown, so I need to add some sort of handling for that. I need a bit of sleep first, but will investigate shortly. -- Ryan • (comments) • 26-Feb-2009 19:31 PST

Update - the access denied issue should be fixed by revision 2482. I need to test this on an app server other than Tomcat, and provided all is well I'll then push out JAMWiki 0.7.0. -- Ryan • (comments) • 28-Feb-2009 00:21 PST

[Edit]Single Sign On

I am looking into having a single sign on /shared authentication happening with my web site (intranet and wiki working together) They are running under the same tomcat and i saw the following comment.

"It should be easy to set up Tomcat 6 and jamwiki for single login, and to assign the wikis to different domains with simple URLs."



But I dont really have any idea how to do this - I am new to web development. I had a bit of a read about realms and the tomcat single sign on valve but i couldn't get it to work - looks like the spring security stuff bypasses the normal security-contraint thing that tomcat realms use.... Any ideas, tips, nudges in the right direction would be helpful (I'd even be happy to have my intranet use the Jamiwiki authentication system ... )

(Sorry to flood you with questions - i saw you said you are going on holidays and just wanted to get a point in the right direction before you go - if i get it all working i'll write up the process here somewhere)

OpenID, LDAP and CAS authentication are all supported by Spring Security 2.0. I'm less sure about Tomcat realms... depending on how much time I have I'll see if I can do some investigation this evening. -- Ryan • (comments) • 26-Feb-2009 07:12 PST

[Edit]__NOEDITSECTION__ not working

The __NOEDITSECTION__ magic word isn't implemented in JAMWiki yet (although the help pages mention it), right? I'd wish to make sections in pages created with templates not editable, because any inserts there be dropped anyway. I assume there's currently no way to achieve this. To see what I mean consider these two example pages:

    Template:MyExample:
__NOEDITSECTION__
== Ziel ==
{{{Ziel}}}
== Akteure ==
{{{Akteure}}}

    Sample page:
{{MyExample
| Ziel=poiu
| Akteure=qwer
}}

--tapaya 02-Mar-2009 14:39 PST

Yeah, at present __NOEDITSECTION__ is not implemented - feel free to update the help pages as needed, as they don't make it clear for this magic word. If you have a critical need for it I can investigate the feasibility of getting it into the next release - just let me know. -- Ryan • (comments) • 02-Mar-2009 15:06 PST
Chances are that my company will employ JAMWiki for a specific intranet application based on "forms" implemented with templates. I think __NOEDITSECTION__ would make our JAMWiki interface more straightforward thus increasing the chance that we'll actually go for it. --tapaya 03-Mar-2009 00:57 PST
Thanks, I'll investigate how difficult it would be to add this parameter - give me a couple of days. -- Ryan • (comments) • 03-Mar-2009 07:15 PST

[Edit]Access denied page configurable?

I have been looking around and i can't see that it is - it looks like it has been hard coded to redirect to Special:login - but maybe there is something I haven't found? If it isn't configurable i think it should be - I am using CAS, so I dont want users redirected to the wiki login page as that is useless, and in fact I dont really want the logged in users to be redirected to a login page at all - maybe just a generic permission denied page.

For now i guess i'll change the 403.jsp but it would be nice to have a config param for this.

At the moment you can modify it via the /WEB-INF/web.xml <error-page> parameter, which may help. I'll see if it's possible to make this functionality a bit more flexible, but please remind me if there aren't any updates to this discussion in the next few days as I'll be traveling. Thanks for pointing this issue out. -- Ryan • (comments) • 21-Mar-2009 18:26 PDT

[Edit]Configure time to auto log-out

Where would I set the time till the logged in user be automatically logged out? --tapaya 24-Mar-2009 01:15 PDT

JAMWiki should use the session timeout configured for the application server. To increase that you can either modify your application server's default settings or you can try adding the following to the /WEB-INF/web.xml file:

  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>

... where "30" is the timeout in minutes. -- Ryan • (comments) • 24-Mar-2009 06:11 PDT

[Edit]Templates i.e. Infoboxes and introduction of advanced extensions i.e. iframe

I realise that the last update on template similar to Mediawiki functionality was done in early 2008. Have there been any updates on the Mediawiki Parser and is there anyway to have the ability to introduce "iframe" either via HTML / Javascript.

Maybe its there but I just havent seem to be able to work it out just yet.

-- User:Jon • (comments) • 25-Mar-2009 16:11 EST

Most releases contain some updates to improve the parser and add additional Mediawiki compatibility, for example JAMWiki 0.7.0 contained a number of changes to allow nested templates, to improve support for magic words, and to fix some Mediawiki incompatibilities. As to iframes, currently JAMWiki won't support those, but if support is available in Mediawiki then please feel free to add a feature request, preferably with a pointer to any information about how Mediawiki supports this feature. Alternatively, if Mediawiki doesn't support iframes then there is a long-term plan to allow JAMWiki site admins to configure which HTML tags are allowed, although that feature may still be some ways away from implementation. -- Ryan • (comments) • 25-Mar-2009 11:28 PDT

[Edit]Commercial usage

I've been trying to find anywhere that points towards JAMWiki being available for commercial use. I know a firm that has been charging for JAMWiki to install and maintain. I am unsure on what is allowed and what isnt. The system does not indicate anything regarding JAMWiki and only noticed it when looking through the logs once, as there were no references to JAMWiki on the wiki frontend itself

--JJ 31-Mar-2009 07:57 PDT

JAMWiki is licensed under the LGPL license - the terms of that license are at http://www.gnu.org/licenses/lgpl.html, and a summary version is available at https://cajo.dev.java.net/license.html. Provided a company is following the terms of that license then they are welcome to charge for and redistribute the code. If the company in question has modified the code and not made those modifications available to download freely then that would be a concern. Similarly, if they have removed attributions that might also be a concern. I know that there are a number of products out there that have chosen to integrate JAMWiki into their code and most do so in full compliance with the license, but if some of them are violating license terms it would be good to know about it so that I could get in touch with them. Thanks for the info! -- Ryan • (comments) • 31-Mar-2009 08:14 PDT

[Edit]Move topic missing?

I cant seem to find a way to move a topic. I searched this site and found some references to the Move tab, but I can't see it anywhere. Is it possible this is broken in the new release ? maybe I just can't find it?

It works for me locally and on jamwiki.org - the "Move" tab appears at the top of the page between "History" and "Watch". It's possible that the "move" permission has been removed - check the Special:Roles page on your wiki and verify that the appropriate group and/or user has the "ROLE_MOVE" permission. -- Ryan • (comments) • 05-Apr-2009 20:31 PDT
Thanks fixed it. I was using my own permission database and didnt have the MOVE permission in there.

[Edit]Deleted GROUP_ANONYMOUS

We managed to remove the GROUP_ANONYMOUS (somehow...) and now we cant see to find a way to get it back.

We were playing around with the Group type settings as we are trying to implement a 3 tier system of access to 2 namespace sections of information.

  1. First group has read access to Namespace 1 only (this could be anonymous users i guess)
  2. Second group has read/write access to Namespace 1 and read access to Namespace 2
  3. Third group has read/write access to everything.

Are we going about this the right way? Or is there some other way to this more effectively?

  • Sorry to be confusing, we really only need to recover the GROUP_ANONYMOUS bit, I think our other permissions will be sorted out differently.
Did you delete it from your database? You can probably just re-insert the record if necessary:
insert into jam_group ( \
      group_id, group_name, group_description \
    ) values ( \
      1, 'GROUP_ANONYMOUS', 'All non-logged in users are automatically assigned to the anonymous group.' \
    )
You may then need to restart the app server for the change to take effect. Let me know if the problem is more complex. -- Ryan • (comments) • 14-Apr-2009 17:36 PDT

Ok I think I've worked out the problem - it seems that when I removed all privileges from a category it disappeared from the list to re-assign privileges. The entry was still there in the db, so I just assigned it a single permission and it re-appeared in the GUI - thanks for the quick response.

Are you on JAMWiki 0.7.0? There was a bug (fixed in 0.7.1) that prevented roles and groups from appearing when there were no permissions assigned. It should be working now, but if there are still issues please let me know. -- Ryan • (comments) • 14-Apr-2009 20:34 PDT

[Edit]subst tag

Are there any plans to implement the subst tag (to use with templates) in the near future?

Could you add this request to the Feature Requests page? I've been meaning to add it for some time, but as there weren't many people asking for this functionality it has repeatedly gotten deferred. Thanks! -- Ryan • (comments) • 19-Apr-2009 14:59 PDT

[Edit]Howto change the JAMWiki Logo ??

Having my own fresh instance of JAMWiki running, I am constantly looking for information on this wiki. But this and mine look all alike. If I cound change the logo there would be far less danger of mixing them up and making changes to the wrong one. 95.112.143.34 19-Apr-2009 13:12 PDT

Have a look at Configuration, which covers most of the configurable settings for the wiki. The logo can be changed from the third field on Special:Admin. If there is a better / more obvious way to document this functionality any feedback is appreciated, or if you're willing feel free to directly edit the pages in question. -- Ryan • (comments) • 19-Apr-2009 14:55 PDT

[Edit]WYSIWYG / 0.8.0

When do you expect Ronins WYSIWYG editor to be integrated?? aka when is 0.8.x being released?

Ronin's FCKEditor code installs and runs without generating errors for me, but for some reason the Javascript doesn't seem to be initializing and thus no edit functionality is available, so until that gets resolved it won't be integrated. I'd definitely like for this functionality to be included in 0.8.0, so odds are good it will eventually get completed. As to when 0.8.0 is ready, I'm a bit hesitant to commit to a release schedule, although I was hoping it wouldn't take much longer than six months after the release of 0.7.0 until 0.8.0 was out. There's a lot of good stuff already committed on trunk, so it's conceivable that the goals for 0.8.0 will be scaled back and a release will go out around August with whatever is ready - take that with a HUGE grain of salt though as JAMWiki releases have always taken longer than expected. -- Ryan • (comments) • 11-May-2009 18:36 PDT

[Edit]Need help with LDAP setup

I configured the LDAP setup in applicationContext-security.xml. I can successfully authenticate with this configuration but I am not authorized to do anything. Also, with this setup I can no longer login as the admin user I created at setup time. I'd like anonymous users to not be able to view or edit anything and users authenticated via LDAP to be able to do anything. Please Help.

Make sure your LDAP system is assigning ROLE_ADMIN to your admin user login. In addition, all of the roles specified on Special:Roles must be assigned to users via LDAP... if your LDAP system is using different roles simply create new roles from the Special:Roles interface. Hope that helps! -- Ryan • (comments) • 11-May-2009 18:46 PDT

ok here's what I did for anyone following. FWIW, I'm using openLDAP. I created an organization unit "ou=jamwiki,ou=groups,dc=example,dc=com". I then created the following groups underneath the jamwiki ou (ADMIN, EDIT_EXISTING, EDIT_NEW, MOVE, SYSADMIN, TRANSLATE, UPLOAD, VIEW). Then I modified the applicationContext-security.xml as such:

<ldap-server id="ldapServer" url="ldap://localhost/dc=example,dc=com" port="389" manager-dn="cn=admin,dc=example,dc=com" manager-password="*********" />
<ldap-authentication-provider server-ref="ldapServer" group-search-filter="member={0}" group-search-base="ou=jamwiki,ou=groups" user-search-filter="uid={0}" user-search-base="ou=people" user-dn-pattern="cn={0},ou=people" />
<authentication-provider>
	<ldap-user-service server-ref="ldapServer" group-search-filter="member={0}" group-search-base="ou=jamiwiki,ou=groups" user-search-filter="uid={0}" user-search-base="ou=people" />
</authentication-provider>

I also set the "useJAMWikiAnonymousRoles" property to false in the applicationContext-security.xml Then restart server.

The best I can tell, the "built-in" GROUP_REGISTERED_USER does not apply when using LDAP, so you have to add every user to every group created above manually. I would like to find a way to have jamwiki utilize my existing LDAP "developer" group and somehow assign roles to the developer group. Any ideas how I might achieve that?

First, my knowledge of LDAP is limited and the initial JAMWiki integration was done using samples from the Spring Security examples. That said, I believe that the Spring LDAP integration should automatically pick up all groups, roles, etc that are assigned in your LDAP system, so if you configure LDAP with a permission of (for example) JAMWIKI_ADMIN and the modify /WEB-INF/applicationContext-security.xml to look for JAMWIKI_ADMIN that users who get that permission will be able to to access resources allowed by that permission. Also, as you've indicated, something like GROUP_REGISTERED_USER will no longer apply when using LDAP since the default authentication provider is no longer being used.
Does that help? If so then I'd like to use the information from this discussion to update Configuration#LDAP / CAS / OpenID so that hopefully this sort of integration will be easier for others in the future. -- Ryan • (comments) • 12-May-2009 21:33 PDT

I'll have to give that a shot in a test environment. I've already deployed using the setup I created


[Edit]File Uploads

I've set my file upload directory to be /opt/jamwiki-data/files I've set Relative File Upload Root to /jamwiki/upload/ I can upload files. Files make it into /opt/jamwiki-data/files. However, the links to the files give me 404. The link is to http://mydomain.com:8080/jamwiki/upload/2009/5/image.png. So I created a symlink in $GLASSFISH_HOME/domains/domain1/applications/jamwiki/upload to /opt/jamwiki-data/files but I still get 404 errors. Any idea what I can try.

This sounds like an app server issue rather than a JAMWiki issue. I use a similar setup to what you've described on jamwiki.org, with file uploads going to the Apache docroot, and I know a number of sites use this functionality without issue. Configuration#File upload settings has some information, but it sounds like you've got the JAMWiki configuration correct so I'd try to figure out if Glassfish is actually following the symlink. -- Ryan • (comments) • 13-May-2009 11:59 PDT

In case anyone suffers similar problem in glassfish. following symlinks is disabled in glassfish by default. You can enable this by editing glassfish domain.xml and allow symlink following. Find this section and add the allowLinking property as shown

	<virtual-server id="server" http-listeners="http-listener-1,http-listen......>
	  <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot" />
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/ac$....../>
	  <property name="sso-enabled" value="false" />
	  <property name="allowLinking" value="true" />
	</virtual-server>

[Edit]French Translation

Hello, is it possible to have access to translation tools in order to translate some text and fix some others. Regards Guillaume FRANCOIS 55 27-May-2009 06:29 PDT

Sure! Your account should now have access to the Special:Translation page, and I've updated the jamwiki.org translations with the files you uploaded. Let me know what name you'd like to use in the CREDITS file - most people use their name and jamwiki.org login such as "Ryan Holliday (wrh2)". Thanks for helping out! -- Ryan • (comments) • 27-May-2009 07:00 PDT
Thanks, I'm already using it. For name simply put "Guillaume FRANCOIS 55" ;-) Guillaume FRANCOIS 55 27-May-2009 07:10 PDT
revision 2594 adds your changes to Subversion for JAMWiki 0.7.2. Thanks again! -- Ryan • (comments) • 27-May-2009 10:33 PDT
I mostly updated everything. Have to used it now in order to spot small errors. Guillaume FRANCOIS 55 28-May-2009 02:34 PDT

[Edit]Recreate JamWiki 0.6.6 from One system to another

Hi, I have installed Jamwiki in one of my system. But that system is going to be formatted. So I need to move all the content to another system.I'm using External database(MySQL). Please help me how to recreate my portal as it is from my new system. I tried to map the MySQL schema(Existing one) while doing the setup but I'was getting Connection could not established. So I created a new schema in MySQL and given it while installing and JamWiki started working. But I could not get any of my old data. Please help me so that I can recover all pages/documents/images/etc as how it was early. Venkat

You should have two options:
  1. You can do a new install on the new system, and if you point to the existing database you will get a warning about "data already exists, new tables will not be created". If you choose to continue JAMWiki will then be set up to use the existing database. Even though the database should not be changed by this process I'd recommend backing up your data first.
  2. You can simply copy your existing JAMWiki webapp files to the new system, and then manually edit any paths in /WEB-INF/classes/jamwiki.properties that refer to the old system.
Hope that helps. -- Ryan • (comments) • 03-Jun-2009 10:13 PDT
I've written these steps out in slightly more detail at Installation#Migrating an Installation. -- Ryan • (comments) • 03-Jun-2009 13:09 PDT