<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EstiloDeEmail17
{mso-style-type:personal;
font-family:Arial;
color:windowtext;}
span.EstiloDeEmail18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=PT-BR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>Create and publish
Folder with Properties:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> public void
createFolder(String path, String name, Map properties) throws Exception {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:navy'>//--cria uma pasta<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> String
nomePasta = Format.retiraAcento(name);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> setCurrentProject("Offline");
//escolhe o tipo de projeto<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New";color:navy'>createFolder(path, name);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> //--seta
as properties do resource<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> if
(properties != null && properties.size() > 0) {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:navy'>List listProperties = new ArrayList(); <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New";color:navy'>//--monta lista de properties<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> Iterator
it = properties.entrySet().iterator();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> while(it.hasNext())
{ //loop nas properties<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> Map.Entry
entry = (Map.Entry)it.next();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>
CmsProperty property = new CmsProperty();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>
property.setKey(entry.getKey().toString());<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>
property.setStructureValue(entry.getValue().toString());<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>
<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'>
listProperties.add(property); <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> //--grava
as properties<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> m_cms.writePropertyObjects(path+name,
listProperties);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:navy'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> //--publica
recurso criado<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> unlockCurrentProject();<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New";color:navy'>m_cms.publishResource(path+name);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face="Courier New"><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:navy'> </span></font><font
size=2 color=navy face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:navy'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> BRAGA Bruno
Gonçalves [mailto:bruno.braga@globalvalue.com.br] <br>
<b><span style='font-weight:bold'>Enviada em:</span></b> quinta-feira, 14 de
abril de 2005 16:58<br>
<b><span style='font-weight:bold'>Para:</span></b> <st1:PersonName w:st="on">The
OpenCms mailing list</st1:PersonName><br>
<b><span style='font-weight:bold'>Assunto:</span></b> [opencms-dev] how to
change property value of resource through the shell</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>How to change property value of resource through the
Shell?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>