package org.frameworkset.web.servlet.context;

import java.util.List;

import org.frameworkset.spi.BaseApplicationContext;
import org.frameworkset.spi.assemble.LinkConfigFile;
import org.frameworkset.spi.assemble.ManagerImport;
import org.frameworkset.spi.assemble.ManagerImportWrapper;
import org.frameworkset.spi.assemble.ServiceProviderManager;

public class WebServiceManagerProvider extends ServiceProviderManager{

	public WebServiceManagerProvider(BaseApplicationContext applicationContext, String charset) {
		super(applicationContext, charset);
		// TODO Auto-generated constructor stub
	}

	public WebServiceManagerProvider(BaseApplicationContext applicationContext) {
		super(applicationContext);
		// TODO Auto-generated constructor stub
	}
	
	 protected ManagerImportWrapper sortManagerImports(List<ManagerImport> mis)
    {
		 ManagerImportWrapper mi = new ManagerImportWrapper();
		 mi.setImports(mis);
		 if(mis == null || mis.size() == 0)
		 {
			 
			 return mi;
		 }
		 ManagerImport imp = null;
		 int position = -1;
		 for(int i = 0; i < mis.size(); i ++)
		 {
			 imp = mis.get(i);
			 if(imp.getFile().endsWith("bboss-mvc.xml"))
			 {
				 position = i;
				 break;
			 }
		 }
		 if(position > 0)
		 {
			 mis.remove(position);
			 mis.add(0, imp);
			 LinkConfigFile linkconfigFile = new WebLinkConfigFile(null, imp.getFile(), null);
			 mi.setParent(linkconfigFile);
		 }
		 return mi;
    }

}

@@ -1251,16 +1251,17 @@
 sition %3E
+=
  0)%0D%0A%09%09 
@@ -1259,24 +1259,54 @@
 = 0)%0D%0A%09%09 %7B%0D%0A
+%09%09%09 if(position %3E 0)%0D%0A%09%09%09 %7B%0D%0A%09
 %09%09%09 mis.remo
@@ -1323,16 +1323,17 @@
 n);%0D%0A%09%09%09
+%09
  mis.add
@@ -1339,24 +1339,31 @@
 d(0, imp);%0D%0A
+%09%09%09 %7D%0D%0A
 %09%09%09 LinkConf

修复bug：mvc中引入的外部属性文件，在当bboss-mvc。xml被第一个解析时，加载其中的属性对其他mvc配置文件不可见，导致无法获取外部属性