[xwiki-users] configuration problem

2008-05-11 Thread project_trainees
Hi,

   I am using XE 1.3.2(stand alone) and i have to use Mysql 5.0. For that
I configured the hibernate.cfg and web.cfg but when i point my browser to
http://localhost:8080//xwiki/bin/view/main/webhome ,it shows error. Where
is my fault? can any one help?

Hibernate configuration

[config]

?xml version='1.0' encoding='utf-8'?
!DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate
Configuration DTD//EN
 
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
!-- Template for hibernate configuration. processing by maven using
profiles.
 Replace original src/main/webapp/WEB-INF/hibernate.cfg.xml --
hibernate-configuration
  session-factory

property name=show_sqlfalse/property
property name=use_outer_jointrue/property

property name=dbcp.defaultAutoCommitfalse/property
property name=dbcp.maxActive50/property
property name=dbcp.maxIdle5/property
property name=dbcp.maxWait3/property
property name=dbcp.whenExhaustedAction1/property
property name=dbcp.ps.whenExhaustedAction1/property
property name=dbcp.ps.maxActive20/property
property name=dbcp.ps.maxWait12/property
property name=dbcp.ps.maxIdle20/property


!-- MySQL configuration.
 Uncomment if you want to use MySQL and comment out other database
configurations.
 Note that the database will be created automatically if it
doesn't already exist.
 We need to set the sql_mode to a less strict value, see
XWIKI-1945  --
property
name=connection.urljdbc:mysql://localhost/xwiki?useServerPrepStmts=falseamp;sessionVariables=sql_mode=''/property
property name=connection.usernameroot/property
property name=connection.passwordamma/property
property
name=connection.driver_classcom.mysql.jdbc.Driver/property
property name=dialectorg.hibernate.dialect.MySQLDialect/property
property
name=connection.provider_classcom.xpn.xwiki.store.DBCPConnectionProvider/property
property name=connection.pool_size2/property
property name=statement_cache.size2/property
mapping resource=xwiki.hbm.xml/
mapping resource=feeds.hbm.xml/

/session-factory
/hibernate-configuration

[/config]


Web configuration
...

!-- Uncomment if you wish to use a DataSource to define the Database
connection  --
  resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/XWikiDS/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref

ERROR
.

Wrapped Exception:

java.sql.BatchUpdateException: null,  message from server: Data too long
for co
lumn 'XWD_MINOREDIT' at row 1
at
com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:
1404)
at
org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingSt
atement.java:294)
at
org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingSt
atement.java:294)
at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.jav
a:48)
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:
246)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)

at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)

at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
ns(AbstractFlushingEventListener.java:298)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
hEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java
:106)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHiber
nateBaseStore.java:783)
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHiber
nateBaseStore.java:754)
at
com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateSt
ore.java:447)
at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java
:97)
at
com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java
:91)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1083)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1056)
at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1050)
at com.xpn.xwiki.XWiki.getPrefsClass(XWiki.java:2653)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:797)
at com.xpn.xwiki.XWiki.init(XWiki.java:722)
at com.xpn.xwiki.XWiki.getMainXWiki(XWiki.java:293)
at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:491)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:123)
at
org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:431)
at

Re: [xwiki-users] configuration problem

2008-05-11 Thread Sergiu Dumitriu
Did you put the mysql-connectorlibrary in the lib folder?

Download 
http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.5/mysql-connector-java-5.1.5.jar
 
and put it in WEB-INF/lib

[EMAIL PROTECTED] wrote:
 Hi,
 
