@@ -0,0 +1,2144 @@
+/*%0A * Copyright 2022 Allette Systems (Australia)%0A * http://www.allette.com.au%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.pageseeder.ox.pageseeder.xml;%0Aimport org.pageseeder.bridge.model.PSNotify;%0Aimport org.xml.sax.Attributes;%0Aimport org.xml.sax.helpers.DefaultHandler;%0A%0Aimport net.pageseeder.app.simple.pageseeder.model.CommentParameter;%0Aimport net.pageseeder.app.simple.pageseeder.model.builder.CommentParameterBuilder;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author Eddy Shao%0A * @since 07 September 2022%0A */%0A%0Apublic class CommentParameterHandler extends DefaultHandler %7B%0A%0A  private final CommentParameterBuilder cpBuilder;%0A  List%3CCommentParameter%3E cp;%0A%0A  public CommentParameterHandler() %7B%0A    this.cp = new ArrayList%3C%3E();%0A    this.cpBuilder = new CommentParameterBuilder();%0A  %7D%0A%0A  @Override%0A  public void startElement(String uri, String localName, String qName, Attributes attributes) %7B%0A    if (localName.equals(%22comment%22)) %7B%0A      cpBuilder.id(Long.valueOf(attributes.getValue(%22commentid%22)));%0A      cpBuilder.title(attributes.getValue(%22title%22));%0A      cpBuilder.content(attributes.getValue(%22content%22));%0A      cpBuilder.contentRole(attributes.getValue(%22contenttype%22));%0A      cpBuilder.labels(attributes.getValue(%22labels%22));%0A      cpBuilder.properties(attributes.getValue(%22properties%22));%0A      cpBuilder.notify(PSNotify.valueOf(attributes.getValue(%22notify%22)));%0A      cpBuilder.type(attributes.getValue(%22type%22));%0A%0A      CommentParameter currCp = cpBuilder.buildComment();%0A      this.cp.add(currCp);%0A    %7D%0A  %7D%0A%0A  public List%3CCommentParameter%3E getCommentParameters() %7B%0A    return this.cp;%0A  %7D%0A%7D%0A

create new comment parameter handler