tag:blogger.com,1999:blog-29413199446946158422024-02-08T09:27:29.469+05:30AlfrescoCHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-2941319944694615842.post-17677982826991724132010-11-03T13:21:00.001+05:302010-11-03T13:22:04.724+05:30Alfresco Task HistoryArticle reference from<br />
<div> <a href="http://www.wowww.nl/wordpress/2007/09/14/creating-an-alfresco-task-history-the-java-style/">http://www.wowww.nl/wordpress/2007/09/14/creating-an-alfresco-task-history-the-java-style/</a></div><div><br />
</div><div>Step1 : Download entire code from <a href="http://www.4shared.com/file/cvmDkxOS/task_History.html">taskhistory.zip</a></div><div><br />
</div><div>Step2: Go to tomcat\webapps\alfresco\WEB-INF replace faces-config-custom.xml with your downloaded file.</div><div><br />
</div><div>Step3: Go to tomcat\webapps\alfresco\jsp\content replace document-details.jsp with your downloaded file.</div><div><br />
</div><div>Step4: Go to tomcat\webapps\alfresco\WEB-INF\classes\alfresco\messages add your code into webclient.properties don't replace the file.</div><div><br />
</div><div>Step5: Go to tomcat\webapps\alfresco\WEB-INF\lib and add custom-jsp.jar</div><div><br />
</div><div>Step6: Restart the server</div><div><br />
</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi44DVVkA8Vm5hASu1XFQX6hp3xTgmd622r7fSbODPOUP9p72XGXQB9Y4DKfAHhcVxopK14Rm58C4fBM3IfoRVM9V84r1djw5kOFhIs4QAFExMcc6c6SZlDsvBrNye59uRk7MJvbG7kpAI/s1600/TaskHistory.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="395" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi44DVVkA8Vm5hASu1XFQX6hp3xTgmd622r7fSbODPOUP9p72XGXQB9Y4DKfAHhcVxopK14Rm58C4fBM3IfoRVM9V84r1djw5kOFhIs4QAFExMcc6c6SZlDsvBrNye59uRk7MJvbG7kpAI/s640/TaskHistory.JPG" width="640" /></a></div><div><br />
</div><div><br />
</div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com5tag:blogger.com,1999:blog-2941319944694615842.post-31358426358524218112010-11-02T12:54:00.001+05:302010-11-02T12:57:33.733+05:30Workflow in ShareHi<br />
<br />
here i will explain about workflows in share , it will work for enterprise and community editions also with 3.4 version.<br />
<br />
<b>Step1:</b> we can start work flow in two ways<br />
<br />
a) From actions along right side on an item row in the list of Document Library items<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIsR2a1lDpaBn9sUR6-ksFT1PNQFPZHedFkmCVl9Fj0Nhj4XaT9N0-O3oIwGcF4R3M4Uc6WsI6hXZpIcXZZZIpD_2MS7Q0vdTh28yvynSJD3Cw6Q6wTn20QbRRXZzLuv_riNIKJxP-Qz0/s1600/swf1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIsR2a1lDpaBn9sUR6-ksFT1PNQFPZHedFkmCVl9Fj0Nhj4XaT9N0-O3oIwGcF4R3M4Uc6WsI6hXZpIcXZZZIpD_2MS7Q0vdTh28yvynSJD3Cw6Q6wTn20QbRRXZzLuv_riNIKJxP-Qz0/s640/swf1.JPG" width="640" /></a></div>b) By Clicking on the "Start Workflow" action links on document details page<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NHgCYA6hiQpxliB96OrXKAWi177UW5V7XeaqdNhoUnVNWKli_EIr515ZnEhyphenhyphenK9E2kQlyGuQ5MfTpGLIYYDGonps3_F0TTShYmypMwtZgAn0LYTrcdhdjD8RBJfVk2-LR5EtiECC3t1c/s1600/swf2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NHgCYA6hiQpxliB96OrXKAWi177UW5V7XeaqdNhoUnVNWKli_EIr515ZnEhyphenhyphenK9E2kQlyGuQ5MfTpGLIYYDGonps3_F0TTShYmypMwtZgAn0LYTrcdhdjD8RBJfVk2-LR5EtiECC3t1c/s320/swf2.JPG" width="234" /></a></div><br />
<b>Step2: </b>after click on "start workflow", you will get start work flow page with drop down on that page like as follows<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEmG9dkjvbfSeK9CFSVDNWHZYqv18Di5i25jYDBh77Sc_pylfWidek7nCZC8sGd_HkgNvlCYb7_kidlHDiRXlkHwa8CrabRZ7onJgScok2DEgtl3cWjxNXpahIW0r6eVXw9Fpt4uObcZU/s1600/swf3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEmG9dkjvbfSeK9CFSVDNWHZYqv18Di5i25jYDBh77Sc_pylfWidek7nCZC8sGd_HkgNvlCYb7_kidlHDiRXlkHwa8CrabRZ7onJgScok2DEgtl3cWjxNXpahIW0r6eVXw9Fpt4uObcZU/s400/swf3.JPG" width="400" /></a><br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step3:</b> For example select Adhoc (Assign task to colleague) from the drop down, then it will displays a form to enter parameters that defines work flow. </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZUHRHasiASCXpSMyMXHCB5PUUu7mrtcjUCBQnqB3EHtxjgFpM90Pt7H18tkRhhsiyprdFrforvd4489vipIrKgGYS2XBE-uioTgi1ixRpVw4igBODI8ZaGDN93Ktz00AsjjIeMZjWt8U/s1600/swf4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="505" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZUHRHasiASCXpSMyMXHCB5PUUu7mrtcjUCBQnqB3EHtxjgFpM90Pt7H18tkRhhsiyprdFrforvd4489vipIrKgGYS2XBE-uioTgi1ixRpVw4igBODI8ZaGDN93Ktz00AsjjIeMZjWt8U/s640/swf4.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div>If we need to add new custom work flow follows these steps ( code from wiki page <a href="http://wiki.alfresco.com/wiki/WorkflowSample_Lifecycle">http://wiki.alfresco.com/wiki/WorkflowSample_Lifecycle</a>)<br />
<br />
<b>Step4:</b> Go to <installed dir=""> \shared\classes\alfresco\extension folder rename </installed><br />
<br />
lifecycle_processdefinition.xml.sample to lifecycle_processdefinition.xml<br />
lifecycle-workflow-context.xml.sample to lifecycle-workflow-context.xml<br />
lifecycleModel.xml.sample to lifecycleModel.xml<br />
lifecycle-messages.properties.sample to lifecycle-messages.properties<br />
<br />
if you are not able to find those files copy these code and place those files into <installed dir=""> \shared\classes\alfresco\extension folder </installed><br />
<installed dir=""><br />
</installed><br />
<installed dir=""><a href="https://docs.google.com/document/pub?id=1dg3jFWlxKmdz9p4P7Ddjv8Lvq34NtgHlAwgpIrC5Ik0">Custom WorkFlow Code</a></installed><br />
<br />
<b>Step5: </b>type this url in browser <a href="http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp">http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp</a><br />
<br />
then enter<br />
<br />
deploy alfresco/extension/lifecycle_processdefinition.xml<br />
<br />
Click on submit.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC7idm7ryQTjR59SyRQyuZ211fjdJRmMXGDGBVC9OVmKJWmtJiPOqCLZ7nLVE_zteHSzoyasyvO5BZhRf74DqwuS5Ph0Da5gP8_0uPoHXFON6uBhvv6bsF50-cHLz8JCVNacQcBx4SILE/s1600/WFDeploy.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC7idm7ryQTjR59SyRQyuZ211fjdJRmMXGDGBVC9OVmKJWmtJiPOqCLZ7nLVE_zteHSzoyasyvO5BZhRf74DqwuS5Ph0Da5gP8_0uPoHXFON6uBhvv6bsF50-cHLz8JCVNacQcBx4SILE/s640/WFDeploy.JPG" width="640" /></a></div><br />
<br />
<br />
<b>Step5:</b> Restart the server then follow above procedure you will get your custom work flow in start workflow drop down list as shown<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFI9Ua6in4KdVXmyQZ-0hxlIXsujrgezIOeng6gQ9N7sx0XXyoU954vMoVUdZ54hngI7gqmwthKq28P9MBNO62NsVcT13gg9qh1lCJRYD08gbl08izbNkZAeszQKOGmhDNCHTKj1bUZ18/s1600/swf5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="468" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFI9Ua6in4KdVXmyQZ-0hxlIXsujrgezIOeng6gQ9N7sx0XXyoU954vMoVUdZ54hngI7gqmwthKq28P9MBNO62NsVcT13gg9qh1lCJRYD08gbl08izbNkZAeszQKOGmhDNCHTKj1bUZ18/s640/swf5.JPG" width="640" /></a></div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com1tag:blogger.com,1999:blog-2941319944694615842.post-89217871681034828482010-08-12T16:41:00.002+05:302010-08-12T16:57:44.098+05:30Alfresco : JMXJMX means Java Management Extensions (JMX) Technology<br />
<br />
The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solutions for managing and monitoring devices, applications, and service-driven networks. By design, this standard is suitable for adapting legacy systems, implementing new management and monitoring solutions, and plugging into those of the future.<br />
<br />
<b>JMX in Alfresco</b><br />
<div class="separator" style="clear: both; text-align: auto;"> By default, system administrators can reconfigure Alfresco by shutting down the server, editing certain property and configuration files and then restarting the server. However, there are certain support operations that System Administrators would like to perform on-demand at runtime without needing to restart the server. For example, it should be possible to temporarily change log levels in order to debug and/or troubleshoot a live system.</div><div class="separator" style="clear: both; text-align: auto;"></div><div class="separator" style="clear: both; text-align: auto;"> In addition, as an Enterprise Only feature, Alfresco contains various subsystems that may be configured and restarted without needing to restart the entire alfresco repository.</div><div class="separator" style="clear: both; text-align: auto;"><br />
</div><div class="separator" style="clear: both; text-align: auto;">In order to open JMX </div><div class="separator" style="clear: both; text-align: auto;"><br />
</div><div class="separator" style="clear: both; text-align: auto;"><b>Step1:</b> Start Alfresco</div><div class="separator" style="clear: both; text-align: auto;"><br />
</div><div class="separator" style="clear: both; text-align: auto;"><b>Step2:</b>Go C:\Program Files (x86)\Java\jdk1.6.0_18\bin ,(i.e., /bin/jconsole. ) double click on jconsole.exe this will open screen like as follows.</div><div class="separator" style="clear: both; text-align: auto;"><br />
</div><div class="separator" style="clear: both; text-align: auto;"> select Local Process and enter </div><div class="separator" style="clear: both; text-align: auto;"></div><div class="separator" style="clear: both; text-align: auto;"> JMX Username: controlRole</div><div class="separator" style="clear: both; text-align: auto;"> JMX Password: change_asap and then click on Connect.</div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2kw62SeDaVZ8Ck3283drtc5f9NYCAg7jfKu8Au0ZDxq1soraRMyPutBI6HgOLDY9KIbeqtGTvoMvf2tf3vE7LsHKeZAmKjknVEWXz5WlaTpE-G2IM0p7ujEOAOlQT41WOgD8X66SST-E/s1600/JMX.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2kw62SeDaVZ8Ck3283drtc5f9NYCAg7jfKu8Au0ZDxq1soraRMyPutBI6HgOLDY9KIbeqtGTvoMvf2tf3vE7LsHKeZAmKjknVEWXz5WlaTpE-G2IM0p7ujEOAOlQT41WOgD8X66SST-E/s400/JMX.JPG" width="400" /></a></div><br />
<br />
then select Bean you can made change as you like the window will like follows.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPgoQbC62r6a0Q3fz4d7T3I4NjlP1aseS2hnAlEac1avIifg4HmRvrgzWnIVhlbZuufO4HlA-EJ-9_dVufYtcVf0EFpAxhBlmwEC4DWb4ApSG0PFjATWmekCfp9hh63qMkKU1KQo9DiI/s1600/JMX.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPgoQbC62r6a0Q3fz4d7T3I4NjlP1aseS2hnAlEac1avIifg4HmRvrgzWnIVhlbZuufO4HlA-EJ-9_dVufYtcVf0EFpAxhBlmwEC4DWb4ApSG0PFjATWmekCfp9hh63qMkKU1KQo9DiI/s400/JMX.JPG" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;">The best way to tell what all of your properties are is to hit: </div><div class="separator" style="clear: both; text-align: center;"> http://localhost:8080/alfresco/faces/jsp/admin/jmx-dumper.jsp </div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com2tag:blogger.com,1999:blog-2941319944694615842.post-8701665655499437842010-07-09T16:43:00.002+05:302010-08-27T13:05:09.340+05:30Java-Backed Web Scripts<div class="separator" style="clear: both; text-align: left;">Hi., in this article i will explain about how to write Java backed web script in alfresco,if you are new to java this article may more helpful to you.just i will explain more which we have same thing in wiki i.e., <a href="http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples">http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples</a> </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"> Java class is the controller rather than JavaScript .basically JavaScript is very light weighted language even we can write webscrpit using simple JavaScript but there are some reasons to write using Java.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">1.accessing alfresco application services not available via JavaScript API</div><div class="separator" style="clear: both; text-align: left;">2.when the performance is absolutely critical</div><div class="separator" style="clear: both; text-align: left;">3.to get tighter control of the generated response.</div><div class="separator" style="clear: both; text-align: left;">4.when we need to access the Alfresco API</div><div class="separator" style="clear: both; text-align: left;">5.if we prefer stronger programming language like JAVA</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">the construction view for this script is shown below.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQa2YmB-4cRDPZwuwEWpH_GtMSJk1ESnB8DQadZRulARYd32-zil3xhJBv25q8h9dCc0t9VQb_mxbpOzGN6FEzhLHmkxrRtFixoqzLazjHs2wT_kizuutTVRSLN-ePJ-3PKCXEgcol8aY/s1600/JavaWebScript.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQa2YmB-4cRDPZwuwEWpH_GtMSJk1ESnB8DQadZRulARYd32-zil3xhJBv25q8h9dCc0t9VQb_mxbpOzGN6FEzhLHmkxrRtFixoqzLazjHs2wT_kizuutTVRSLN-ePJ-3PKCXEgcol8aY/s400/JavaWebScript.JPG" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b><span class="Apple-style-span" style="font-size: x-large;">Example1:</span></b></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-size: x-large;"><b> </b><span class="Apple-style-span" style="font-size: medium;">in this example i will explain simple java backed webscript step wise which is in </span></span><a href="http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples">http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples</a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step1</b>: use eclipse to get the class file for a java code very easily.here i am using in same way.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">a) create a java project in eclipse name it as java-backed-webscripts</div><div class="separator" style="clear: both; text-align: left;">b)create a folder and name it as lib import the jar files to this file from <rootfolder> \tomcat\webapps\alfresco\WEB-INF\lib</rootfolder></div><div class="separator" style="clear: both; text-align: left;">c)create on more folder in the project and name it as source</div><div class="separator" style="clear: both; text-align: left;">d)right click the source folder then go to new>file name it as SimpleWebSript.java</div><div class="separator" style="clear: both; text-align: left;"> copy the below code in that</div><div class="separator" style="clear: both; text-align: left;">--------------------------------------------------------------------------------------------------------</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;">package org.alfresco.module.demoscripts;</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">import java.io.IOException;</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">import org.alfresco.web.scripts.AbstractWebScript;</div><div class="separator" style="clear: both; text-align: left;">import org.alfresco.web.scripts.WebScriptException;</div><div class="separator" style="clear: both; text-align: left;">import org.alfresco.web.scripts.WebScriptRequest;</div><div class="separator" style="clear: both; text-align: left;">import org.alfresco.web.scripts.WebScriptResponse;</div><div class="separator" style="clear: both; text-align: left;">import org.json.JSONException;</div><div class="separator" style="clear: both; text-align: left;">import org.json.JSONObject;</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">public class SimpleWebScript extends AbstractWebScript</div><div class="separator" style="clear: both; text-align: left;">{</div><div class="separator" style="clear: both; text-align: left;"> public void execute(WebScriptRequest req, WebScriptResponse res)</div><div class="separator" style="clear: both; text-align: left;"> throws IOException</div><div class="separator" style="clear: both; text-align: left;"> {</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>try</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>{</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>// build a json object</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>JSONObject obj = new JSONObject();</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>// put some data on it</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>obj.put("field1", "data1");</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>// build a JSON string and send it back</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>String jsonString = obj.toString();</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>res.getWriter().write(jsonString);</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>catch(JSONException e)</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>{</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>throw new WebScriptException("Unable to serialize JSON");</div><div class="separator" style="clear: both; text-align: left;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</div><div class="separator" style="clear: both; text-align: left;"> } </div><div class="separator" style="clear: both; text-align: left;">}</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">-------------------------------------------------------------------------------------------------</div><br />
<div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">d)right click on the project and new>file -- create a file with the name build.xml</div><div class="separator" style="clear: both; text-align: left;"> copy the code ass shown below.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">------------------------------------------------------------------------------------------------------</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"><?xml version="1.0"?></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><project name="Sample Module" default="package-amp" basedir="."></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property name="project.dir" value="." /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property file="${project.dir}/build.properties" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property file="${project.dir}/module.properties" /></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property name="build.dir" value="${project.dir}/build" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property name="config.dir" value="${project.dir}/config" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property name="jar.file" value="${build.dir}/lib/${module.id}.jar" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><property name="amp.file" value="${build.dir}/dist/${module.id}.amp" /></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><target name="mkdirs"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/dist" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/lib" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/classes" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></target></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><path id="class.path"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><dirset dir="${build.dir}" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}/lib" includes="**/*.jar" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></path></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><target name="clean"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><delete dir="${build.dir}" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></target></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><target name="compile" depends="mkdirs"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><javac classpathref="class.path" debug="${debug}" srcdir="${project.dir}/source/java" destdir="${build.dir}/classes" target="1.5" encoding="UTF-8" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><copy todir="${build.dir}/classes"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}/source/java" defaultexcludes="false"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/*.java" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/.svn/**" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/CVS/**" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></fileset></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></copy></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></target></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><target name="package-jar" depends="compile"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><jar destfile="${jar.file}" encoding="UTF-8"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" defaultexcludes="false" /></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></jar></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></target></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span><target name="package-amp" depends="package-jar" description="Package the Module"></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-tab-span" style="white-space: pre;"> </span></target></div><div class="separator" style="clear: both; text-align: left;"></project></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">----------------------------------------------------------------------------------------------------</div><br />
<div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">e)create one more file module.properties</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;">module.id=JavaBackedWebScript</div><div class="separator" style="clear: both; text-align: left;">module.title=test web script</div><div class="separator" style="clear: both; text-align: left;">module.description=Project to get class file for webscripts</div><div class="separator" style="clear: both; text-align: left;">module.version=1.0</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">f)then right click on build.xml --> run as --> AntBuild</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">it will create a class file and jar file. in build folder. copy this jar file and paste it into \tomcat\webapps\alfresco\WEB-INF\lib.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step2: </b>next step is to declaring the webscript to spring add the below code in web-scripts-application-context.xml, which is <alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco</alfresco></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"><bean id="webscript.org.alfresco.demo.simple.get" </div><div class="separator" style="clear: both; text-align: left;"> class="org.alfresco.module.demoscripts.SimpleWebScript"</div><div class="separator" style="clear: both; text-align: left;"> parent="webscript"></div><div class="separator" style="clear: both; text-align: left;"></bean></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step3: </b>next go to <alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco and create a folder and name it as demo</alfresco></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">and then create a file in this folder with the name simple.get.desc.xml then add the below code in that </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"></div><div class="separator" style="clear: both; text-align: left;"><webscript></div><div class="separator" style="clear: both; text-align: left;"> <shortname>The World's Simplest Webscript</shortname></div><div class="separator" style="clear: both; text-align: left;"> <description>Hands back a little bit of JSON</description></div><div class="separator" style="clear: both; text-align: left;"> <url>/demo/simple</url></div><div class="separator" style="clear: both; text-align: left;"> <authentication>none</authentication></div><div class="separator" style="clear: both; text-align: left;"> <format default="">argument</format></div><div class="separator" style="clear: both; text-align: left;"></webscript></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step4: </b> Just restart the server and type this url in the browser </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"> http://localhost:8080/alfresco/service/demo/simple</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">the JSON will return { “field1” : “data1” } </div><br />
<br />
Example 2:CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com9tag:blogger.com,1999:blog-2941319944694615842.post-50470295344647681722010-06-14T13:30:00.000+05:302010-06-14T13:30:16.786+05:30Alfresco-Google Docs Integration<b>Steps For Google Docs Integration in Alfresco<br />
</b><br />
<br />
this is integration in alfresco 3.3 version<br />
<br />
<b>step1</b>: Goto tomcat\shared\classes\alfresco\web-extension<br />
<br />
rename share-config-custom.xml.sample to share-config-custom.xml<br />
<br />
<b>step2</b>: open share-config-custom.xml file and false to true which is in bold.<br />
<br />
<google-docs><br />
<!--<br />
Enable/disable the Google Docs UI integration (Extra types on Create Content menu, Google Docs actions).<br />
If enabled, remember to also make sure the gd:googleEditable aspect is made visible in the <aspects> section above.<br />
--><br />
<enabled><b>true</b></enabled><br />
<br />
<!--<br />
The mimetypes of documents Google Docs allows you to create via the Share interface.<br />
The I18N label is created from the "type" attribute, e.g. google-docs.doc=Google Docs&trade; Document<br />
--><br />
<creatable-types><br />
<creatable type="doc">application/msword</creatable><br />
<creatable type="xls">application/vnd.ms-excel</creatable><br />
<creatable type="ppt">application/vnd.ms-powerpoint</creatable><br />
</creatable-types><br />
</google-docs><br />
<br />
<br />
<br />
<b>step3</b>:<br />
<br />
add aspect <aspect name="gd:googleEditable" /><br />
<br />
<b>step4</b>:<br />
<br />
Add this to your alfresco-global properties<br />
<br />
# GoogleDocs configuration<br />
googledocs.googleeditable.enabled=true<br />
googledocs.username=yourname@youraddress.com<br />
googledocs.password=yourgooglepassword<br />
<br />
log4j.logger.org.alfresco.repo.googledocs=debug<br />
<br />
step5: resart the tomcat server.<br />
<br />
<b>Here Added video tutorial from YouTube</b><br />
<br />
<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/bDD7TJ7Az38&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bDD7TJ7Az38&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
<br />
<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/cL3REx3BQQg&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/cL3REx3BQQg&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/1jXH_s7R-7Y&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1jXH_s7R-7Y&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
<br />
<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/k3T1lAyAzbk&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/k3T1lAyAzbk&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com8tag:blogger.com,1999:blog-2941319944694615842.post-12130437081183329822010-04-28T19:08:00.000+05:302010-04-28T19:08:21.294+05:30Code to Hide Actions in AlfrescoHere i added code to hide delete option on space and document in alfresco, add the following code in <b>web-client-config-custom.xml </b><br />
<br />
<config> <br />
<actions> <br />
<action-group id="space_browse"> <br />
<show-link>false</show-link> <br />
<action idref="delete_space" hide="true" /><br />
</action-group><br />
<br />
<action-group id="browse_actions_menu"><br />
<show-link>false</show-link> <br />
<action idref="delete_space" hide="true" /><br />
</action-group><br />
<br />
<br />
<action-group id="doc_details_actions"> <br />
<action idref="delete_doc" hide="true" /><br />
</action-group> <br />
<br />
<br />
<action-group id="space_details_actions"> <br />
<action idref="delete_space" hide="true" /><br />
</action-group><br />
<br />
<action-group id="document_browse"> <br />
<show-link>false</show-link> <br />
<action idref="delete_doc" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="document_browse_menu"> <br />
<action idref="delete_space" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="space_browse_menu"> <br />
<action idref="delete_space" hide="true" /><br />
</action-group> <br />
<br />
</actions> <br />
</config> <br />
<br />
<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Here i added code to hide copy & cut options on space and document in alfresco, add the following code in <b>web-client-config-custom.xml</b></div><br />
<config> <br />
<actions> <br />
<action-group id="space_browse"> <br />
<show-link>false</show-link> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group><br />
<br />
<action-group id="browse_actions_menu"><br />
<show-link>false</show-link> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="doc_details_actions"> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="space_details_actions"> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group><br />
<br />
<action-group id="document_browse"> <br />
<show-link>false</show-link> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="document_browse_menu"> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group> <br />
<br />
<action-group id="space_browse_menu"> <br />
<action idref="cut_node" hide="true" /><br />
<action idref="copy_node" hide="true" /><br />
</action-group> <br />
</actions><br />
</config>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com2tag:blogger.com,1999:blog-2941319944694615842.post-37737013356174348062010-04-19T17:17:00.004+05:302010-09-14T16:52:53.849+05:30Alfresco Outlook configuration for IMAPFollow these steps to configure outlook send mail to alfresco<br />
<br />
<b>step1: </b> go to C:\Windows\System32\drivers\etc<br />
<br />
here add server name. just for testing i added chandu.com as follows<br />
<br />
127.0.0.1<span class="Apple-tab-span" style="white-space: pre;"> </span>chandu.com<br />
<br />
<b>Step2: </b> next open Microsoft outlook ., select tools > account settings.<br />
<br />
click on new ... it will open a wind follow some steps to add a new account<br />
<br />
<b>a</b>.select Microsoft POP3,IMAP, HTTP.... click next<br />
<b>b</b>. select manually configure server settings...... click next<br />
<b>c</b>.select internet Email<br />
<b>d</b>.fill the details as follows<br />
----------------------------------------------------------------------------------<br />
your name : pradeep<br />
EmailAdd : pradeep@chandu.com<br />
Server Information<br />
Account Type : IMAP<br />
Incoming mail Ser : chandu.com<br />
Outgoing Mail ser : chandu.com<br />
Logon Information<br />
username : pradeep<br />
password : *********<br />
-----------------------------------------------------------------------------------<br />
<br />
Click on next and finish.<br />
<br />
<b>Step3:</b> all the above configuration is in outlook now., just login to alfresco go to Administration Console<br />
Click on Manage system users --> create user<br />
<br />
then fill the new wizard details., make sure that email id is <b>pradeep@chandu.com</b><br />
<b><br />
</b><br />
just finish that wizard.<br />
<br />
<b>Step4: </b> then go to company home and create one space., name it as you like., here i am creating the space with the name <b>mycompany.</b><br />
<b> </b> click on mycompany -- > view details --> manage space users --> invite user.<br />
search for the user pradeep and add that user as contributor or what ever that you want but make sure about permissions,<b> </b><br />
<b><br />
</b><br />
<b>Step5: </b>go to mycompany space and go to view details and click on run action ., it will open run action wizard<br />
select add aspect and click on set values and add, select Email Alias , then click on next and finish that wizard.<br />
next edit this space property., and create Email Alias as some <b>companyadmin</b><br />
<br />
<br />
<td><br />
</td><td class="propertiesLabel"><br />
</td><b>Step6:</b> go to \tomcat\shared\classes\alfresco\extension<br />
<br />
unzip the custom-email-server.sample.zip file and change custom-email-server.properties as follows<br />
<br />
<br />
# Email Server properties<br />
email.server.enabled=true<br />
email.server.port=25<br />
email.server.domain=chandu.com<br />
<br />
<b>Step7: </b>go to \tomcat\shared\classes ---- > alfresco-global.properties uncomment these lines.<br />
<br />
<b></b><br />
<b><span class="Apple-style-span" style="font-weight: normal;"># IMAP</span><br />
<span class="Apple-style-span" style="font-weight: normal;">#-------------</span><br />
<span class="Apple-style-span" style="font-weight: normal;">imap.server.enabled=true</span><br />
<span class="Apple-style-span" style="font-weight: normal;">imap.server.port=143</span><br />
<span class="Apple-style-span" style="font-weight: normal;">imap.server.host=localhost</span></b><br />
<br />
<b>Step8: </b>restart the server and go to outlook to compose a mail ., with to address as companyadmin@chandu.com.<br />
you will get mail as document in mycompany space. and also you can find the alfresco folders in outlook.<br />
<br />
<br />
here some information is available and also screen shots also .<br />
<br />
<a href="http://wiki.alfresco.com/wiki/IMAP">http://wiki.alfresco.com/wiki/IMAP</a><br />
<b><br />
</b><br />
<b> </b>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com5tag:blogger.com,1999:blog-2941319944694615842.post-83138271535380614462010-04-19T10:58:00.013+05:302010-04-19T12:41:06.987+05:30Creating a new Alfresco module to change the Alfresco Footer.Hi., Here I am going to explain about to change the default footer of alfresco.<br />
<br />
follow the below steps .<br />
<br />
<b>Step1:</b> Create java project with the structure as shown below in eclipse<br />
<div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzogkYqobcG5IQobkZ8-vt1l5sQpeOtyWSbKb1JWcefYe5ZT_s97ITOuEfxpXqH5ulyk1vQQvd1s_U5k0NTf9fDdazADbOjqUshlLZhAtTRZdnJZRnFvw5geT0iAt8sat58XKytErrFCg/s1600-h/AMP-Struct.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzogkYqobcG5IQobkZ8-vt1l5sQpeOtyWSbKb1JWcefYe5ZT_s97ITOuEfxpXqH5ulyk1vQQvd1s_U5k0NTf9fDdazADbOjqUshlLZhAtTRZdnJZRnFvw5geT0iAt8sat58XKytErrFCg/s400/AMP-Struct.bmp" /></a></div><br />
<br />
<b>Step2:</b> Import the Alfresco related files to change the UI of it.suppose here i want to change login page and the footer of the alfresco so., lets start to import the files to alfresco as shown below with below structure.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8oeFAM6o1DVGYV7fAdT9upmDNKtII02HoA70hyphenhyphenWuDFbmmchjw8bCl3E0gaFWn5kh_rD8BIIl0Tq5oSlMGP1KvybrMIm4R2TH4kBMVagds0cykx9ejqzT0Bc1Dff6_bxWTbX29RgrRnKM/s1600/footer1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8oeFAM6o1DVGYV7fAdT9upmDNKtII02HoA70hyphenhyphenWuDFbmmchjw8bCl3E0gaFWn5kh_rD8BIIl0Tq5oSlMGP1KvybrMIm4R2TH4kBMVagds0cykx9ejqzT0Bc1Dff6_bxWTbX29RgrRnKM/s400/footer1.PNG" width="247" /></a></div><div class="separator" style="clear: both; text-align: left;"><b>Step3:</b> copy the below code for build.xml file.</div><br />
<?xml version="1.0"?><br />
<br />
<project name="Sample Module" default="package-amp" basedir="."><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property name="project.dir" value="." /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property file="${project.dir}/build.properties" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property file="${project.dir}/module.properties" /><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property name="build.dir" value="${project.dir}/build" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property name="config.dir" value="${project.dir}/config" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property name="jar.file" value="${build.dir}/lib/${module.id}.jar" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property name="amp.file" value="${build.dir}/dist/${module.id}.amp" /><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><target name="mkdirs"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/dist" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/lib" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><mkdir dir="${build.dir}/classes" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></target><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><path id="class.path"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><dirset dir="${build.dir}" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}/lib" includes="**/*.jar" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><!-- fileset dir="${alfresco.sdk.dir}/lib/server" includes="**/*.jar" / --><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></path><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><target name="clean"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><delete dir="${build.dir}" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></target><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><target name="compile" depends="mkdirs"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><javac classpathref="class.path" debug="${debug}" srcdir="${project.dir}/source/java" destdir="${build.dir}/classes" target="1.5" encoding="UTF-8" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><copy todir="${build.dir}/classes"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}/source/java" defaultexcludes="false"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/*.java" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/.svn/**" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="**/CVS/**" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></fileset><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></copy><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></target><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><target name="package-jar" depends="compile"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><jar destfile="${jar.file}" encoding="UTF-8"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" defaultexcludes="false" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></jar><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></target><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><target name="package-amp" depends="package-jar" description="Package the Module"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><zip destfile="${amp.file}" encoding="UTF-8"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}/build" includes="lib/*.jar" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><fileset dir="${project.dir}"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><include name="module.properties" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><include name="file-mapping.properties" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><include name="WEB-INF/**/*" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="WEB-INF/alfresco.tld" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><exclude name="WEB-INF/repo.tld" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></fileset><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><zipfileset dir="source/web" prefix="web" /><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></zip><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></target><br />
</project><br />
<br />
<b>Step4: </b>for pagetag.java., copy the below code ., and change the code as follows., which is high lated in red color.<br />
-------------------------------------------------------------------------------------------------------------<br />
<br />
<span class="Apple-style-span" style="font-family: monospace; white-space: pre-wrap;">/*</span><br />
<pre style="white-space: pre-wrap; word-wrap: break-word;">* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses>.
*/
package org.alfresco.web.ui.repo.tag;
import java.io.IOException;
import java.io.Writer;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.coci.CCProperties;
import org.alfresco.web.config.ClientConfigElement;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A non-JSF tag library that adds the HTML begin and end tags if running in servlet mode
*
* @author gavinc
*/
public class PageTag extends TagSupport
{
private static final long serialVersionUID = 8142765393181557228L;
private final static String SCRIPTS_START = "<script final="" private="" scripts_end="\" src="\"";" static="" string="" type="\"text/javascript\"">
</script>\n";
private final static String STYLES_START = "<link final="" href="\"";" private="" rel="\"stylesheet\"" static="" string="" styles_main="\" type="\"text/css\""></link>\n";
private final static String[] SCRIPTS =
{
// menu javascript
"/scripts/menu.js",
// webdav javascript
"/scripts/webdav.js",
// base yahoo file
"/scripts/ajax/yahoo/yahoo/yahoo-min.js",
// io handling (AJAX)
"/scripts/ajax/yahoo/connection/connection-min.js",
// event handling
"/scripts/ajax/yahoo/event/event-min.js",
// mootools
"/scripts/ajax/mootools.v1.11.js",
// common Alfresco util methods
"/scripts/ajax/common.js",
// pop-up panel helper objects
"/scripts/ajax/summary-info.js",
// ajax pickers
"/scripts/ajax/picker.js",
"/scripts/ajax/tagger.js"
};
private final static String[] CSS =
{
"/css/main.css",
"/css/picker.css"
};
/**
* Please ensure you understand the terms of the license before changing the contents of this file.
*/
private final static String ALF_LOGO_HTTP = "<b><span class="Apple-style-span" style="color: #cc0000;">http://www.alfresco.com/assets/images/logos/community-edition-3.3.png</span></b>";
private final static String ALF_LOGO_HTTPS = "<span class="Apple-style-span" style="color: #cc0000;"><b>https://www.alfresco.com/assets/images/logos/community-edition-3.3.png</b></span>";
private final static String ALF_URL = "<span class="Apple-style-span" style="color: #cc0000;"><b>http://www.alfresco.com</b></span>";
private final static String ALF_TEXT = "<span class="Apple-style-span" style="color: #cc0000;"><b>Alfresco Community</b></span>";
private final static String ALF_COPY = "<span class="Apple-style-span" style="color: #cc0000;"><b>Supplied free of charge with " +
"<a class="footer" href="http://www.alfresco.com/services/support/communityterms/#support">no support</a>, " +
"<a class="footer" href="http://www.alfresco.com/services/support/communityterms/#certification">no certification</a>, " +
"<a class="footer" href="http://www.alfresco.com/services/support/communityterms/#maintenance">no maintenance</a>, " +
"<a class="footer" href="http://www.alfresco.com/services/support/communityterms/#warranty">no warranty</a> and " +
"<a class="footer" href="http://www.alfresco.com/services/support/communityterms/#indemnity">no indemnity</a> by " +
"<a class="footer" href="http://www.alfresco.com/">Alfresco</a> or its " +
"<a class="footer" href="http://www.alfresco.com/partners/">Certified Partners</a>. " +
"<a class="footer" href="http://www.alfresco.com/services/support/">Click here for support</a>. " +
"Alfresco Software Inc. © 2005-2010 All rights reserved.</b></span>";
private final static Log logger = LogFactory.getLog(PageTag.class);
private static String alfresco = null;
private static String loginPage = null;
private long startTime = 0;
private String title;
private String titleId;
private String doctypeRootElement;
private String doctypePublic;
private String doctypeSystem;
/**
* @return The title for the page
*/
public String getTitle()
{
return title;
}
/**
* @param title Sets the page title
*/
public void setTitle(String title)
{
this.title = title;
}
/**
* @return The title message Id for the page
*/
public String getTitleId()
{
return titleId;
}
/**
* @param titleId Sets the page title message Id
*/
public void setTitleId(String titleId)
{
this.titleId = titleId;
}
public String getDoctypeRootElement()
{
return this.doctypeRootElement;
}
public void setDoctypeRootElement(final String doctypeRootElement)
{
this.doctypeRootElement = doctypeRootElement;
}
public String getDoctypePublic()
{
return this.doctypePublic;
}
public void setDoctypePublic(final String doctypePublic)
{
this.doctypePublic = doctypePublic;
}
public String getDoctypeSystem()
{
return this.doctypeSystem;
}
public void setDoctypeSystem(final String doctypeSystem)
{
this.doctypeSystem = doctypeSystem;
}
public void release()
{
super.release();
this.title = null;
this.titleId = null;
this.doctypeRootElement = null;
this.doctypeSystem = null;
this.doctypePublic = null;
}
/**
* @see javax.servlet.jsp.tagext.TagSupport#doStartTag()
*/
public int doStartTag() throws JspException
{
if (logger.isDebugEnabled())
startTime = System.currentTimeMillis();
try
{
String reqPath = ((HttpServletRequest)pageContext.getRequest()).getContextPath();
Writer out = pageContext.getOut();
if (!Application.inPortalServer())
{
if (this.getDoctypeRootElement() != null &&
this.getDoctypePublic() != null)
{
out.write("\n");
}
else
{
out.write("\n");
}
out.write("\n");
out.write("<link +="" api="" description.xml\"="" href="\""" keyword="" rel="\"search\"" reqpath="" search="" search\"="" title="\"Alfresco" type="\"application/opensearchdescription+xml\"" wcservice=""></link>\n");
out.write("\n");
out.write("\n");
}
// CSS style includes
for (final String css : PageTag.CSS)
{
out.write(STYLES_START);
out.write(reqPath);
out.write(css);
out.write(STYLES_MAIN);
}
// JavaScript includes
for (final String s : PageTag.SCRIPTS)
{
out.write(SCRIPTS_START);
out.write(reqPath);
out.write(s);
out.write(SCRIPTS_END);
}
out.write("<script type="\"text/javascript\"">
"); // start - generate naked javascript code
// get client config to determine how the JavaScript setContextPath should behave
ClientConfigElement clientConfig = Application.getClientConfig(pageContext.getServletContext());
// set the context path used by some Alfresco script objects
if (clientConfig != null && clientConfig.getCheckContextAgainstPath())
{
out.write("setCheckContextAgainstPath(true);");
}
out.write("setContextPath('");
out.write(reqPath);
out.write("');");
// generate window onload code
generateWindowOnloadCode(out);
out.write("
</script>\n"); // end - generate naked javascript code
if (!Application.inPortalServer())
{
out.write("");
out.write("\n");
}
}
catch (IOException ioe)
{
throw new JspException(ioe.toString());
}
return EVAL_BODY_INCLUDE;
}
/**
* @see javax.servlet.jsp.tagext.TagSupport#doEndTag()
*/
public int doEndTag() throws JspException
{
try
{
HttpServletRequest req = (HttpServletRequest)pageContext.getRequest();
if (req.getRequestURI().endsWith(getLoginPage()) == false)
{
pageContext.getOut().write(getAlfrescoButton());
}
if (!Application.inPortalServer())
{
pageContext.getOut().write("\n");
}
}
catch (IOException ioe)
{
throw new JspException(ioe.toString());
}
if (logger.isDebugEnabled())
{
long endTime = System.currentTimeMillis();
logger.debug("Time to generate page: " + (endTime - startTime) + "ms");
}
return super.doEndTag();
}
private String getLoginPage()
{
if (PageTag.loginPage == null)
{
PageTag.loginPage = Application.getLoginPage(pageContext.getServletContext());
}
return PageTag.loginPage;
}
/**
* Please ensure you understand the terms of the license before changing the contents of this file.
*/
private String getAlfrescoButton()
{
if (PageTag.alfresco == null)
{
final HttpServletRequest req = (HttpServletRequest)pageContext.getRequest();
</http://www.gnu.org/licenses></pre><pre style="white-space: pre-wrap; word-wrap: break-word;"><http://www.gnu.org/licenses>PageTag.alfresco = ("<center><table style='margin: 0px auto;'><tr><td>"
"<a href='" ALF_URL "'>"
"<img style='vertical-align:middle;border-width:0px;' alt='' title='" ALF_TEXT
"' src='" reqPath ALF_LOGO "'/>"
"</a></td><td align='center'>"
"<span class='footer'>" ALF_COPY
"</span></td><td>"
"</td></tr></table></center>");
}
return PageTag.alfresco;
}
/**
* This method generate code for setting window.onload reference as
* we need to open WebDav or CIFS URL in a new window.
*
* Executes via javascript code(function onloadFunc()) in "onload.js" include file.
*
* @return Returns window.onload javascript code
*/
private static void generateWindowOnloadCode(Writer out)
throws IOException
{
FacesContext fc = FacesContext.getCurrentInstance();
if (fc != null)
{
CCProperties ccProps = (CCProperties)FacesHelper.getManagedBean(fc, "CCProperties");
if (ccProps.getWebdavUrl() != null || ccProps.getCifsPath() != null)
{
out.write("window.onload=onloadFunc(\"");
if (ccProps.getWebdavUrl() != null)
{
out.write(ccProps.getWebdavUrl());
}
out.write("\",\"");
if (ccProps.getCifsPath() != null)
{
String val = ccProps.getCifsPath();
val = Utils.replace(val, "\\", "\\\\"); // encode escape character
out.write(val);
}
out.write("\");");
// reset session bean state
ccProps.setCifsPath(null);
ccProps.setWebdavUrl(null);
}
}
}
}</http://www.gnu.org/licenses></pre><pre style="white-space: pre-wrap; word-wrap: break-word;">----------------------------------------------------------------------------------</pre><pre style="white-space: pre-wrap; word-wrap: break-word;"></pre><pre style="white-space: pre-wrap; word-wrap: break-word;"></pre><pre style="white-space: pre-wrap; word-wrap: break-word;"></pre><pre style="white-space: pre-wrap; word-wrap: break-word;"><b>here i want to change the following code to change the footer of alfresco.</b></pre><pre style="white-space: pre-wrap; word-wrap: break-word;"></pre><pre style="word-wrap: break-word;"><span class="Apple-style-span" style="white-space: pre-wrap;">
private final static String ALF_URL = "<a href="http://aboutalfresco.blogspot.com/">http://aboutalfresco.blogspot.com/</a>";
private final static String ALF_LOGO = "/images/MySite/footer_logo.gif";
private final static String ALF_TEXT = "Chandu Enterprise";
private final static String ALF_COPY = "Certified and supported. Chandu Software Inc. © 2005-2009 All rights reserved.";</span></pre><pre style="word-wrap: break-word;"><span class="Apple-style-span" style="white-space: pre-wrap;">
</span></pre></div><b>Step5</b>: add these jar files in lib<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3OLIE52-yG8ySYAAx-Of7KOU2KvfTFM-p1Yphrefa36De1iwDq6X2Aumbpvobm0Gb_o9FVggV_bwya_T9xwtNJtP82-vJRRfRtYwyPDEdBGMgiTa0fJVR4t8_x4y6G5kgMXPtzss1xIY/s1600/libs.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3OLIE52-yG8ySYAAx-Of7KOU2KvfTFM-p1Yphrefa36De1iwDq6X2Aumbpvobm0Gb_o9FVggV_bwya_T9xwtNJtP82-vJRRfRtYwyPDEdBGMgiTa0fJVR4t8_x4y6G5kgMXPtzss1xIY/s320/libs.PNG" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step6: </b>change remaining files as per our requirement., here i changed login.jsp, relogin.jsp, getting-started.jsp, titlebar.jsp, error.jsp, noaccess.jsp.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step7:</b> add the below code in module.properties.</div><div class="separator" style="clear: both; text-align: left;"><b><br />
</b></div><div class="separator" style="clear: both; text-align: left;"><b></b></div><b></b><br />
<b></b><br />
<b></b><br />
<b></b><br />
<b><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;">module.id=MySite-AlfrescoNewUI</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;">module.title=MySite UI Project</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;">module.description=MySite Project to build an amp file</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;">module.version=1.0</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><br />
</span></div><div class="separator" style="clear: both; text-align: left;">Step8:<span class="Apple-style-span" style="font-weight: normal;"> Then go to build.xml ., right click on it then click on run as ant build. you will get the amp file in dist.as shown below.</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><br />
</span></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><br />
</span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjK2X1x3z130T3td8RRJrVBXKg12gvGb7gAeFsMhIMZv7svZqnMm3OB2-ASc4x-POLw31EggbQ5UigyK0pbq5wTl6an25vGgK1wD89pzmx9lzDQqRPsBB_JzS0Jouzcc3mA7JEhedgm8/s1600/amp.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjK2X1x3z130T3td8RRJrVBXKg12gvGb7gAeFsMhIMZv7svZqnMm3OB2-ASc4x-POLw31EggbQ5UigyK0pbq5wTl6an25vGgK1wD89pzmx9lzDQqRPsBB_JzS0Jouzcc3mA7JEhedgm8/s320/amp.PNG" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Step9: <span class="Apple-style-span" style="font-weight: normal;">paste this amp file in to alfresco amp folder and click on apply_amps., then restart the server you can find the changes what you made.</span></div></b><br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com2tag:blogger.com,1999:blog-2941319944694615842.post-8753830227724818032010-04-07T20:08:00.001+05:302010-04-07T20:09:09.833+05:30Access the full Alfresco repository from the Share user interfaceAlfresco 3.2r introduces the ability to access the full alfresco repo from share user interface<br />
<br />
Here few steps are there.<br />
<br />
step1: go to to tomcat\shared\classes\alfresco\web-extension<br />
step2: rename the share-config-custom.xml.sample to share-config-custom.xml<br />
step3: change the xml file as shown below which is marked in red color.<br />
<br />
<br />
<config evaluator="string-compare" condition="RepositoryLibrary" replace="true"><br />
<!--<br />
Whether the link to the Repository Library appears in the header component or not.<br />
--><br />
<visible><b><span class="Apple-style-span" style="color: red;">true</span></b></visible><br />
<br />
<!--<br />
Root nodeRef for top-level folder.<br />
--><br />
<root-node>alfresco://company/home</root-node><br />
<br />
<!--<br />
Whether the folder Tree component should enumerate child folders or not.<br />
This is a relatively expensive operation, so should be set to "false" for Repositories with broad folder structures.<br />
--><br />
<tree><br />
<evaluate-child-folders>false</evaluate-child-folders><br />
</tree><br />
</config><br />
<br />
step4: restart the server, then go to share admin dashboard you will find the screen as follows then click on repository.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Vd9rlRzlMq5L1Cp7spMNW_k-olRvnWq3K15KbGpI6bDW4ja_S-JOlWHwiMYJbiWLpAQ7eP5bOzwSyMYIx47sDWkTx7o7vxod-c_IW6KIoWt-CYQN3CpvXFJAjwhmGgSJx0He9PHiECw/s1600/rep1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="21" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Vd9rlRzlMq5L1Cp7spMNW_k-olRvnWq3K15KbGpI6bDW4ja_S-JOlWHwiMYJbiWLpAQ7eP5bOzwSyMYIx47sDWkTx7o7vxod-c_IW6KIoWt-CYQN3CpvXFJAjwhmGgSJx0He9PHiECw/s320/rep1.PNG" width="320" /></a></div><br />
step5: in the left side of the screen you can find the alfresco repository files as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtKwTPA18cOFIutKpMdjVMhDrhmCyBnlf9fYr0EMVlHMFMt3hmvz6nT8orhEVDY2GVpzlgx928N1U5y5FVifPzaAXaE_LK6Xdp6CqP9T7u5O-jytKPZBHRXVhohcPv_xt28X4Wd2H7jQU/s1600/rep2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtKwTPA18cOFIutKpMdjVMhDrhmCyBnlf9fYr0EMVlHMFMt3hmvz6nT8orhEVDY2GVpzlgx928N1U5y5FVifPzaAXaE_LK6Xdp6CqP9T7u5O-jytKPZBHRXVhohcPv_xt28X4Wd2H7jQU/s400/rep2.PNG" width="400" /></a></div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com1tag:blogger.com,1999:blog-2941319944694615842.post-83730451151780034792010-03-30T11:39:00.005+05:302010-04-01T12:03:11.669+05:30Alfresco Record ManagementHere i am going to explain about Record Management in alfresco.<br />
<br />
Here is the nice Introduction about Record Management.<br />
<br />
<div id="__ss_565275" style="width: 425px;"><object height="355" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=080408-alfresco-records-management-1219420089762992-8&stripped_title=alfresco-records-management-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=080408-alfresco-records-management-1219420089762992-8&stripped_title=alfresco-records-management-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><br />
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/alfresco">Alfresco Software</a>.</div></div><br />
generally we have community edition and enterprise edition., <br />
<br />
for community user download the amp from here.., <a href="http://process.alfresco.com/ccdl/?file=release/community/build-2440/AlfrescoRMCommunity-3.2r2-Setup.exe">http://process.alfresco.com/ccdl/?file=release/community/build-2440/AlfrescoRMCommunity-3.2r2-Setup.exe</a><br />
<br />
here i am using 3.2r verion., if you are an enterprise user you can download from amp files from <a href="https://network.alfresco.com/">network.alfresco.com</a><br />
<br />
but there are some issues while using this amp., better to go for community edition.<br />
<br />
follow these steps to RM in share<br />
<br />
<b>1</b>.after installing alfresco RM module, go to share and login as admin with valid credentials.<br />
<br />
<b>2</b>.click on customise-dashboard link <br />
<br />
<b>3</b>. add RecordManagement config dashlet as shown below..<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOaqEAkijxatq-8-mdmogHkwVV9KJWSKqyXxbCdv2K1zjSurnfoprAxyhEXdAibjQJBsMarGPoqmozj-FYW-Fr5KE8oy76acmU70aVlkn_lwobsmC-6hlvGZxeaMY7icyMfFcSGUI7-Us/s1600/rm6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOaqEAkijxatq-8-mdmogHkwVV9KJWSKqyXxbCdv2K1zjSurnfoprAxyhEXdAibjQJBsMarGPoqmozj-FYW-Fr5KE8oy76acmU70aVlkn_lwobsmC-6hlvGZxeaMY7icyMfFcSGUI7-Us/s320/rm6.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>4</b>.You will get a this dashlet in share administrator Dashboard as shown below.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikuTmNf2FTtd-LTmFQBy3NSKsoij7WdQuA6AAasc02uV4mTTT6SCb9Zble-4FRiFUtG5kWbVEO-RnZ8QFI1-z3FFiq7krhnBEMkzbr1rspMIeHZpRgrLU6WWvn4-qc5a2MH6X4qXIW6dk/s1600/rm1+-+Copy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikuTmNf2FTtd-LTmFQBy3NSKsoij7WdQuA6AAasc02uV4mTTT6SCb9Zble-4FRiFUtG5kWbVEO-RnZ8QFI1-z3FFiq7krhnBEMkzbr1rspMIeHZpRgrLU6WWvn4-qc5a2MH6X4qXIW6dk/s320/rm1+-+Copy.png" /></a></div><div style="text-align: center;"><br />
</div><div style="text-align: left;"><b>5</b>. Click on Record Management Site u can find the screen as follows....</div><div style="text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOGXnFUL1UUlTLJYAs1vRpDwhlVB70WbzxwY2KMXqVh2INe7BhTxoEHl7sebxQ4U0A63NdOdmwkna52jUn3JyC6KolFzMLS1_Fo0clIiIMWsz-rIL5nB4Jm2DC83J6qzFYxQ6ayyag8do/s1600/rm10.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOGXnFUL1UUlTLJYAs1vRpDwhlVB70WbzxwY2KMXqVh2INe7BhTxoEHl7sebxQ4U0A63NdOdmwkna52jUn3JyC6KolFzMLS1_Fo0clIiIMWsz-rIL5nB4Jm2DC83J6qzFYxQ6ayyag8do/s320/rm10.PNG" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>6</b>. Here i attached one document for RM brief Introduction., which will explain about alfresco RM in share</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><a href="https://docs.google.com/fileview?id=0B4eGuhizb70zNDljMTA4NmMtZjVmYi00OTg0LThkMjYtNTZhYmM0NTc1ZGJm&hl=en">Alfresco_Enterprise_Edition_Getting_Started_with_RM.pdf</a>.,</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>7</b>. and video tutorial here.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><object height="385" width="640"><param name="movie" value="http://www.youtube.com/v/8lJ0olr5sC8&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/8lJ0olr5sC8&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><a href="http://www.blogger.com/"></a><span id="goog_1451340036"></span><span id="goog_1451340037"></span></div><div style="text-align: left;"><br />
</div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com3tag:blogger.com,1999:blog-2941319944694615842.post-30777003408075619052010-03-13T11:56:00.008+05:302010-04-26T16:07:57.736+05:30Alfresco Video Tutorials<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Custom Data Lists in Alfresco 3.3</h1><br />
<object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/XGpJwzldB0Q"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/XGpJwzldB0Q" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object><br />
<br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Try Create Record Categories, Set Security and Configure Disposition Schedules</h1><br />
<object style="height: 344px; width: 425px;"><param name="movie" value="http://www.youtube.com/v/jWEaNFzyZh4"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/jWEaNFzyZh4" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object><br />
<br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Alfresco Records Management Administration Console</h1><br />
<object style="height: 344px; width: 425px;"><param name="movie" value="http://www.youtube.com/v/8lJ0olr5sC8"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/8lJ0olr5sC8" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object><br />
<br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Spring Surf and OpenCMIS Integration</h1><br />
<object style="height: 344px; width: 425px;"><param name="movie" value="http://www.youtube.com/v/1ZpAqXXbxmk&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/1ZpAqXXbxmk&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object><br />
<br />
<br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">latest rules UI In Alfresco Share</h1><br />
<object style="height: 344px; width: 425px;"><param name="movie" value="http://www.youtube.com/v/e5GRVM5Q4Wo"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/e5GRVM5Q4Wo" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object><br />
<br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold;"></span><br />
<h1 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 19px; font-weight: bold; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 5px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Installing Alfresco on Windows</h1><br />
<objectstyle="height: 344px;="" 425px"="" width:=""><embed allowfullscreen="true" allowscriptaccess="always" height="344" src="http://www.youtube.com/v/MG49_RSQb3k&hl=en_US&fs=1&rel=0&color1=0x234900&color2=0x4e9e00" type="application/x-shockwave-flash" width="425"></embed><br />
<br />
</objectstyle="height:>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-68831714078931699562010-02-23T12:51:00.002+05:302010-02-23T14:38:03.629+05:30Accessing Alfresco repository in Share.Hi, Here i am trying to explain how to access alfresco repository in alfresco share.<br />
<br />
Here i am going to create a dashlet that will display all the spaces and content for particular site based upon site name.<br />
<br />
(note: every time alfresco will create space or content in Company Home > Sites , which is depends upon site activities in alfresco share.)<br />
<br />
<br />
<b>Step1:</b> Create a site in share, name it as chandu as follows<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB5C2Xf1VuI0nJS2-0Qw3DtL8-BKa7Wzc9kYqH-hx0G9WWttHyXx54Vnp8xN02Ltt7uDwT8_V05CUUz4NHKgrB-Dq7RNU2Ge0hWTx7jQFSQOAav8HYfw_Sd9-a8U8831g75yJI-Rwu7TU/s1600-h/site1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB5C2Xf1VuI0nJS2-0Qw3DtL8-BKa7Wzc9kYqH-hx0G9WWttHyXx54Vnp8xN02Ltt7uDwT8_V05CUUz4NHKgrB-Dq7RNU2Ge0hWTx7jQFSQOAav8HYfw_Sd9-a8U8831g75yJI-Rwu7TU/s320/site1.bmp" /></a></div><br />
<br />
<b>Step2:</b> next go to alfresco and create webscript in alfreso for that we need two files create those two files <br />
<br />
a)siteacts.get.desc.xml<br />
b)siteacts.get.json.ftl<br />
<br />
code to add in siteacts.get.desc.xml<br />
-------------------------------------------------------------------------------------------------------<br />
<webscript><br />
<shortname>Document Property</shortname><br />
<description>It provides documents name and date of creation and Creator property</description><br />
<url>/sample/siteacts.json?siteName={sitename)</url><br />
<authentication>user</authentication><br />
<transaction>required</transaction><br />
</webscript> <br />
--------------------------------------------------------------------------------------------------------<br />
<br />
code to add in siteacts.get.json.ftl<br />
---------------------------------------------------------------------------------------------------------<br />
{<br />
<#assign dateformat="yyyy/MM/dd"><br />
"siteacts" : [<br />
<br />
<#macro recurse_macro node><br />
<br />
<#if node.isContainer><br />
{<br />
"name" : "${node.properties.name}" ,<br />
<br />
"creator" : "${node.properties.creator}",<br />
<br />
"createdDate" : "${node.properties.created?string(dateformat)}"<br />
},<br />
<br />
<#list node.children as child><br />
<#if child.isContainer><br />
<@recurse_macro node=child/><br />
<#else><br />
{ <br />
"name" : "${child.properties.name}" ,<br />
<br />
"creator" : "${child.properties.creator}",<br />
<br />
"createdDate" : "${child.properties.created?string(dateformat)}"<br />
}<br />
,</#if><br />
</#list><br />
</#if><br />
</#macro><br />
<br />
<@recurse_macro node=companyhome.childByNamePath["Sites/${args.siteName}"] /><br />
<br />
]<br />
}<br />
----------------------------------------------------------------------------------------------------------- <br />
<b>Step3:</b> add these two files into<br />
Company Home > Data Dictionary > Web Scripts > org > alfresco > sample <br />
<br />
Refresh the webscripts , for this go to http://localhost:8080/alfresco/service/, click on <span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">Click on Refresh Web Scripts.</span></span><br />
<br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">if is it successfully completed you will get the message like</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;"> </span></span><br />
<b>Maintenance Completed</b><br />
Reset Web Scripts Registry; registered 335 Web Scripts. Previously, there were 334.<br />
<br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;"> then check the webscript using below URI</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;"><br />
</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">http://localhost:8080/alfresco/service/sample/siteacts.json?siteName=chandu</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;"><br />
</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">here add the name of the site that you need. in my case it is chandu.</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;"><br />
</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">you will get the output will be like this</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">------------------------------------------------------------------------------------------------------------------------------</span></span><br />
<span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS',Trebuchet,Verdana,sans-serif; font-size: 13px;">{<br />
"siteacts" : [<br />
<br />
<br />
<br />
{<br />
"name" : "chandu" ,<br />
<br />
"creator" : "admin",<br />
<br />
"createdDate" : "2010/02/23"<br />
},<br />
<br />
<br />
{<br />
"name" : "documentLibrary" ,<br />
<br />
"creator" : "admin",<br />
<br />
"createdDate" : "2010/02/23"<br />
},<br />
<br />
<br />
<br />
{<br />
"name" : "links" ,<br />
<br />
"creator" : "admin",<br />
<br />
"createdDate" : "2010/02/23"<br />
},<br />
<br />
<br />
<br />
]<br />
}</span></span><br />
------------------------------------------------------------------------------------------------------<br />
<br />
<b>Step4:</b> next step is to create dashlet in the share. for that we need three files.<br />
<br />
a)siteacts.get.desc.xml<br />
b)siteacts.get.html.ftl<br />
c)siteacts.get.js<br />
<br />
code for siteacts.get.desc.xml<br />
-----------------------------------------------------------------------------------------<br />
<webscript><br />
<shortname>Site Activities</shortname><br />
<description>Dashlet to list Site Activities from Alfresco</description><br />
<family>site-dashlet</family><br />
<url>/components/dashlets/siteactivites</url><br />
</webscript><br />
-------------------------------------------------------------------------------------------<br />
note that here i added this as site dashlet not a user dashlet. code to add in siteacts.get.js<br />
<br />
----------------------------------------------------------------------------------------<br />
var connector = remote.connect("alfresco");<br />
var data = connector.get("/sample/siteacts.json?siteName=" + page.url.templateArgs.site);<br />
<br />
// create json object from data<br />
var result = eval('(' + data + ')');<br />
model.siteactivites= result["siteacts"];<br />
------------------------------------------------------------------------------------------<br />
code to add in siteacts.get.html.ftl<br />
------------------------------------------------------------------------------------<br />
<table><br />
<tr><br />
<th>Name </th><br />
<th>Creator </th><br />
<th>Date of Creation </th><br />
</tr><br />
<#list siteactivites as x><br />
<tr><br />
<td>${x.name}</td><br />
<td>${x.creator}</td><br />
<td>${x.createdDate}</td><br />
</tr><br />
</#list><br />
</table> <br />
------------------------------------------------------------------------------------<br />
place all these files into<br />
<root>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\dashlets</root><br />
<br />
<br />
<b>Step5</b>: next refresh the share webscripts using this URI http://localhost:8080/share/service/<br />
<br />
click on refresh webscripts. is it is successes you will get the message like. as follows <br />
<br />
<b>Maintenance Completed</b><br />
Reset Web Scripts Registry; registered 176 Web Scripts. Previously, there were 175.<br />
<br />
next go to the site http://localhost:8080/share/page/site/chandu/dashboard<br />
<br />
click on customise dashboard ., and add dashlet in to the site .<br />
<br />
<br />
the dashlet will be updated if any activites performed on this site.<br />
<br />
download the entire code here <a href="http://www.4shared.com/file/227981384/1fa03c41/siteacts-webscript.html">download code</a> .CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com4tag:blogger.com,1999:blog-2941319944694615842.post-78430886271929070432010-02-04T17:31:00.025+05:302010-06-16T18:30:02.741+05:30Creating New Model And Advance Search Configuration.We can add new Models in Alfresco with two ways.<br />
<br />
<b>Procedure-1</b>:<br />
Create a new model XML file with the name exampleModel.xml ( although this may be any name as required). register this model with the repository by using another file called example-model-context.xml.<br />
create one properties file as webclient.properties.and add property sheet for model in web-client-config-custom.xml.<br />
place these files in to <root>\tomcat\shared\classes\alfresco\extension.</root><br />
restart the server and you will get the new model values in alfresco.<br />
<b>Procedure-2: </b> <br />
here also we need to create model file exampleModel.xml, webclient.properties, web-client-config-custom.xml.but place the exampleModel.xml into Data Dictionary > Models<br />
and webclient.properties, web-client-config-custom.xml into Data Dictionary > Web Client Extension.<br />
Then go to web client admin console(<a href="http://localhost:8080/alfresco/faces/jsp/admin/webclientconfig-console.jsp">http://localhost:8080/alfresco/faces/jsp/admin/webclientconfig-console.jsp</a>) and type reload to reload the web client.<br />
<br />
while uploading exampleModel.xml in the first procedure make sure that model should be in Active. please check the model active box.and here we no need to restart the server.<br />
<br />
Next i am going to explain about the first procedure to create new model.<br />
<br />
In Every Model it Contains the following Information<br />
1.Definition of new Model<br />
2.Importing Alfresco Dictionary Definitions. <br />
3.Introduction of new name spaces defined by model.<br />
4. Definition of new Content Type.<b><br />
</b><br />
<br />
<b>1.Definition of new Model</b><br />
<br />
<model name="tm:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"><br />
<br />
Here i written my Model name as tm:mynewmodel. . if we required any more information we can write the following code to know about model.<br />
<br />
<description>Example custom Model</description><br />
<author>Chandu</author><br />
<version>1.0</version><br />
<b><br />
</b><br />
<b>2.Importing Alfresco Dictionary Definitions.</b><br />
If you need to import any new model you need to write import statement as follows.<br />
<br />
<imports><br />
<!-- Import Alfresco Dictionary Definitions --><br />
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /><br />
<!-- Import Alfresco Content Domain Model Definitions --><br />
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /><br />
</imports><br />
<br />
<b>3.Introduction of new namespaces defined by model.</b><br />
<br />
<namespaces><br />
<namespace uri="http://www.chandu.com/model/content/1.0" prefix="tm" /><br />
</namespaces><br />
<br />
<b>4. Definition of new Content Type:</b><br />
<b> </b>here i am taking 3 types in model. i.e, Production Dept,Finance Dept,Testing Dept. in this each dept type i added one mandatory-aspect. to add poperties for particular dept. in the next step i will add aspects.<br />
----------------------------------------------------------------------------------------------------<br />
<types><br />
<type name="tm:production"><br />
<title>Production Department</title><br />
<parent>cm:content</parent><br />
<mandatory-aspects><br />
<aspect>cm:generalclassifiable</aspect><br />
<aspect>tm:productionDetails</aspect><br />
</mandatory-aspects><br />
</type><br />
<type name="tm:finance"><br />
<title>My Company Finance Department</title><br />
<parent>cm:content</parent><br />
<mandatory-aspects><br />
<aspect>cm:generalclassifiable</aspect><br />
<aspect>tm:financeDeptDetails</aspect><br />
</mandatory-aspects><br />
</type><br />
<type name="tm:testing"><br />
<title>My Company Testing Department</title><br />
<parent>cm:content</parent><br />
<mandatory-aspects><br />
<aspect>cm:generalclassifiable</aspect><br />
<aspect>tm:testingDeptDetails</aspect><br />
</mandatory-aspects><br />
</type><br />
</types><br />
-------------------------------------------------------------------------------------------------------<br />
It is very important to follow a specific sequence while defining a new content model.<br />
here is the code for aspects.<br />
--------------------------------------------------------------------------------------<br />
<aspects><br />
<aspect name="tm:productionDetails"><br />
<title>Compnay Prodution Department</title><br />
<properties><br />
<property name="tm:productid"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
<property name="tm:productName"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
</properties><br />
</aspect><br />
<aspect name="tm:financeDeptDetails"><br />
<title>Compnay Finance Department</title><br />
<properties><br />
<property name="tm:financedeptid"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
<property name="tm:financedeptloc"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
</properties><br />
</aspect> <br />
<aspect name="tm:testingDeptDetails"><br />
<title>Compnay Testing Department</title><br />
<properties><br />
<property name="tm:testingdeptid"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
<property name="tm:testingdeptloc"><br />
<type>d:text</type><br />
<index enabled="true"><br />
<atomic>true</atomic><br />
<stored>true</stored><br />
<tokenised>true</tokenised><br />
</index><br />
</property><br />
</properties><br />
</aspect><br />
</aspects><br />
------------------------------------------------------------------------------------------------------<br />
If the attribute enabled for index is set to true, then this property will be indexed in<br />
the search engine. If this is false, there will be no entry for this property in the index.<br />
If the option Atomic is set to true, then the property is indexed in the transaction. If<br />
not, the property is indexed in the background.<br />
<br />
If the option Stored is set to true, then the property value is stored in the index and<br />
may be obtained through the Lucene low-level query API.<br />
<br />
If the option Tokenized is set to true, then the string value of the property is<br />
tokenized before indexing; if it is set to false, then it is indexed as it is, as a single<br />
string. <br />
<br />
next step is to write UI code in web-client-config-custom.xml.<br />
<br />
------------------------------------------------------------------------------------------------------<br />
<?xml version="1.0" encoding="utf-8" ?><br />
<br />
<alfresco-config><br />
<br />
<config evaluator="aspect-name" condition="tm:productionDetails"><br />
<property-sheet><br />
<separator name="prod" display-label-id="prodDeptHeader" component-generator="HeaderSeparatorGenerator" /><br />
<show-property name="tm:productid" display-label-id="productid" /><br />
<show-property name="tm:productName" display-label-id="productName"/> <br />
</property-sheet><br />
</config><br />
<!-- add aspect properties to property sheet --><br />
<config evaluator="aspect-name" condition="tm:financeDeptDetails"><br />
<property-sheet><br />
<separator name="finan" display-label-id="finanDeptHeader" component-generator="HeaderSeparatorGenerator" /><br />
<show-property name="tm:financedeptid" display-label-id="financedeptid" /><br />
<show-property name="tm:financedeptloc" display-label-id="financedeptloc"/><br />
</property-sheet><br />
</config><br />
<config evaluator="aspect-name" condition="tm:testingDeptDetails"><br />
<property-sheet><br />
<separator name="test" display-label-id="testingDeptHeader" component-generator="HeaderSeparatorGenerator" /><br />
<show-property name="tm:testingdeptid" display-label-id="testingdeptid" /><br />
<show-property name="tm:testingdeptloc" display-label-id="testingdeptloc"/><br />
</property-sheet><br />
</config><br />
<br />
<br />
<!-- add types to add content list --><br />
<config evaluator="string-compare" condition="Content Wizards"><br />
<content-types><br />
<type name="tm:production"/><br />
<type name="tm:finance"/><br />
<type name="tm:testing"/><br />
</content-types><br />
</config><br />
<config evaluator="string-compare" condition="Action Wizards"><br />
<aspects><br />
<aspect name="tm:productid" /><br />
<aspect name="tm:productName"/><br />
<aspect name="tm:financedeptid"/><br />
<aspect name="tm:financedeptloc"/><br />
<aspect name="tm:testingdeptid"/><br />
<aspect name="tm:testingdeptloc"/><br />
</aspects> <br />
<specialise-types><br />
<type name="tm:production"/><br />
<type name="tm:finance"/><br />
<type name="tm:testing"/><br />
</specialise-types><br />
</config><br />
<br />
</alfresco-config><br />
-------------------------------------------------------------------------------------------------------<br />
next step is to write properties file for above configuration. i.e., webclient.properties<br />
create a file with webclient.properties and add the below code.<br />
<br />
------------------------------------------------------------------<br />
#Prodution Department<br />
prodDeptHeader = Production Department<br />
productid = Product ID<br />
productName = Product Name<br />
<br />
#Finance Department<br />
finanDeptHeader = Finance Department<br />
financedeptid = Finance Dept ID<br />
financedeptloc = Dept Location<br />
<br />
#Testing Department<br />
testingDeptHeader = Testing Department<br />
testingdeptid = Testing Dept ID<br />
testingdeptloc = Testing Location<br />
------------------------------------------------------------------<br />
<br />
next step is register this model with the repository. for that add a new file as example-model-context.xml.<br />
add the following code.<br />
------------------------------------------------------------------------------------------------<br />
<?xml version='1.0' encoding='UTF-8'?><br />
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><br />
<br />
<beans><br />
<br />
<!-- Registration of new models --> <br />
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap"><br />
<property name="models"><br />
<list><br />
<value>alfresco/extension/exampleModel.xml</value><br />
</list><br />
</property><br />
</bean><br />
<br />
</beans><br />
-------------------------------------------------------------------------------------------------<br />
<br />
place these files in to <root>\tomcat\shared\classes\alfresco\extension.</root><br />
Restart the server and add some content u will get the screen as shown below.<br />
if you want to select Production Department, select that one click next<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8DZppti_u8nxX8zSENxys5U9x_757uIh6BJpaqE1FWD8iGbzUEwSl4IW-BBaJfuAtw2L9oncUMwY7HbChjbg79WtkoIfcPz1mzvhMfDWC8AM8Q5baw4uhR-A_he5NlMw9TsxSsd6_Ffo/s1600-h/image1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8DZppti_u8nxX8zSENxys5U9x_757uIh6BJpaqE1FWD8iGbzUEwSl4IW-BBaJfuAtw2L9oncUMwY7HbChjbg79WtkoIfcPz1mzvhMfDWC8AM8Q5baw4uhR-A_he5NlMw9TsxSsd6_Ffo/s320/image1.bmp" width="320" /></a></div><br />
<br />
you will find the screen as shown below with two additional properties.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5c3TB9ZU74OYeAxN5dXyH0ynrIBcsKIg8dyctSJALVs6sfh4UVLrscsYpy2dZpQAm4405s7FgTVgXsP1GH625YjulmSsgPejNmpO3p_ZO1Vkn0qlfunqDfmy-Xc86AfdpVpdX0OqxZP0/s1600-h/image2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="148" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5c3TB9ZU74OYeAxN5dXyH0ynrIBcsKIg8dyctSJALVs6sfh4UVLrscsYpy2dZpQAm4405s7FgTVgXsP1GH625YjulmSsgPejNmpO3p_ZO1Vkn0qlfunqDfmy-Xc86AfdpVpdX0OqxZP0/s320/image2.bmp" width="320" /></a></div><br />
<br />
<br />
Our next step is to make these model as searchable. for that we need to add some code to web-client-config-custom.xml<br />
<br />
that i will explain as followed <br />
<br />
<br />
<u><b>Advance Search Configuration:</b></u><br />
<br />
<span style="color: black;">to</span> <span style="color: black;">get the Properties in advance search which we are created just now using above Model we need to add the following code</span><br />
<br />
--------------------------------------------------------------------------------<br />
<config evaluator="string-compare" condition="Advanced Search"><br />
<advanced-search><br />
<folder-types><br />
</folder-types><br />
<content-types><br />
<type name="tm:production"/><br />
<type name="tm:finance"/><br />
<type name="tm:testing"/><br />
</content-types><br />
<custom-properties><br />
<meta-data aspect="tm:productionDetails" property="tm:productidr" display-label-id="productid"/><br />
<meta-data aspect="tm:financeDeptDetails" property="tm:financedeptloc" display-label-id="financedeptloc" /><br />
<meta-data aspect="tm:testingDeptDetails" property="tm:testingdeptloc" display-label-id="testingdeptloc" /> <br />
</custom-properties><br />
</advanced-search><br />
</config><br />
----------------------------------------------------------------------------<br />
<br />
Restart the server<br />
<br />
and click on advance search which is at right corner of alfresco. you will find the ui as shown below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCeehTFfXEMjalA0lkhEAMQFFeo1uij3S9MksjRhpB8cF7f-SJC5q0pFw5K2GBebcgaxyiDAJHfoa2xBouiUI-tbOhPFDjFuB_jCe_TUhdhlMdoWmb0pcreHrvy30dO1VYAhlpoPrBR2k/s1600-h/image3.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCeehTFfXEMjalA0lkhEAMQFFeo1uij3S9MksjRhpB8cF7f-SJC5q0pFw5K2GBebcgaxyiDAJHfoa2xBouiUI-tbOhPFDjFuB_jCe_TUhdhlMdoWmb0pcreHrvy30dO1VYAhlpoPrBR2k/s320/image3.bmp" width="320" /></a></div><br />
<br />
Thanks.CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com3tag:blogger.com,1999:blog-2941319944694615842.post-55287047847382340392010-02-02T14:09:00.000+05:302010-02-02T14:09:14.880+05:30Audit Surf In Previous post i explained about to enable audit. and also how to enable debugging.<br />
<br />
here i will explain about audit surf which was created by atolcd .<br />
<br />
you can download the code from forge. <a href="http://forge.alfresco.com/projects/auditsurf/">Click Here</a>.<br />
<br />
different versions of audit surf is availabe in this forge .<br />
<br />
<br />
Here is the best article to understand the audit surf.<br />
<br />
<a href="http://translate.google.co.in/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://blog.atolcd.com/%3Fp%3D321&sl=auto&tl=en">Audit Surf Article</a><br />
<br />
i will explain more about to customize audit surf. CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com2tag:blogger.com,1999:blog-2941319944694615842.post-39410185909747707152010-02-01T12:24:00.001+05:302010-02-01T12:25:00.742+05:30FTP Server Configuration in AlfrescoTo Enable FTP<br />
<br />
Go to \tomcat\shared\classes\alfresco\extension\ rename file-servers-custom.xml.sample to file-servers-custom.xml.<br />
Add this code<br />
<br />
<config evaluator="string-compare" condition="FTP Server"><br />
<serverEnable enabled="true"/><br />
<authenticator type="alfresco"> <br />
</authenticator><br />
</config><br />
<br />
Then Restart the alfresco.CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-52871082972750054942010-01-27T16:44:00.000+05:302010-01-27T16:44:25.160+05:30Examples On Alfresco JavScript API<b>Example1:</b><br />
<br />
var today = new Date();<br />
var folderString = today.getFullYear() + "_" + today.getMonth() + "_" + today.getDate() + "_" + today.getHours() + "_" + today.getMinutes() + "_" +today.getSeconds();<br />
<br />
<br />
document.createFolder(folderString);<br />
<br />
<b>Example2:</b>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-80077064658372050232010-01-18T11:43:00.002+05:302010-01-18T12:24:20.627+05:30Customizing Defaults in Alfresco And Share<u><b><span style="color: #38761d;">Setting default view as "Details View" in Alfresco.</span></b></u><br />
<br />
Hi We can change the default view in alfresco after login.<br />
<br />
Goto \tomcat\webapps\alfresco\WEB-INF\classes\alfresco<br />
<br />
change the file web-client-config.xml<br />
<br />
Change the following code as per the requirement..<br />
<br />
--------------------------------------------------------------------------------------------------- <br />
<!-- default values for the views available in the client --><br />
<view-defaults><br />
<browse><br />
<!-- allowable values: list|details|icons --><br />
<b><view>details</view></b><br />
<page-size><br />
<list>10</list><br />
<b><details>50</details></b><br />
<icons>9</icons><br />
</page-size><br />
</browse><br />
<forums><br />
<!-- allowable values: list|details|icons --><br />
<view>list</view><br />
<page-size><br />
<list>20</list><br />
<details>20</details><br />
<icons>20</icons><br />
</page-size><br />
</forums><br />
<forum><br />
<!-- allowable values: details --><br />
<view>details</view><br />
<page-size><br />
<details>20</details><br />
</page-size><br />
</forum><br />
<topic><br />
<!-- allowable values: details|bubble --><br />
<view>bubble</view><br />
<sort-column>created</sort-column><br />
<!-- allowable values: ascending|descending --><br />
<sort-direction>descending</sort-direction><br />
<page-size><br />
<bubble>5</bubble><br />
<details>20</details><br />
</page-size><br />
</topic><br />
</view-defaults><br />
</views><br />
</config><br />
---------------------------------------------------------------------------------------------------<br />
<br />
<u><b><span style="color: #38761d;">How to Change Default Dashlets in Share</span></b></u>.<br />
<br />
to change default view of dashlets in share we need to change presets.xml which is located at<br />
tomcat\webapps\share\WEB-INF\classes\alfresco\site-data\presetsCHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-76228954710355549952010-01-13T19:36:00.001+05:302010-01-13T19:54:00.171+05:30Scheduled Actions In Alfresco A scheduled action has parts<br />
<ul><li>A cron expression</li>
<li>A query template</li>
<li>An action template</li>
</ul><div>At the times specified by the cron expression, the query template is used to generate a query, and the query is run to select a set of nodes i.e.,Spaces and Documents. <br />
</div><div><br />
just we need to configure the scheduled action in an XML file which is located at config\alfresco\extension\<br />
</div><div><br />
</div><div>code here for <a href="http://docs.google.com/View?id=dg6zsvwf_19f68dkwcf">scheduled-action-services-context.xml</a><br />
<br />
here i am trying to run one script file for every 30 minutes.(make sure first upload that script file to Scripts) <br />
<br />
-------------------------------------------------------------------------------------------------<br />
<?xml version='1.0' encoding='UTF-8'?><br />
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><br />
<br />
<beans><br />
<br />
<!--<br />
Define the model factory used to generate object models suitable for use with freemarker templates. <br />
--><br />
<bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory"><br />
<property name="serviceRegistry"><br />
<ref bean="ServiceRegistry"/><br />
</property><br />
</bean><br />
<<b>bean id="alfresco_runScriptAction</b>" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition"><br />
<property name="actionName"><br />
<value>script</value><br />
</property><br />
<property name="parameterTemplates"><br />
<map><br />
<entry><br />
<key><br />
<value>script-ref</value><br />
</key><br />
<b><value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:scripts/cm:scheduledwork.js"' )}</value></b><br />
</entry><br />
</map><br />
</property><br />
<property name="templateActionModelFactory"><br />
<ref bean="templateActionModelFactory"/><br />
</property><br />
<property name="dictionaryService"><br />
<ref bean="DictionaryService"/><br />
</property><br />
<property name="actionService"><br />
<ref bean="ActionService"/><br />
</property><br />
<property name="templateService"><br />
<ref bean="TemplateService"/><br />
</property><br />
</bean> <br />
<<b>bean id="alfresco_runScript</b>" class="org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition"><br />
<property name="transactionMode"><br />
<value>UNTIL_FIRST_FAILURE</value><br />
</property><br />
<property name="compensatingActionMode"><br />
<value>IGNORE</value><br />
</property><br />
<property name="searchService"><br />
<ref bean="SearchService"/><br />
</property><br />
<property name="templateService"><br />
<ref bean="TemplateService"/><br />
</property><br />
<property name="queryLanguage"><br />
<value>lucene</value><br />
</property><br />
<property name="stores"><br />
<list><br />
<value>workspace://SpacesStore</value><br />
</list><br />
</property><br />
<!-- Find all nodes that do not have the aspect --><br />
<b><property name="queryTemplate"><br />
<value>PATH:"/app:company_home"</value><br />
</property><br />
<property name="cronExpression"><br />
<value>0 0/30 * * * ?</value><br />
</property></b><br />
<property name="jobName"><br />
<value>jobD</value><br />
</property><br />
<property name="jobGroup"><br />
<value>jobGroup</value><br />
</property><br />
<property name="triggerName"><br />
<value>triggerA</value><br />
</property><br />
<property name="triggerGroup"><br />
<value>triggerGroup</value><br />
</property><br />
<property name="scheduler"><br />
<ref bean="schedulerFactory"/><br />
</property><br />
<property name="actionService"><br />
<ref bean="ActionService"/><br />
</property><br />
<property name="templateActionModelFactory"><br />
<ref bean="templateActionModelFactory"/><br />
</property><br />
<property name="templateActionDefinition"><br />
<ref bean="alfresco_runScriptAction"/><br />
</property><br />
<property name="transactionService"><br />
<ref bean="TransactionService"/><br />
</property><br />
<property name="runAsUser"><br />
<value>System</value><br />
</property><br />
</bean><br />
</beans><br />
<br />
-------------------------------------------------------------------------------------------- <br />
Restart the alfresco Server. then these changes may effective.<br />
<br />
<b>About XML configuration file as written above </b>:<br />
<br />
the first block which is in bold <b>bean id="alfresco_runScriptAction", </b>defines the action for scheduled task.<br />
<br />
the second block <b>bean id="alfresco_runScript</b>" contains query and defination.<br />
<br />
i.e., in firsst block action Name and parameter Templates are there. where as in second block query and scheduler definations are there.<br />
<br />
for more information on cron expression <a href="http://wiki.alfresco.com/wiki/Scheduled_Actions#Cron_Explained">http://wiki.alfresco.com/wiki/Scheduled_Actions#Cron_Explained</a><br />
<br />
<br />
</div><div><br />
</div>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-87093541298422312172010-01-06T11:19:00.012+05:302010-09-13T14:46:24.672+05:30Creating AMPs In Alfresco To Change share UI .<div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Here I will explain How to create a AMP to change share login page UI.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Step.1 : </b>Open Eclipse editor and Create a Java project. then it will create a default source folder. delete that folder.create the folders structure as shown below.</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzogkYqobcG5IQobkZ8-vt1l5sQpeOtyWSbKb1JWcefYe5ZT_s97ITOuEfxpXqH5ulyk1vQQvd1s_U5k0NTf9fDdazADbOjqUshlLZhAtTRZdnJZRnFvw5geT0iAt8sat58XKytErrFCg/s1600-h/AMP-Struct.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzogkYqobcG5IQobkZ8-vt1l5sQpeOtyWSbKb1JWcefYe5ZT_s97ITOuEfxpXqH5ulyk1vQQvd1s_U5k0NTf9fDdazADbOjqUshlLZhAtTRZdnJZRnFvw5geT0iAt8sat58XKytErrFCg/s400/AMP-Struct.bmp" /></a></div><b>Step2:</b> here build.xml and module.properties are two files. Create these two files<br />
<br />
copy the below code and paste in buil.xml<br />
<br />
---------------------------------------------------------------------------------------------------------------<br />
<?xml version="1.0"?><br />
<br />
<project name="Sample Module" default="package-amp" basedir="."><br />
<br />
<property name="project.dir" value="."/><br />
<property file="${project.dir}/build.properties"/><br />
<property file="${project.dir}/module.properties"/><br />
<br />
<property name="build.dir" value="${project.dir}/build"/><br />
<property name="config.dir" value="${project.dir}/config"/><br />
<property name="jar.file" value="${build.dir}/lib/${module.id}.jar"/><br />
<property name="amp.file" value="${build.dir}/dist/${module.id}.amp"/><br />
<br />
<target name="mkdirs"><br />
<mkdir dir="${build.dir}/dist" /><br />
<mkdir dir="${build.dir}/lib" /><br />
<mkdir dir="${build.dir}/classes" /><br />
</target><br />
<br />
<path id="class.path"><br />
<dirset dir="${build.dir}" /><br />
<fileset dir="${project.dir}/lib" includes="**/*.jar" /><br />
<fileset dir="${alfresco.sdk.dir}/lib/server" includes="**/*.jar" /><br />
</path><br />
<br />
<target name="clean"><br />
<delete dir="${build.dir}" /><br />
</target><br />
<br />
<target name="compile" depends="mkdirs"> <br />
<javac classpathref="class.path" debug="${debug}" srcdir="${project.dir}/source/java" <br />
destdir="${build.dir}/classes" target="1.5" encoding="UTF-8"/><br />
<copy todir="${build.dir}/classes"><br />
<fileset dir="${project.dir}/source/java" defaultexcludes="false"><br />
<exclude name="**/*.java"/><br />
<exclude name="**/.svn/**"/><br />
<exclude name="**/CVS/**"/><br />
</fileset><br />
</copy><br />
</target><br />
<br />
<target name="package-jar" depends="compile"><br />
<jar destfile="${jar.file}" encoding="UTF-8"><br />
<fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" defaultexcludes="false" /><br />
</jar><br />
</target><br />
<br />
<target name="package-amp" depends="package-jar" description="Package the Module" ><br />
<zip destfile="${amp.file}" encoding="UTF-8"><br />
<fileset dir="${project.dir}/build" includes="lib/*.jar" /><br />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" /><br />
<fileset dir="${project.dir}"><br />
<include name="module.properties"/><br />
<include name="file-mapping.properties" /><br />
<include name="WEB-INF/**/*" /><br />
<include name="lib/**/*" /><br />
<exclude name="WEB-INF/alfresco.tld"/><br />
<exclude name="WEB-INF/repo.tld"/><br />
</fileset><br />
<zipfileset dir="source/web" prefix="web"/><br />
</zip><br />
</target><br />
</project><br />
----------------------------------------------------------------------------------------------------------------<br />
<br />
copy the below code and paste in module.properties<br />
---------------------------------------------------------------------------------------------------<br />
# SDK Share UI module<br />
module.id=ShareUI<br />
module.title=Share UI Project <br />
module.description= Project to build an amp file for Share UI <br />
module.version=1.0<br />
----------------------------------------------------------------------------------------------------<br />
<br />
<b>Step3:</b><br />
Here I am going to change Login page of share and share footer. <br />
for this changes we need to change following files<br />
<br />
<br />
1.slingshot-login.ftl<br />
<br />
2.alfresco-templte.ftl<br />
<br />
3.footer.get.html.ftl<br />
<br />
4.footer.get.properties<br />
<br />
5.header.get.html.ftl<br />
<br />
change the required images and text in above files and create a project structure as shown below. then right click on build.xml and run as ant build.<br />
<br />
finally you will get a amp file in the build path as shown below.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAs9kUOTolDStK1VoLKkWyDh_lXAkC6vuuO2vsgMAmbkui3_NlTU-klBc5ehv9UUa4LfBVVQmU26PJp90XqK2xc2OooQy99tM43MciNKzRtzlOKMghEA73lmG_Om1dvwayzPVE8ZDx4Vw/s1600-h/share-ui.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAs9kUOTolDStK1VoLKkWyDh_lXAkC6vuuO2vsgMAmbkui3_NlTU-klBc5ehv9UUa4LfBVVQmU26PJp90XqK2xc2OooQy99tM43MciNKzRtzlOKMghEA73lmG_Om1dvwayzPVE8ZDx4Vw/s400/share-ui.bmp" /></a></div><br />
<b>Step4:</b><br />
Next step is copy these amp file and place into amps folder in which you are alfresco installed.<br />
then go to apply_amps.bat file. copy this file and rename it with share_apply_amps.bat, copy the code below.<br />
<br />
--------------------------------------------------------------------------------------------------------<br />
@echo off<br />
rem -------<br />
rem Script for apply AMPs to installed WAR<br />
rem -------<br />
<br />
set ALF_HOME=%~dp0<br />
set CATALINA_HOME=%ALF_HOME%tomcat<br />
<br />
if not exist "%ALF_HOME%SetPaths.bat" goto getpaths<br />
call "%ALF_HOME%SetPaths.bat"<br />
goto start<br />
<br />
:getpaths<br />
call "%ALF_HOME%bin\RegPaths.exe"<br />
call "%ALF_HOME%SetPaths.bat"<br />
del "%ALF_HOME%SetPaths.bat"<br />
<br />
:start<br />
echo This script will apply all the AMPs in %ALF_HOME%amps to the share.war file in %CATALINA_HOME%\webapps<br />
if ""%1"" == ""nowait"" goto nowait1<br />
echo Press control-c to stop this script . . .<br />
pause<br />
:nowait1<br />
"%JAVA_HOME%\bin\java" -jar "%ALF_HOME%bin\alfresco-mmt.jar" install "%ALF_HOME%amps" "%CATALINA_HOME%\webapps\share.war" -directory "%2"<br />
"%JAVA_HOME%\bin\java" -jar "%ALF_HOME%bin\alfresco-mmt.jar" list "%CATALINA_HOME%\webapps\share.war"<br />
echo .<br />
echo About to clean out tomcat/webapps/share directory and temporary files...<br />
if ""%1"" == ""nowait"" goto nowait2<br />
pause<br />
:nowait2<br />
rmdir /S /Q "%CATALINA_HOME%\webapps\share"<br />
call "%ALF_HOME%bin\clean_tomcat.bat"<br />
<br />
-------------------------------------------------------------------------------------------------------------<br />
<br />
save the above file and close it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><b>Step5</b>: Double click on share_apply_amps.bat a window will appear. as shown below.</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjqqjxcXdHsUu5P-BL-W0KGdwF_8T8dTFPko-9g0SGE-f9lnY6qeRHQTu5Vxo1EOMdNi2wCCpYIbqrPgra_XJoZ1fCpI0A-Spx18RZNDU3jbTWrFnopw1nzNzS150BGi0h4bBnEg-Yfcs/s1600-h/AMP.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjqqjxcXdHsUu5P-BL-W0KGdwF_8T8dTFPko-9g0SGE-f9lnY6qeRHQTu5Vxo1EOMdNi2wCCpYIbqrPgra_XJoZ1fCpI0A-Spx18RZNDU3jbTWrFnopw1nzNzS150BGi0h4bBnEg-Yfcs/s400/AMP.bmp" /></a></div><br />
Restart the tomcat server and check the changes you have made.that login page will be changed and as well as footer and header.<br />
<br />
<br />
<br />
For More info go to :<br />
<br />
<br />
<h2><a href="http://ecmarchitect.com/archives/2010/09/07/1212">7 mistakes developers make when customizing Alfresco Share</a></h2>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com6tag:blogger.com,1999:blog-2941319944694615842.post-81178903079027658882009-12-28T19:19:00.002+05:302010-04-21T12:39:11.824+05:30JavaScript To Create Spaces and Move Content to specific Spaces based on Name// JavaScript Document<br />
<br />
var rootSpaceName = companyhome.childByNamePath("Chandu"); //returns chandu<br />
var childList = rootSpaceName.children;<br />
var count = childList.length;<br />
var test = new Array();<br />
<br />
for(var i=0; i<count; i++)=""><br />
{ <br />
var childName = childList[i].properties.name;<br />
var child = childList[i];<br />
<br />
if(!child.isContainer)<br />
{<br />
var newSpace = childName.substring(0,4);<br />
var ind = 0;<br />
<br />
if(!contains(childList, newSpace, test))<br />
{<br />
var newSpaceName = rootSpaceName.createFolder(newSpace);<br />
child.move(newSpaceName);<br />
test[ind++]=newSpaceName;<br />
}<br />
else<br />
{<br />
var existingSpace = rootSpaceName.childByNamePath(newSpace);<br />
child.move(existingSpace)<br />
}<br />
} <br />
}<br />
<br />
function contains(childList, newSpace,test)<br />
{<br />
for(var i = 0; i < childList.length; i++) <br />
{<br />
if(childList[i].properties.name == newSpace)<br />
{<br />
return true;<br />
}<br />
}<br />
for(var i = 0; i < test.length; i++) <br />
{<br />
if(test[i].properties.name == newSpace)<br />
{<br />
return true;<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
<br />
</count;>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-34587471166480762992009-12-10T12:12:00.022+05:302010-02-15T18:13:54.267+05:30Audit Configuration in AlfrescoAuditing is disabled by default, To enable auditing, some changes we need to made.<br />
here i explained in detailed where we need to change different audit related files.<br />
<br />
go to auditConfig.xml, U can find this file in tomcat\webapps\alfresco\WEB-INF\classes\alfresco folder<br />
change the value of enabled to true in place of false.<br />
<br />
------------------------------------------------------------<br />
<Audit xmlns="http://www.alfresco.org/model/audit/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" enabled="true" auditInternal="false" mode="all"><br />
----------------------------------------------------------------------<br />
**and copy this file into extension folder.<br />
<br />
Next go to extension folder in alfresco root i.e.,\tomcat\shared\classes\alfresco\extension\<br />
<br />
create a new file, name it as a custom-audit-services-context.xml and add this below code<br />
-----------------------------------------------------------------------------------------------------<br />
<?xml version='1.0' encoding='UTF-8'?><br />
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><br />
<br />
<beans> <br />
<!-- The configuration of the audit model --><br />
<br />
<bean id="auditConfiguration" class="org.alfresco.repo.audit.AuditConfigurationImpl"><br />
<property name="config"><br />
<value>alfresco/extension/auditConfig.xml</value><br />
</property><br />
</bean> <br />
</beans><br />
--------------------------------------------------------------------------------------------------<br />
<br />
to turn on debug for audit information change log4j.properties which is located in<br />
<br />
\tomcat\webapps\alfresco\WEB-INF\classes uncomment the line which is shown below...<br />
<br />
log4j.logger.org.alfresco.repo.audit.model=DEBUG<br />
<br />
<br />
also you can enable alfresco-global.properties which is located in \tomcat\shared\classes<br />
---------------------------------------<br />
#Audit Configuration<br />
audit.enabled = true<br />
----------------------------------------<br />
<br />
Also Enable file service and folder service in auditConfig.xml<br />
<br />
-------------------------------------------------------------------------------<br />
<!-- The File/Folder Service --><br />
<br />
<Service name="FileFolderService" mode="none"><br />
<Method name="rename" mode="all"/><br />
<Method name="move" mode="all"/><br />
<Method name="copy" mode="all" auditInternal="true"/><br />
<Method name="create" mode="all"/><br />
<Method name="delete" mode="all"/><br />
<Method name="makeFolders" mode="all"/><br />
<Method name="getWriter" mode="all"/><br />
<Method name="getReader" mode="all"/><br />
</Service><br />
<br />
<Service name="ContentService" mode="none"><br />
<Method name="getWriter" mode="all"/><br />
<Method name="transform" mode="all"/><br />
<Method name="getReader" mode="all"/><br />
</Service><br />
-------------------------------------------------------------------------------<br />
<br />
<br />
Restart the server you will find tomcat screen like shown below<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZf7N8196NMM9v-KZY1roq6ALP9Vr9dYjK62f_lMzNPu56E8oYxqgs2LqkGKutVJAEJZP9ETF5X1MTLln1QTPqz28DsPdvPcduY_l9HxLVF2Ikx04BhQVwwLs2GeDHPM8UQNyLP-xkQS8/s1600-h/audit-tomcat.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZf7N8196NMM9v-KZY1roq6ALP9Vr9dYjK62f_lMzNPu56E8oYxqgs2LqkGKutVJAEJZP9ETF5X1MTLln1QTPqz28DsPdvPcduY_l9HxLVF2Ikx04BhQVwwLs2GeDHPM8UQNyLP-xkQS8/s400/audit-tomcat.bmp" /></a><br />
</div>and add some documents to alfresco change some properties for that documents like opening,editing, and set permissions to that documents<br />
Next go to ViewDetails on that document you have edited, click preview in template and select show_audit.ftl from the dropdown menu. you should be able to see all of the actions you just carried out on that document.<br />
you will find the screen as shown below.<span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"> </span></span><br />
</span></span><br />
</span></span><br />
<div class="separator" style="clear: both; text-align: left;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDD17sqIRUiS0WOkqNRr8NeWLgAMQU00wdovfIucuNP25XRavxrMyAw4NtSHYvG6vC4YQixLMPoSGRnH6v-CkJrtwCcly5aG-ueDBV6VTg-SA2TAcLpxL4scUGgLgl3u7BeyeEVURyl7s/s1600-h/800px-Audit_Template.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDD17sqIRUiS0WOkqNRr8NeWLgAMQU00wdovfIucuNP25XRavxrMyAw4NtSHYvG6vC4YQixLMPoSGRnH6v-CkJrtwCcly5aG-ueDBV6VTg-SA2TAcLpxL4scUGgLgl3u7BeyeEVURyl7s/s640/800px-Audit_Template.gif" /></a></span></span></span></span></span></span><br />
</div><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: small;"><span style="font-size: 13px; line-height: 19px;"><span style="font-family: Tahoma,Arial,Verdana,Helvetica,sans-serif; font-size: small;"><span style="font-size: 12px; line-height: 21px;"><br />
</span></span><br />
</span></span><br />
</span></span><br />
</span></span><br />
<!-- AddThis Button BEGIN --><br />
<div><a expr:addthis:title='data:post.title' expr:addthis:url='data:post.url' class='addthis_button'><img src="http://s7.addthis.com/static/btn/sm-share-en.gif" width="83" height="16" alt="Bookmark and Share" style="border:0"/></a><br />
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b79413b2f536ba0"></script></div><!-- AddThis Button END -->CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com33tag:blogger.com,1999:blog-2941319944694615842.post-84274647132296769232009-12-09T11:54:00.004+05:302009-12-09T11:56:11.949+05:30Writing a Hello World Dashlet for Alfresco Share <span style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; font-size: 13px;">Alfresco Share is the new social computing application of Alfresco 3.0. It is built upon Surf Framework, a light-weight, component-based, REST-oriented web application framework which allows extension through scripting and templating.</span><br />
<span style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; font-size: 13px;"></span><br />
<span style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; font-size: 13px;"></span><br />
<span style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; font-size: 13px;"><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">In this KB, we will go through the basic steps to create a new Hello World dashlet and then deploy and test it on Alfresco Share.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Just like developing any other webscript, let us first create a new XML file, name it as <em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">helloworld.get.desc.xml</em>and add following lines<br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy-hbrZFZ5j586G7S_02_sKosQWhTmS6c44VMTQ1zjgM-lsYnYyHYzuuFYxfOhyzimHD9IMuDivR0dxz0MgnbdP86Camb__46_eWCdtYbAcMezEtTHMSRMoegHg_948bU5ljGxJJ1KeE0/s1600-h/Hello.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy-hbrZFZ5j586G7S_02_sKosQWhTmS6c44VMTQ1zjgM-lsYnYyHYzuuFYxfOhyzimHD9IMuDivR0dxz0MgnbdP86Camb__46_eWCdtYbAcMezEtTHMSRMoegHg_948bU5ljGxJJ1KeE0/s640/Hello.bmp" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">It provides basic configuration information about the dashlet such as name, description and url for the service endpoint. The key element of this configuration file is the family setting which has to be <em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">user-dashlet</em> in order for Alfresco share to recognize it as a dashlet and make it available for end user to select when they customize their share dashboards.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Since this is a simple Hello World dashlet, we really don’t need the javascript component or we can just create an empty javascript file with the name <em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">helloworld.get.js</em>.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Now let us work on the presentation part of this dashlet, a freemarker template with the name<em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">helloworld.get.html.ftl.</em><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM6cuYE-faBBjc4aXd6Uy6a9oR96nYx8HRYrIJhgkk13MPsG9k9f1WsqxwfbWI7gQSBgAkOX6lX_Vb7htXOxoyQZLXWOvruBAGQb4zJWLvzlUxwWhzEu5UBu1MKxSoVfyk1m_gof7H-kU/s1600-h/hello2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM6cuYE-faBBjc4aXd6Uy6a9oR96nYx8HRYrIJhgkk13MPsG9k9f1WsqxwfbWI7gQSBgAkOX6lX_Vb7htXOxoyQZLXWOvruBAGQb4zJWLvzlUxwWhzEu5UBu1MKxSoVfyk1m_gof7H-kU/s640/hello2.bmp" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">As we can see, it prints out the “Hello Word†text as the dashlet body as well as a “Hello World†title.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">To make a step further, we can also create a message properties file and reference the messages inside the freemarker template. So let us create a properties file <em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">helloworld.get.properties</em> and put the following entry in it<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">hello.world = Hello World<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">Once the properties file is ready, we can reference the hello world message using API ${msg(”hello.world”)} in the freemarker template file.<br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbUW_6BO8HMma6Szh3V757rumCAA3XFfFbR2CJfct7DH4cRUKOO4abwbAQ4jfQ3M6h-f1bTtsRzbWJhQZJAWZhUEGpl13fW8uRLn_EZ9ovKB6sOYeCPKpYP_voHpF8ATJdMEZWx0i2soA/s1600-h/hello3.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbUW_6BO8HMma6Szh3V757rumCAA3XFfFbR2CJfct7DH4cRUKOO4abwbAQ4jfQ3M6h-f1bTtsRzbWJhQZJAWZhUEGpl13fW8uRLn_EZ9ovKB6sOYeCPKpYP_voHpF8ATJdMEZWx0i2soA/s640/hello3.bmp" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">Now with all the files ready, we can deploy them to Alfresco Share. Since Alfresco Share will look for its webapp classpath for the scripts, we can create a new folder demo under the <em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">share\WEB-INF\classes\alfresco</em> folder and place all our files over there.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;">To make Alfresco Share to load the new dashlet, we need to go to Share webscript management page, e.g.<em style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">http://localhost:8080/share/service/</em>.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"><img alt="Hello World Dashlet" src="http://drquyong.com/myblog/wp-content/uploads/2008/09/helloworld.thumbnail.jpg" /><br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Click the Refresh Web Scripts button at the bottom of the page and if you see the number of total webscript incremented by one, the dashlet has been deployed successfully.<br />
</div><div style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Log on to Alfresco Share and click Customize Dashboard button and you will see the “Hello World†dashlet is there and is available to be added to your dashboard.<br />
<br />
<br />
Collected from <a href="http://drquyong.com/myblog/?cat=15">http://drquyong.com/myblog/?cat=15</a><br />
</div></span><span style="font-family: 'Segoe UI', 'Lucida Grande', 'Franklin Gothic Medium', 'URW Gothic L', Helvetica, sans-serif; font-size: 13px;"><br />
</span>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com1tag:blogger.com,1999:blog-2941319944694615842.post-28696624528690469632009-12-04T15:11:00.001+05:302009-12-04T15:11:21.593+05:30To Create Spaces Using JavaScript API<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"></span></span><br />
<span style="font-family: Arial; font-size: small;"><span style="font-size: 13px;"><div><br />
</div><div>var mainFolder = space.childByNamePath("Mobile Services");<br />
</div><div><br />
</div><div>if(mainFolder == null && space.hasPermission("CreateChildren"))<br />
</div><div>{<br />
</div><div> mainFolder = space.createFolder("Mobile Services")<br />
</div><div>}<br />
</div><div><br />
</div><div>var customersFolder = mainFolder.childByNamePath("Customers");<br />
</div><div><br />
</div><div>if(customersFolder == null && mainFolder.hasPermission("CreateChildren"))<br />
</div><div>{<br />
</div><div> customersFolder = mainFolder.createFolder("Customers")<br />
</div><div>}<br />
</div><div><br />
</div><div> var custFolderNames = new Array("Airtel", "Idea");<br />
</div><div><br />
</div><div>for (var i=0; i<2; i++)<br />
</div><div>{<br />
</div><div> var subCustomersFolder = customersFolder.childByNamePath(custFolderNames[i]);<br />
</div><div><br />
</div><div> if(subCustomersFolder == null && customersFolder.hasPermission("CreateChildren"))<br />
</div><div> {<br />
</div><div> subCustomersFolder = customersFolder.createFolder(custFolderNames[i])<br />
</div><div> }<br />
</div><div><br />
</div><div>}<br />
</div></span></span>CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0tag:blogger.com,1999:blog-2941319944694615842.post-53474967430967563722009-12-01T11:41:00.048+05:302010-07-28T13:03:25.588+05:30JavaScript API Examples in Alfresco<b></b><br />
<b></b><br />
<b><div style="display: inline !important; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><div style="display: inline !important;"><b>Script to get entire alfresco folder structure using recursion</b></div></div></b><br />
<b></b><br />
<b><div style="font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">-----------------------------------------------------------------------------------------------</div><div style="font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
// JavaScript Document<br />
<br />
var log = "Script Excecuted at " new Date() "\n\n";<br />
var node;<br />
<br />
var logFile = companyhome.childByNamePath("log.txt");<br />
<br />
if (logFile == null)<br />
{<br />
logFile = userhome.createFile("log.txt");<br />
}<br />
<br />
for(i=0; i<companyhome.children.length; i )<br />
{<br />
var childName = companyhome.children[i];<br />
<br />
if(childName != null)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(childName.isContainer)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> log = childName.properties.name "\t" childName.displayPath "\n" ;<br />
recursion(childName); <br />
}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
log = childName.properties.name "\t" childName.displayPath "\n" ;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
function recursion(node)<br />
{<br />
if(node != null)<br />
{<br />
for(var j=0; j<node.children.length; j )<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(node.children[j] != null)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(node.children[j].isContainer)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>log = node.children[j].properties.name "\t" node.children[j].displayPath "\n" ;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>recursion(node.children[j]); <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
log = node.children[j].properties.name "\t" node.children[j].displayPath "\n" ; <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> }<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
}<br />
}<br />
<br />
logFile.content = log;<br />
<br />
<div>__________________________________________________________________</div></div></b><b><br />
</b><br />
<b>Script to send Email to Multiple users in Alfresco.</b><br />
-----------------------------------------------------------------------------------------------<br />
var mail = actions.create("mail");<br />
var recep = new Array();<br />
var i = 0;<br />
recep[0] = "a@gmail.com";<br />
recep[1] = "b@gmail.com";<br />
//doc = document.properties.name;<br />
for(i=0;i<recep.length;i++)><br />
{<br />
mail.parameters.to = recep[i];<br />
<br />
mail.parameters.subject = "Hello from JavaScript";<br />
mail.parameters.from = "sukumarpant@alfresco.com";<br />
//mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/invite/invite-email.ftl");<br />
mail.parameters.text = "some text, in case template is not found" ; <br />
mail.execute(document);</recep.length;i++)><br />
}<br />
---------------------------------------------------------------------------<br />
<br />
<br />
<b>Create Backup of a Document</b><br />
<div><b>Creates a backup of a document as it is added to a space:</b></div><div><br />
</div><div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">// find the backup folder - create if not already exists
var backupFolder = space.childByNamePath("Backup");
if (backupFolder == null && space.hasPermission("CreateChildren"))
{
// create the folder for the first time
backupFolder = space.createFolder("Backup");
}
if (backupFolder != null && backupFolder.hasPermission("CreateChildren"))
{
// copy the doc into the backup folder
var copy = document.copy(backupFolder);
if (copy != null)
{
// change the name so we know it's a backup
copy.name = "Backup of " + copy.name;
copy.save();
}
}</pre></div><br />
<span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;">Create Backup of a Document And Log Doc Properties</h2><div>Creates a backup of a document and logs the doc properties to a log text file:</div><div><br />
</div><div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">// find the backup folder - create if not already exists
var backupFolder = space.childByNamePath("Backup");
if (backupFolder == null && space.hasPermission("CreateChildren"))
{
// create the folder for the first time
backupFolder = space.createFolder("Backup");
}
if (backupFolder != null && backupFolder.hasPermission("CreateChildren"))
{
// copy the doc into the backup folder
var copy = document.copy(backupFolder);
if (copy != null)
{
// change the name so we know it's a backup
var backupName = "Backup of " + copy.name;
copy.name = backupName;
copy.save();
}
// record the time of the backup to a log file
var logFile = backupFolder.childByNamePath("backuplog.txt");
if (logFile == null)
{
logFile = backupFolder.createFile("backuplog.txt");
}
if (logFile != null)
{
logFile.content += "File: " + backupName +
"\tDate: " + new Date().toGMTString() +
"\tSize: " + copy.size + "\r\n";
}
}</pre></div><br />
<br />
<span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;">Append Copyright Line To File</h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Appends a copyright line of content to plain text and HTML files:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">if (document.hasPermission("Write"))
{
if (document.mimetype == "text/plain")
{
document.content += "\r\n\r\nCopyright (C) 2006";
}
else if (document.mimetype == "text/html")
{
document.content += "
<small>Copyright © 2006</small>";
}
}</pre><br />
<span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;"><span style="color: #333333; font-size: 13px; line-height: 19px;"><br />
<br />
<br />
</span></h2><h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;">Create Document, Make it Versionable, Modify It</h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Creates a document, makes it versionable, checks it out, modifies the content of the working copy, checks it in again and then repeats the process but checks in the document with a version history note and as a major version increment:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">// create file, make it versionable
var doc = userhome.createFile("checkmeout.txt");
doc.addAspect("cm:versionable");
doc.content = "original text";
// check it out and update content on the working copy
var workingCopy = doc.checkout();
workingCopy.content = "updated text 1";
// check it in
doc = workingCopy.checkin();
// check it out again
workingCopy = doc.checkout();
workingCopy.content = "updated text 2";
// check it in again, but with a version history note and as major version increment
doc = workingCopy.checkin("a history note", true);</pre><br />
<br />
<br />
<div><br />
<span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;">Add Aspects</h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Adding several aspects to a document:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">var props = new Array(1);
props["cm:template"] = document.nodeRef;
document.addAspect("cm:templatable", props);
props = new Array(1);
props["cm:lockIsDeep"] = true;
document.addAspect("cm:lockable", props);
props = new Array(1);
props["cm:hits"] = 1;
document.addAspect("cm:countable", props);</pre><br />
<span style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;">Return Result Value</h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Returning a result value. This is useful for scripts that are processed using URLs via the Script Command Servlet, as the results are returned as the HTML response from the servlet:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">function result()
{
return "The name of my home space is: " + userhome.name;
}
result();</pre><br />
</div><span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;"><span class="mw-headline">Change Mime Type of a Document</span></h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Changes the mimetype of a document after setting the content:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">var file = userhome.createFile("testfile.html");
file.content = "some <b>HTML</b> here";
file.mimetype = "text/html";</pre><br />
<br />
<span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;"><span class="mw-headline">Create Document and Transform it</span></h2><div style="line-height: 1.5em; margin: 0.8em 0px 0.9em;">Creates document content and converts it to new formats using the transformation API:</div><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;">// create a plain text doc and convert to PDF, generated file will be placed in same space as original
var doc1 = userhome.createFile("transform_me1.txt");
doc1.mimetype = "text/plain";
doc1.content = "This is plain text";
var trans1 = doc1.transformDocument("application/pdf");
// create an HTML doc and convert to plain text, generated file will be created under the companyhome space
var doc2 = userhome.createFile("transform_me2.html");
doc2.mimetype = "text/html";
doc2.content = "This is an <b>HTML</b> <span style="color: blue;"><i>document</i>!</span>";
var trans2 = doc2.transformDocument("text/plain", companyhome);
// create an HTML doc and convert to flash swf file, generated file will be created under the companyhome space
var doc3 = userhome.createFile("transform_me3.html");
doc3.mimetype = "text/html";
doc3.content = "This is an <b>HTML</b> <span style="color: blue;"><i>document</i>!</span>";
var trans3 = doc3.transformDocument("application/x-shockwave-flash", companyhome);
</pre><div><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><br />
</span></span></div><div><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><br />
</span></span></div><div><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 19px; white-space: normal;"></span></span></span><br />
<h2 style="background-image: none; border-bottom: 1px solid rgb(170, 170, 170); color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 19px; font-weight: normal; margin: 0px 0px 0.6em; padding-bottom: 0.17em; padding-top: 0.8em;"><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 19px; white-space: normal;"><span class="mw-headline">Creating different child node types, including via a specific named child association and with default properties</span></span></span></span></h2><pre style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); color: black; line-height: 1.1em; padding: 1em;"><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 19px; white-space: normal;">var node1 = userhome.createNode("create test1.txt", "cm:content");
node1.content = "node1 content";
var node2 = userhome.createNode(null, "sys:base");
var props = new Array();
props["cm:name"] = "create test3.txt";
var node3 = userhome.createNode(null, "cm:content", props);
props["cm:name"] = "node name4.txt";
props["cm:title"] = "node title4";
var node4 = userhome.createNode(null, "cm:content", props, "cm:contains");
var result = "nodes created ok";
result;</span></span></span></pre><span style="color: black; font-family: monospace;"><span class="Apple-style-span" style="line-height: 14px; white-space: pre;"><span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 19px; white-space: normal;"></span></span></span></div><br />
<br />
<br />
<br />
<br />
<br />
<b>Deleting Special Charterers and white Spaces from a String Using JavaScript</b><br />
<br />
--------------------------------------------------------------------------<br />
<br />
<html><br />
<head><br />
<br />
<script language="JavaScript"><br />
<br />
<!--<br />
var temp = new String('Certificate of Origin (issued by Beneficiary)');<br />
document.write(temp '<br>');<br />
temp = temp.replace(/[^a-zA-Z 0-9] /g,'').toUpperCase();<br />
var temp2 = temp.replace(/\s /g,'');<br />
document.write(temp2 '<br>');<br />
//--><br />
<br />
</script><br />
<br />
</head><br />
<br />
<body><br />
<br />
</body><br />
<br />
</html><br />
------------------------------------------------------------------CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com2tag:blogger.com,1999:blog-2941319944694615842.post-56063206144703655882009-11-26T17:14:00.008+05:302010-01-06T17:19:08.903+05:30Listing Available Web ScriptsTo refresh availabe webscripts in the alfresco<br />
<br />
http://localhost:8080/alfresco/service/index<br />
<br />
and click on refresh webscripts<br />
<br />
In the same way to refresh webscripts in share<br />
<br />
http://localhost:8080/share/service/index<br />
<br />
click on refresh.CHANDUhttp://www.blogger.com/profile/03121698907134989839noreply@blogger.com0