[opencms-dev] synchronize feature
Fabian Panthen
fpa at unitb-consulting.de
Mon Jan 11 19:06:40 CET 2010
I am still trying to understand what your task does though.
Is it right to assume that a lot of it happens in the superclass
OpenCmsTask?
Looks like that somehow creates the CmsObject, mybe by programmatically
starting a shell and passing in a custom command?
Robert Spielmann schrieb:
> Am 11.01.2010 14:07, schrieb Fabian Panthen:
>
>> Hello together,
>>
>> does anyone know whether it is possible to trigger synchronization via
>> the CmsShell?
>> In the wiki I found a snippet which results in an error indicating there
>> never was such a method or that it has been dropped.
>>
>> wiki link: http://opencms-wiki.org/Synchronizing_with_Ant
>>
>> result:
>>
>> Requested method not found: synchronize(value). Use syntax "<methodname>
>> <arg1>..<argN>"
>>
>> we use OpenCms 7.5.1
>>
>
> Hi Fabian,
>
> we have something like this:
>
> <target name="sync">
> <!-- Sync-Verzeichnis anlegen, falls noch nicht vorhanden -->
> <mkdir dir="${opencms.sync.dir}"/>
>
> <!-- Dateien synchronisieren -->
> <opencms_sync username="${opencms.user}"
> password="${opencms.password}"
> vfs="/system/modules/${opencms.module.name}"
> rfs="${opencms.sync.dir}/${opencms.module.name}/"
> webInfDir="${opencms.webinf.dir}"
> servletMapping="${opencms.servlet.mapping}" />
>
> <!-- JSPs zumindest Offline löschen -->
> <delete
> dir="${opencms.jsp.offline.dir}/system/modules/${opencms.module.name}"/>
> </target>
>
> with a custom Ant task like this:
>
> public class OpenCmsSyncAntTask extends OpenCmsTask {
> /* ... */
> protected void executeOpenCmsOperation(CmsObject cms) throws
> BuildException {
>
> // initialize the synchronization settings
> CmsSynchronizeSettings settings = new CmsSynchronizeSettings();
> settings.setEnabled(true);
> settings.setDestinationPathInRfs(rfs);
> ArrayList l = new ArrayList();
> l.add(vfs);
> settings.setSourceListInVfs(l);
>
> // cms report where output messages are sent
> CmsShellReport report = new CmsShellReport(Locale.GERMANY);
>
> // instantiate and execute the synchronization
> try {
> new CmsSynchronize(cms, settings, report);
> } catch (Exception e) {
> throw new BuildException("Kann Synchronisierung nicht durchführen : "
> + e, e);
> }
> }
> }
>
> vfs and rfs being the params passed in from Ant. Is that what you you
> are looking for?
>
> Regards
> Robert Spielmann
> IT Consultant
>
>
> ------------------------------------------------------------------------
>
>
> Eingehende eMail ist virenfrei.
> Von AVG überprüft - www.avg.de
> Version: 9.0.725 / Virendatenbank: 270.14.134/2613 - Ausgabedatum: 01/11/10 08:35:00
>
>
--
____________________________________________
u n i t b c o n s u l t i n g
Brunnenstr. 156
10115 Berlin
Tel: +49 [0]30 44 31 92 00
Fax: +49 [0]30 44 31 92 29
Mail: office at unitb-consulting.de
Web: http://www.unitb-consulting.de
Geschäftsführer: Nico Adam, Thomas Timm
Registergericht: AG Berlin-Charlottenburg - HRB 113607
Steuernummer: 37/249/21073
Ust-IdNr.: DE814984825
Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen
enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail sind nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
More information about the opencms-dev
mailing list