View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.system;
17  
18  import java.util.List;
19  import java.util.zip.ZipInputStream;
20  import java.util.zip.ZipOutputStream;
21  
22  /***
23   * @author someda
24   */
25  public interface DesignService {
26  	
27  	/***
28  	 * design template(skin) name indicates the one within site archive
29  	 */
30  	public static final String ARCHIVE_SKIN_NAME = "archive";
31  	
32  	/***
33  	 * design template(skin) name system provides
34  	 */
35  	public static final String SYSTEM_SKIN_NAME = "basic";	
36  	
37  	/***
38  	 * initialization methos at startup
39  	 */
40  	public void init();
41  
42  	/***
43  	 * Returns all skinname available for system
44  	 */
45  	public String[] getAllSkinNames();
46  	
47  	/***
48  	 * Returns available skinname list for a given site
49  	 */
50  	public String[] getAvailableSkinNames(String siteName);
51  
52  	/***
53  	 * Uploads skin zip archive, this for Web-interface
54  	 */
55  	public void uploadSkin(String skinName, ZipInputStream zipInput) throws TgwServiceException;
56  	
57  	/***
58  	 * Download skin as zip archive, this for Web-interface
59  	 */	
60  	public void downloadSkin(String skinName, ZipOutputStream zipOutput) throws TgwServiceException;	
61  	
62  	/***
63  	 * Delete skin under template store (that is, Web-DAV area)
64  	 */
65  	public void deleteSkin(String skinName, List configList) throws TgwServiceException;
66  		
67  	/***
68  	 * Sync site-local skin files with repository skin files (Web-DAV or backup archive)
69  	 * @param overwrite if set is true, overwrites site-local data with repository data, 
70  	 * else at first it cleans up site-local directory and then copy repository skins there.
71  	 */
72  	public void sync(SiteConfig siteConfig, boolean overwrite) throws TgwServiceException;
73  			
74  	/***
75  	 * Validate skin directory
76  	 */
77  	public boolean validate(String skin);
78  	
79  	/***
80  	 * Save design configuration
81  	 */
82  	public void saveConfig(DesignConfig designConfig) throws TgwServiceException;
83  	
84  	public DesignConfig getDesignConfig(String skinName);
85  	
86  }