001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.sharepoint.methods;
016    
017    import com.liferay.portal.sharepoint.Leaf;
018    import com.liferay.portal.sharepoint.Property;
019    import com.liferay.portal.sharepoint.ResponseElement;
020    import com.liferay.portal.sharepoint.SharepointRequest;
021    import com.liferay.portal.sharepoint.Tree;
022    
023    import java.util.ArrayList;
024    import java.util.List;
025    
026    /**
027     * @author Bruno Farache
028     */
029    public class OpenServiceMethodImpl extends BaseMethodImpl {
030    
031            public OpenServiceMethodImpl() {
032                    Tree metaInfoTree = new Tree();
033    
034                    metaInfoTree.addChild(new Leaf("vti_casesensitiveurls", "IX|0", false));
035                    metaInfoTree.addChild(new Leaf("vti_longfilenames", "IX|1", false));
036                    metaInfoTree.addChild(
037                            new Leaf("vti_welcomenames", "VX|index.html", false));
038                    metaInfoTree.addChild(new Leaf("vti_username", "SX|joebloggs", false));
039                    metaInfoTree.addChild(new Leaf("vti_servertz", "SX|-0700", false));
040                    metaInfoTree.addChild(
041                            new Leaf("vti_sourcecontrolsystem", "SR|lw", false));
042                    metaInfoTree.addChild(
043                            new Leaf("vti_sourcecontrolversion", "SR|V1", false));
044                    metaInfoTree.addChild(
045                            new Leaf("vti_doclibwebviewenabled", "IX|0", false));
046                    metaInfoTree.addChild(
047                            new Leaf("vti_sourcecontrolcookie", "SX|fp_internal", false));
048                    metaInfoTree.addChild(
049                            new Leaf(
050                                    "vti_sourcecontrolproject", "SX|<STS-based Locking>",
051                                    false));
052    
053                    Tree serviceTree = new Tree();
054    
055                    serviceTree.addChild(new Leaf("service_name", "/sharepoint", true));
056                    serviceTree.addChild(new Leaf("meta_info", metaInfoTree));
057    
058                    Property serviceProperty = new Property("service", serviceTree);
059    
060                    _elements.add(serviceProperty);
061            }
062    
063            public String getMethodName() {
064                    return _METHOD_NAME;
065            }
066    
067            protected List<ResponseElement> getElements(
068                    SharepointRequest sharepointRequest) {
069    
070                    return _elements;
071            }
072    
073            private static final String _METHOD_NAME = "open service";
074    
075            private List<ResponseElement> _elements = new ArrayList<ResponseElement>();
076    
077    }