I am using XE 1.3.2(stand alone) and i have to use Mysql 5.0. For that
 I configured the hibernate.cfg and web.cfg but it shows error. Where is my
 fault? can any one help? Why No one responding? i am trying to do this as
 my curriculam project.
 
 Hibernate configuration
 
 [config]
 
 ?xml version='1.0' encoding='utf-8'?
 !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate
 Configuration DTD//EN
  
 http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
 !-- Template for hibernate configuration. processing by maven using
 profiles.
  Replace original src/main/webapp/WEB-INF/hibernate.cfg.xml --
 hibernate-configuration
   session-factory
 
 property name=show_sqlfalse/property
 property name=use_outer_jointrue/property
 
 property name=dbcp.defaultAutoCommitfalse/property
 property name=dbcp.maxActive50/property
 property name=dbcp.maxIdle5/property
 property name=dbcp.maxWait3/property
 property name=dbcp.whenExhaustedAction1/property
 property name=dbcp.ps.whenExhaustedAction1/property
 property name=dbcp.ps.maxActive20/property
 property name=dbcp.ps.maxWait12/property
 property name=dbcp.ps.maxIdle20/property
 
 
 !-- MySQL configuration.
  Uncomment if you want to use MySQL and comment out other database
 configurations.
  Note that the database will be created automatically if it
 doesn't already exist.
  We need to set the sql_mode to a less strict value, see
 XWIKI-1945  --
 property
 name=connection.urljdbc:mysql://localhost/xwiki?useServerPrepStmts=falseamp;sessionVariables=sql_mode=''/property
 property name=connection.usernameroot/property
 property name=connection.passwordamma/property
 property
 name=connection.driver_classcom.mysql.jdbc.Driver/property
 property name=dialectorg.hibernate.dialect.MySQLDialect/property
 property
 name=connection.provider_classcom.xpn.xwiki.store.DBCPConnectionProvider/property
 property name=connection.pool_size2/property
 property name=statement_cache.size2/property
 mapping resource=xwiki.hbm.xml/
 mapping resource=feeds.hbm.xml/
 
 /session-factory
 /hibernate-configuration
 
 [/config]
 
 
 Web configuration
 ...
 
 !-- Uncomment if you wish to use a DataSource to define the Database
 connection  --
   resource-ref
   descriptionDB Connection/description
   res-ref-namejdbc/XWikiDS/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref
 
 
 HTTP ERROR: 500
 
 Error number 3 in 0: Could not initialize main XWiki context
 Wrapped Exception: Error number 3201 in 3: Exception while saving document
 XWiki.XWikiPreferences
 Wrapped Exception: Could not execute JDBC batch update
 
 RequestURI=/xwiki/bin/view/main/webhome
 
 Regards,
 Project trainees.
 

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] conditional sizing

2008-05-11 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Hi all,

I've frequently facing a problem when facing images inserted in XWiki 
documents. It is by not means a XWiki specific issue, but I would like 
to post it here to see if others have some idea about how to solve it.

It is far easy to insert an image in a XWiki document by using the image 
macro. It is also possible to control hight and width by passing these 
parameters to the macro. But when users are allowed to upload pictures 
and it is not possible to control the properties of the uploaded files, 
it is frequent that some pictures doesn't fit a required width when a 
height is fixed, or viceversa.

Could you figure out how could I set image dimensions taking into 
account the originally attached file size?

Thanks for your insight!

Greetings,

Ricardo

-- 
Ricardo Rodríguez
Your EPEC Network ICT Team

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] ldap auth against active directory fails

2008-05-11 Thread werner mueller
hallo

well i am a little stuck. i cant make it work although i copied the
settings from a working example (well another tool but the same
servers). i can only get to 'invalid credentials'

does the server need to be in the same domain as the active directory to
use the bind_DN=subdomain\\{0} bind schema? the server is a linux
machine and is not added to the windows domain.

is there a unit test or little tool or something one could use for
testing? its a little weird its not working.


thanks for any ideas :)
regards

werner




Thomas Mortagne schrieb:
 You can enable debug logging, see
 http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Logging
 
 On Wed, Apr 30, 2008 at 1:54 PM, werner mueller
 [EMAIL PROTECTED] wrote:
 Hallo

  thanks for the quick reply.

  well the config should work then :/
  i compared it with the bugzilla / subversion config which uses the same
  ldap / active directory auth. the only difference is that they
  distinguish the bind user with the user to be authenticated. but in my
  case even the bind user cannot login.


  2008-04-30 13:44:34,891
  [http://dev.edoras.ch:8080/xwiki/bin/loginsubmit/XWiki/XWikiLogin]
  [http-8080-Processor24] WARN  LDAP.XWikiLDAPAuthServiceImpl   - LDAP
  authentication failed.

 com.xpn.xwiki.plugin.ldap.XWikiLDAPException: Error number 0 in 5: LDAP
  bind failed with LDAPException.
  Wrapped Exception: Invalid Credentials
  at
  
 com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection.open(XWikiLDAPConnection.java:178)
  at
  
 com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection.open(XWikiLDAPConnection.java:109)
  at
  
 com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:194)
  at

 com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:107)
  .

  Wrapped Exception:


  LDAPException: Invalid Credentials (49) Invalid Credentials
  LDAPException: Server Message: 80090308: LdapErr: DSID-0C090334,
  comment: AcceptSecurityContext error, data 525, vece
  LDAPException: Matched DN:
  at com.novell.ldap.LDAPResponse.getResultException(Unknown Source)
  at com.novell.ldap.LDAPResponse.chkResultCode(Unknown Source)
  at com.novell.ldap.LDAPConnection.chkResultCode(Unknown Source)
  at com.novell.ldap.LDAPConnection.bind(Unknown Source)
  at com.novell.ldap.LDAPConnection.bind(Unknown Source)
  at
  
 com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection.open(XWikiLDAPConnection.java:170)
  at
  
 com.xpn.xwiki.plugin.ldap.XWikiLDAPConnection.open(XWikiLDAPConnection.java:109)
  at
  
 com.xpn.xwiki.user.impl.LDAP.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:194)




  is there some debug feature i can turn on to get some more information?
  or some small test-class to verify the settings? it seems it uses the
  login name from the login form but then authentication fails.



  thanks a lot :)
  regards

  werner




  Thomas Mortagne schrieb:
   On Wed, Apr 30, 2008 at 11:55 AM, werner mueller
   [EMAIL PROTECTED] wrote:
   Hallo
  
