[Transfer] Deployment of open source rights management component ralasafe in eclipse

 
Try ralasafe again, ralasafe is indeed a good permission management component, but it needs to be learned in the process of application, and the code is more intrusive, so it is more suitable for personal use.
 
The author of the deployment of ralasafe in eclipse has already written (comparatively concise) in http://www.ralasafe.cn/2010/10/ralasafe-eclipse-project/ , but the website crashed a few days ago, so I can only explore by myself I went to try it, and encountered a lot of problems. Now I will make a graphic record and give you a reference.
 
 
Get the source code:
If Eclipse is installed with the SVN plug-in, it can be obtained directly from svn. The steps are as follows:
File--"Import...--"SVN: Check out the project from SVN--"Next--"Select: Create a new repository location--"Next--"URL: https://ralasafe. svn.sourceforge.net/svnroot/ralasafe--"Next--"Select the ralasafe folder--"Next--" as a new project. . . --"Click finish to display the project settings window, select Web: Dynamic Web Project, as shown below:
--"Next--"Set the project name--"finish, click OK in the pop-up confirmation overwrite window, eclipse will extract files from svn to the newly created project. The entire project structure after the extraction is completed is as follows:
 
If the svn plug-in is not installed, you can directly download the ralasafe source code, then use eclipse to create a new Dynamic Web Project, and then copy the files in the source code to the project to form the directory structure in the figure above.
 
Set the source file:
Select the created ralasafe project, right-click--"properties--"java build path:source--"click Add Folder to add all the following folders to the source: client, constants-and-commons,demo,entitlement,for-client -interface,orm,src,user,util,test, set the output folder to ralasafe_test/build/classes (I changed the project name here, so it will be a little different, but it has little effect)
 
set lib
Copy all the jar packages in the lib folder in the project to WebContent/WEB-INF/lib. Note that you can add subfolders. You need to copy the jar packages in the lib subfolder and put them under /WEB-INF/lib , subfolders cannot exist. Add all the jar packages under WEB-INF/lib to the build path. (As long as the jar is copied to WEB-INF/lib, it will be added automatically, and if it cannot be added, it can be added manually.) As shown in the following figure:
Publish settings
Select the established ralasafe project, right-click--"properties--"Deployment Assembly--" click Add to add all the source files, as shown below: (I have an extra ralasafe library here because I put the files in the lib The jar packages are all added to a custom library)
 
build database
The test is mysql, let's talk about it.
Import the sql in the create-database.sql and demo-mysql.sql files in the sql folder in the project folder into mysql (other clients of the database can also directly execute the sql in the file) to form the following databases and tables structure.
mydemo为demo的数据库,ralasafe为ralasafe的核心数据库。
 
修改配置文件
数据库配置文件:
/WebContent/WEB-INF/ralasafe/app-ds.properties为demo的数据库配置文件。
/WebContent/WEB-INF/ralasafe/ralasafe-db.properties为ralasafe本身的数据库配置文件。
如果demo的数据库名不为mydemo则还需要修改/WebContent/WEB-INF/ralasafe/datasources.xml中 <datasourcename="app"configFile="app-ds.properties"schemas="mydemo,ralasafe"/>
将schemas="mydemo,ralasafe"中的mydemo修改为实际的数据库名称。
 
修改元数据存储路径:
   <servlet>
<servlet-name>ralasafe</servlet-name>
<servlet-class>org.ralasafe.servlet.RalasafeController</servlet-class>
<init-param>
<param-name>repositoryDir</param-name>
<param-value>/home/julian/workspace/ralasafe/xml</param-value>
</init-param>
<init-param>
<param-name>secured</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
修改repositoryDir路径为本机中的一个路径,最好是绝对路径。
发布
像其他Dynamic Web Project一样发布到应用服务器即可。
 
其他
启动服务器,不报错且控制台出现“ **** Ralasafe started successfully!   ”则标识启动成功。
如果有报错,则查看应用服务器的发布目录中的一下各文件是否正常(注意:elipse默认中tomcat默认的发布目录在工作空间的.metadata\.plugins\org.eclipse.wst.server.core中的一个)。
查看发布目录中的WEB-INF\lib中是否有所有的jar文件,且不能有子文件夹。
查看发布目录中的WEB-INF\classes中是否有配置文件及.class文件。
在浏览器中打开http://host:port/content_root/ralasafe/designer.rls即可打开设计页面。
demo登录页面为http://host:port/content_root/ralasafe/demo/login.jsp

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486621&siteId=291194637