@@ -164,18 +164,36 @@ protected void removeTypes(Node node) {
164
164
}
165
165
}
166
166
167
+ /**
168
+ * An XML update action which replaces an element given by an XPath with some other XML element.
169
+ */
167
170
class ElementReplaceAction extends CmsXmlUpdateAction {
168
171
172
+ /**
173
+ * The XML which should be used as a replacement (as a string).
174
+ */
169
175
private String m_replacementXml ;
170
176
177
+ /**
178
+ * The xpath of the element to replace.
179
+ */
171
180
private String m_xpath ;
172
181
182
+ /**
183
+ * Creates a new instance.<p>
184
+ *
185
+ * @param xpath the xpath of the element to replace
186
+ * @param replacementXml the replacement xml
187
+ */
173
188
public ElementReplaceAction (String xpath , String replacementXml ) {
174
189
175
190
m_xpath = xpath ;
176
191
m_replacementXml = replacementXml ;
177
192
}
178
193
194
+ /**
195
+ * @see org.opencms.setup.xml.CmsXmlUpdateAction#executeUpdate(org.dom4j.Document, java.lang.String, boolean)
196
+ */
179
197
@ Override
180
198
public boolean executeUpdate (Document doc , String xpath , boolean forReal ) {
181
199
@@ -300,6 +318,13 @@ private String buildXpathForIndexedDocumentType(String source, String doctype) {
300
318
return xp .toString ();
301
319
}
302
320
321
+ /**
322
+ * Creates an action which adds an indexed type to an index source.<p>
323
+ *
324
+ * @param type the type which should be indexed
325
+ *
326
+ * @return the update action
327
+ */
303
328
private CmsXmlUpdateAction createIndexedTypeAction (final String type ) {
304
329
305
330
return new CmsXmlUpdateAction () {
@@ -327,6 +352,7 @@ private void initActions() {
327
352
StringBuffer xp ;
328
353
CmsXmlUpdateAction action0 = new CmsXmlUpdateAction () {
329
354
355
+ @ SuppressWarnings ("unchecked" )
330
356
@ Override
331
357
public boolean executeUpdate (Document doc , String xpath , boolean forReal ) {
332
358
@@ -502,6 +528,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
502
528
//
503
529
CmsXmlUpdateAction action1 = new CmsXmlUpdateAction () {
504
530
531
+ @ SuppressWarnings ("synthetic-access" )
505
532
@ Override
506
533
public boolean executeUpdate (Document doc , String xpath , boolean forReal ) {
507
534
@@ -511,7 +538,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
511
538
return true ;
512
539
}
513
540
return false ;
514
- };
541
+ }
515
542
};
516
543
xp = new StringBuffer (256 );
517
544
xp .append (getCommonPath ());
@@ -528,6 +555,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
528
555
//
529
556
CmsXmlUpdateAction action2 = new CmsXmlUpdateAction () {
530
557
558
+ @ SuppressWarnings ("synthetic-access" )
531
559
@ Override
532
560
public boolean executeUpdate (Document doc , String xpath , boolean forReal ) {
533
561
@@ -546,7 +574,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
546
574
"gallery_fields" ,
547
575
new String [] {"gallery_source" , "gallery_modules_source" });
548
576
return true ;
549
- };
577
+ }
550
578
};
551
579
xp = new StringBuffer (256 );
552
580
xp .append (getCommonPath ());
@@ -563,6 +591,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
563
591
//
564
592
CmsXmlUpdateAction action3 = new CmsXmlUpdateAction () {
565
593
594
+ @ SuppressWarnings ("synthetic-access" )
566
595
@ Override
567
596
public boolean executeUpdate (Document doc , String xpath , boolean forReal ) {
568
597
0 commit comments