1. Trang chủ
  2. » Công Nghệ Thông Tin

Quản lý cấu hình web - part 24 pptx

10 230 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 6,04 MB

Nội dung

Dynamic Deployment and Customizations [ 212 ] Following are the steps to be followed to deploy a workow via JBoss jBPM Process Designer. This will deploy workow without restart of the server. 1. Ensure the Alfresco server is up and running. 2. Click on the source tab and copy the content of the le dynamicProcessdenition. 3. Click on the Deployment tab and enter the following information: ° Server Name = machine name where Alfresco is installed ° Server Port = port number assigned to Alfresco (default: 8080) ° Server Deployer = /alfresco/jbpm/deployprocess 4. Click on Test Connection 5. If all is OK, click on Deploy Process Archive The following screenshot shows the details provided earlier: Download from Wow! eBook <www.wowebook.com> Chapter 6 [ 213 ] Display of workow images If Hot Deployment is done, then we can see the workow images that show the current status of workow in Alfresco Explorer under the workow outline section. The screenshots can be seen in the following sections when you test the workows that are deployed through jPDL. Modify these les: • /jsp/workflow/start-workflow-wizard/workflow-options.jsp • /jsp/workflow/manage-task-dialog.jsp Change the rendered and expanded value to true as highlighted. The modied code is as follows: <a:panel rendered="true" id="workflow-outline" label="#{msg.workflow_outline}" progressive="true" expanded="true" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle"> Third approach The workow console can be used (as an alternative to the Alfresco Explorer) to deploy and undeploy Process Denitions. Its primary use is to test newly-developed workow denitions. However, it also supports the debugging/diagnosis of current "in-ight" workows. This can be deployed via http://<server-name>:<port>/ alfresco/faces/jsp/admin/workflow-console.jsp . The command deploy <workflow-name> will cause the workow to be deployed. deploy alfresco/extension/dynamicProcessdefinition.xml Dynamic Alfresco Explorer A dynamic web client conguration le will have the same name as a custom web client conguration le. For example, create a web-client-config-custom.xml le, with the following content, to support the dynamic content type that you created earlier: <config evaluator="node-type" condition="dynamic:initializeTask" replace="true"> <property-sheet> <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" /> <show-property name="dynamic:property" /> Download from Wow! eBook <www.wowebook.com> Dynamic Deployment and Customizations [ 214 ] <show-association name="bpm:assignee" display-label-id="wf_reviewers" /> </property-sheet> </config> <config evaluator="node-type" condition="dynamic:reviewTask" replace="true"> <property-sheet> <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" /> <show-property name="bpm:taskId" /> <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/> <show-property name="bpm:comment" component-generator="TextAreaGenerator" /> <separator name="sep2" display-label-id="wf_reviewers" component-generator="HeaderSeparatorGenerator" /> <show-association name="bpm:assignee" display-label-id="wf_reviewers" read-only="true"/> </property-sheet> </config> Deploying Alfresco Explorer customizations The web client congurations can also be dynamically deployed without restarting the server. This can be achieved by two ways: • Upload or create the Process Denition le in the new Workow Denitions space (Company Home | Data Dictionary | Workow Denitions). • Using the pre-registered URLs provided. Dynamic Alfresco Explorer customizations are stored in the new Web Client Extension space (Company Home | Data Dictionary | Web Client Extension). Upload a custom web-client-config-custom.xml le to the Web Client Extension space. Download from Wow! eBook <www.wowebook.com> Chapter 6 [ 215 ] The custom conguration will not be applied until it is explicitly reloaded or when the server is restarted. Reloading web client customizations If the web-client-config-custom.xml le has been added, edited, or updated, it can be dynamically reloaded by using the Alfresco Explorer conguration console via: http://<server-name>:<port>/alfresco/faces/jsp/admin/ webclientconfig-console.jsp . This has a single command reload, which will cause the Alfresco Explorer conguration to be reloaded. Using the dynamic approach you can deploy workow in DM. In order to deploy it in WCM you have to make the change manually in web- client-config-wcm.xml, as discussed earlier (see the Deploying into WCM Project section) in Chapter 5, WCM Workows and then restart the server once. The dynamic approach can also be used if some changes are required after deployments so, no need to restart the server. Download from Wow! eBook <www.wowebook.com> Dynamic Deployment and Customizations [ 216 ] Testing the workow To assign workow for a specic project, refer to the Associating workows to web project section in Chapter 5. While submitting, the content task appears in user's dashlet. On clicking on the task, you nd the screen shown in the following screenshot. The highlighted section, Workow Outline, displays the diagram of the deployed Process Denition. This is visible since we have made hot deployment of the workow. Now you can approve or reject the workow: Download from Wow! eBook <www.wowebook.com> Chapter 6 [ 217 ] Customization of existing workow to use e-mail notications Alfresco provides an inbuilt Web Site Submission workow to be associated with the web project. If you want to make change in the existing workow, following are the location of the les to make the changes. 1. The Process Denition le is present in the specied location: <install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/ alfresco/workflow/submit_processdefinition.xml. 2. The Task Model le is also present at same location: <install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/ alfresco/workflow/wcmWorkflowModel.xml. 3. The Resource Bundle is also present at same location: <install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/ alfresco/workflow/wcm-workflow-messages.properties. 4. The Spring Context le, which is used to load model, Process Denition, and Resource Bundle is present at the location: <install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/ alfresco/bootstrap-context.xml. 5. The Alfresco Explorer Dialog is located at: <install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/ alfresco/web-client-config-properties.xml. Consider a case where you want to add an e-mail notication at the submission of content. It is easy to customize the workow by adding the following code snippet that is highlighted: <task name="wcmwf:submittedTask" swimlane="initiator"> <timer duedate="5 seconds" transition="onsubmit"> <action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> logger.log("WCM Submit Process: Triggering submit for " + bpm_workflowDescription); </script> </action> </timer> <event type="task-end"> <script> <variable name="submitfailed" access="write"/> Download from Wow! eBook <www.wowebook.com> Dynamic Deployment and Customizations [ 218 ] <expression>submitfailed = false;</expression> </script> <action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")"); </script> </action> <action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> var mail = actions.create("mail"); mail.parameters.to = initiator.properties.email; mail.parameters.subject = "Submit Task " + bpm_workflowDescription; mail.parameters.from = person.properties.email; mail.parameters.text = "It's done"; mail.execute(bpm_package); </script> </action> <action class= "org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/> <action class="org.alfresco.repo.avm.wf.AVMDeployHandler"/> <action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> logger.log("WCM Submit Process: End submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")"); </script> </action> </event> </task> Deploy the Process Denition using a dynamic approach and test the workow. Download from Wow! eBook <www.wowebook.com> Chapter 6 [ 219 ] If you want to deploy changes manually, you have to make changes in the bootstrap-context.xml le as mentioned previously in the fourth point. <props> <! WCM workflow definition > <prop key="engineId">jbpm</prop> <prop key="location"> alfresco/workflow/submit_processdefinition.xml</prop> <prop key="mimetype">text/xml</prop> <prop key="redeploy">true</prop> </props> You should receive an e-mail notication at the submission of content to the Staging box. Remove workow for specic staging submission We have already congured workows for blogs and training web content. There can be various reasons why you don't want to follow a complete process of workow and have to submit the content directly. If we think of the out-of-the-box feature, then we have to remove the workow for those web forms so that web content can be submitted directly. This is not a good practice sometimes when you are conguring a workow or sometimes when you are removing a workow for a particular web content. In order to make the task simpler we have to customize the submit dialog using APIs. Follow these steps to create two Java les: 1. Create a package com.book.web.bean.wcm, in Eclipse, in your project. For more details refer Chapter 2, Installation and Conguration. 2. Create a Java le ExtendedSubmitDialog and copy the downloaded content from the Packt website. Please download the complete code from the Packt website. 3. Create a Java le ExtendedSubmitConfigureWorkflowDialog and copy the downloaded content from the Packt website. Download from Wow! eBook <www.wowebook.com> Dynamic Deployment and Customizations [ 220 ] 4. Open the le faces-config-custom.xml, located at <install-alfresco>/ tomcat/webapps/alfresco/WEB-INF and copy the downloaded content from the Packt website. 5. Run Ant to compile the code and create a JAR le in <install-alfresco>/ tomcat/webapps/alfresco/WEB-INF/lib . Please refer to Chapter 2, Installation and Conguration for compiling and deploying code to the installed Alfresco. 6. Start the Alfresco server. Test using Submit Items wizard Follow the steps mentioned ahead to submit all or selected modied content to the workow. 1. Go to Company Home | Web Projects | Cignex. 2. Submit Selected option is provided under Modied Items of My sandbox. 3. On click of Submit Selected, the Submit Items wizard is opened and you will notice that one more workow is congured. Download from Wow! eBook <www.wowebook.com> Chapter 6 [ 221 ] 4. Select No workow now and click on OK. Download from Wow! eBook <www.wowebook.com> . location: <install-alfresco>/tomcat/webapps/alfresco /WEB- INF/classes/ alfresco/bootstrap-context.xml. 5. The Alfresco Explorer Dialog is located at: <install-alfresco>/tomcat/webapps/alfresco /WEB- INF/classes/ alfresco /web- client-config-properties.xml. Consider. location: <install-alfresco>/tomcat/webapps/alfresco /WEB- INF/classes/ alfresco/workflow/wcmWorkflowModel.xml. 3. The Resource Bundle is also present at same location: <install-alfresco>/tomcat/webapps/alfresco /WEB- INF/classes/ alfresco/workflow/wcm-workflow-messages.properties. 4 eBook <www.wowebook.com> Dynamic Deployment and Customizations [ 220 ] 4. Open the le faces-config-custom.xml, located at <install-alfresco>/ tomcat/webapps/alfresco /WEB- INF and copy

Ngày đăng: 05/07/2014, 20:21

TỪ KHÓA LIÊN QUAN