1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.sharepoint.methods;
16  
17  import com.liferay.portal.sharepoint.Leaf;
18  import com.liferay.portal.sharepoint.Property;
19  import com.liferay.portal.sharepoint.ResponseElement;
20  import com.liferay.portal.sharepoint.SharepointRequest;
21  import com.liferay.portal.sharepoint.Tree;
22  
23  import java.util.ArrayList;
24  import java.util.List;
25  
26  /**
27   * <a href="ServerVersionMethodImpl.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Bruno Farache
30   */
31  public class ServerVersionMethodImpl extends BaseMethodImpl {
32  
33      public ServerVersionMethodImpl() {
34          Tree serverVersionTree = new Tree();
35  
36          serverVersionTree.addChild(new Leaf("major ver", "6", true));
37          serverVersionTree.addChild(new Leaf("minor ver", "0", true));
38          serverVersionTree.addChild(new Leaf("phase ver", "2", true));
39          serverVersionTree.addChild(new Leaf("ver incr", "8117", true));
40  
41          Property serverVersionProperty = new Property(
42              getMethodName(), serverVersionTree);
43  
44          _elements.add(serverVersionProperty);
45          _elements.add(new Property("source control", "1"));
46      }
47  
48      public String getMethodName() {
49          return _METHOD_NAME;
50      }
51  
52      protected List<ResponseElement> getElements(
53          SharepointRequest sharepointRequest) {
54  
55          return _elements;
56      }
57  
58      private static final String _METHOD_NAME = "server version";
59  
60      private List<ResponseElement> _elements = new ArrayList<ResponseElement>();
61  
62  }