thanks for the reply.
back to stupid questions:
  
 #-# LDAP login, empty = anonymous access, otherwise specify full dn
  #-# {0} is replaced with the username, {1} with the password
  #xwiki.authentication.ldap.bind_DN=cn={0},department=USER,o=MP
  
 #xwiki.authentication.ldap.bind_pass={1}
  
{0} is the username from the login form in xwiki?
{1} is the password from the login form in xwiki?
  
   Yes, you really write {0} and {1} in the configuration and it will
   be replaced at runtime by user/pass provided by user in the login
   form.
  
or are these documentation placeholders to be filled in the config file
directly?
  
thanks :)
  
  
  
regards
  
werner
  
  
  
  
Thomas Mortagne schrieb:
 On Tue, Apr 29, 2008 at 1:30 PM, werner mueller
 [EMAIL PROTECTED] wrote:
 Hallo

  thanks for the hints.

  i tried some other configurations but with no luck. it seems not 
 every
  user is allowed to query the ldap structure. i have to use a special
  user/password to bind xwiki to the active directory. that user can 
 login
  but thats not a solution. aloow everyone to query the ad is not an
  option for us.

  has anyone a working active directory config he or she could share?

  is it possible to trick xwiki to use a different user to bind to 
 the AD
  and then use username/password from login to process the login?
  i've been doing similar things for bugzilla/ldap using LDAPbinddn =
  cn=LDAPQUERYUSERNAME,cn=Users,dc=domain,dc=com:LDAPQUERYPASSWORD

 Yes and it's the default way to work for LDAP authenticator. You can
 see in default xwiki.cfg :

 #-# LDAP login, empty = anonymous access, otherwise specify full dn
 #-# {0} is replaced with the username, {1} with the 

Re: [xwiki-users] JavaScript image manipulation

2008-05-11 Thread Mike Oliver

\]Ok I found the \['example'\] but that leaves the  AEBtn_0.jpb 
I am trying to manipulate some image files using JavaScript.

But when I insert a tag as follows the javascript []'s get interpretted as a
wiki link, 

lt;a href=/Sandbox/WebHome
onMousedown=document.images['example'].src=img2.src
onMouseup=document.images['example'].src=img1.srcgt;
lt;mg src={image:AEBtn_0.jpg} name=example border=0gt;lt;/agt;



-- 
View this message in context: 
http://www.nabble.com/JavaScript-image-manipulation-tp17177802p17179133.html
Sent from the XWiki- Users mailing list archive at Nabble.com.

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] JavaScript image manipulation

2008-05-11 Thread Guillaume Lerouge
Hi Mike,

\]Ok I found the \['example'\] but that leaves the  AEBtn_0.jpb
 I am trying to manipulate some image files using JavaScript.

 But when I insert a tag as follows the javascript []'s get interpretted as
 a
 wiki link,

 lt;a href=/Sandbox/WebHome
 onMousedown=document.images['example'].src=img2.src
 onMouseup=document.images['example'].src=img1.srcgt;
 lt;mg src={image:AEBtn_0.jpg} name=example border=0gt;lt;/agt;


To prevent the wiki syntax from being interpreted in javascript code you
should use the {pre} tag :

{pre}
code type=javascript
some javascript code here
/code
{/pre}

It's the only exception : though it is a {} tag it needs to be closed with
{/} (while {table} is closed {table} for instance).

Guillaume
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users