以前装了Acegi0.2版的插件,现在出0.3了,可不知道怎么升级?

oksonic 2008-06-04
我试了换掉所有的路径,结果运行不了,参考资料中也没有说到过如何删除或是升级。
pipihu_yu 2008-06-08
如果没有使用到新的功能,最后不要修改系统当前使用的版本!
如果非要修改,你可以删除项目下plugins目录和web-app/plugins目录下ageci插件相关的文件,然后在安装新的版本!
Javabengou 2008-06-09
官方网站不是说的很清楚该如何升级!!
pipihu_yu 2008-06-09
A user upgrading from v0.2.1 to v0.3.0 saw some strange behavior because one of the updated scripts wasn't compiled and the old cached script was running. Before upgrading run 'grails clean' and delete the script cache (C:.grails1.0.2scriptCache on Windows, $home/.grails/1.0.2/scriptCache on Linux).
If you're using version 0.2.x of the plugin and want to upgrade to version 0.3.0, you'll need to make a few changes. The install script only unpacks the plugin zip, so there's not much to do to upgrade:
delete the current plugin zip and expanded folder from the plugins folder
install the new plugin:
grails install-plugin acegirename your application's grails-app/conf/AcegiConfig.groovy to SecurityConfig.groovy
in SecurityConfig.groovy, change
acegi {
loadAcegi = true … }
to
security {
   active = true
   …
}in RegisterController.groovy, change
def cnf = authenticateService.getAcegiConfig()
def defaultRole = cnf.acegi.defaultRole
def useMail = cnf.acegi.useMailto
def config = authenticateService.securityConfig
def defaultRole = config.security.defaultRole
def useMail = config.security.useMailin LoginController.groovy, update the Ajax check from
//is ajax access?
def cnf = authenticateService.getAcegiConfig()
def ajaxHeader = cnf.acegi.ajaxHeader
def AJAX_HEADER="${ajaxHeader}"
boolean isAjax=false;
if(session["ACEGI_SAVED_REQUEST_KEY"]){
  def itr =  session["ACEGI_SAVED_REQUEST_KEY"].getHeaderValues(AJAX_HEADER)
  if(itr.hasNext()) isAjax=true
}to
boolean isAjax = authenticateService.isAjax(request)in LogoutController.groovy, change
j_acegi_logoutto
j_spring_security_logoutin auth.gsp, change
j_acegi_security_checkand_acegi_security_remember_meto
j_spring_security_checkand_spring_security_remember_meReplace session keys 'ACEGI_SECURITY_LAST_EXCEPTION' and 'ACEGI_SECURITY_LAST_USERNAME' with 'SPRING_SECURITY_LAST_EXCEPTION' and 'SPRING_SECURITY_LAST_USERNAME' in LoginController.groovy and any of your code that uses them
User.email_show was renamed to User.emailShow, so change all references to this variable (views/user/*.gsp, views/register/*.gsp, RegisterController.groovy, User.groovy (or whatever your User/Person class is called)
if you're calling AuthBase.groovy, AuthenticateService.groovy, or AuthorizeTagLib.groovy from your code, they've been moved out of the default package, so you'll have to add imports for them:
import org.grails.plugins.springsecurity.service.AuthenticateService
import org.grails.plugins.springsecurity.controller.AuthBase
import org.grails.plugins.springsecurity.taglib.AuthorizeTagLib
If you're referencing older Acegi classes (org.acegisecurity) in your code, update the packages to the new names (org.springframework.security), e.g. org.acegisecurity.DisabledException in LoginController.groovy
If you've configured logging in Config.groovy, you'll need to adjust the packages there (log4j.logger.org.acegisecurity -> log4j.logger.org.springframework.security)
After making the above code changes, search your entire codebase for 'acegi' - there should be no instances other than in a few of the comments. Once Acegi became an official Spring module, everything was renamed and no code should have 'acegi' in it, and the plugin follows the same convention.
Finally, if you're using Eclipse, remove the old plugin's source folders and jar files from your classpath and add these:
add these plugin folders as Source Folders:
plugins/acegi-0.3/grails-app/controllers
plugins/acegi-0.3/grails-app/services
plugins/acegi-0.3/grails-app/taglib
plugins/acegi-0.3/src/groovy
plugins/acegi-0.3/src/java
and these jars:
plugins/acegi-0.3/lib/commons-codec-1.3.jar
plugins/acegi-0.3/lib/spring-security-core-2.0.0.jar
plugins/acegi-0.3/lib/spring-security-core-tiger-2.0.0.jar
plugins/acegi-0.3/lib/spring-security-openid-2.0.0.jar
and bin-groovy (or wherever you've configured the Groovy plugin to compile classes in the 'Groovy compiler output location' property) as a Class Folder
 If you're using another IDE, perform the corresponding steps. Close

引用自http://www.grails.org/AcegiSecurity+Plugin+-+Upgrading+from+0.2.x+to+0.3
agile_boy 2008-06-09
great!有升级经验的翻译一下,更好
oksonic 2008-06-10
看是看懂了,可是装插件却装不上,没办法,只有重建一个工程了。
casephoen 2008-07-15
我也碰到过插件升级的事,每次我都是全部删光老版本的,然后重新安装新的,挺麻烦的,呵呵
Global site tag (gtag.js) - Google Analytics