示例#1
0
		/// <summary>
		/// Called when a provider is first created.  Must register all associated namespaces with the federation.
		/// Can also be used to create initial content in the namespaces.
		/// </summary>
		/// <param name="aFed"></param>
		public IList CreateNamespaces(Federation aFed)
		{
			ArrayList answer = new ArrayList();

			if( SqlNamespaceProvider.Exists(Namespace, ConnectionString) )
			{
				throw new Exception("Namespace with the specified name already exists.");
			}

			this.CreateNamespace(Namespace, ConnectionString);

			SqlStore store = new SqlStore(aFed, Namespace, ConnectionString);
			aFed.RegisterNamespace(store);
			store.WriteTopic(store.DefinitionTopicName.LocalName, "");
			store.SetFieldValue(store.DefinitionTopicName.LocalName, "Contact", Contact, false);
			store.SetFieldValue(store.DefinitionTopicName.LocalName, "Title", Title, false);
			string defaultImportedNamespaces = System.Configuration.ConfigurationSettings.AppSettings["DefaultImportedNamespaces"];
			if (defaultImportedNamespaces != null)
				store.SetFieldValue(store.DefinitionTopicName.LocalName, "Import", defaultImportedNamespaces, false);

			// whoever is last should write a new version
			store.SetFieldValue(store.DefinitionTopicName.LocalName, "Description", NamespaceDescription, true);
			answer.Add(Namespace);
			return ArrayList.ReadOnly(answer);
		}
		public void LoadNamespaces(Federation aFed)
		{
			int month = 1;
			foreach (string each in NamespaceNames)
			{
				CalendarStore store = new CalendarStore(aFed, each, Year, month++);
				aFed.RegisterNamespace(store);
			}
		}
		public IList CreateNamespaces(Federation aFed)
		{
			int month = 1;
			ArrayList answer = new ArrayList();
			foreach (string each in NamespaceNames)
			{
				CalendarStore store = new CalendarStore(aFed, each, Year, month);
				answer.Add(store.Namespace);
				aFed.RegisterNamespace(store);
			}
			return ArrayList.ReadOnly(answer);
		}
 public void LoadNamespaces(Federation aFed)
 {
     FileSystemStore store = new FileSystemStore();
     aFed.RegisterNamespace(store, Namespace);
 }
        public IList CreateNamespaces(Federation aFed)
        {
            string author = "";
            FileSystemStore store = new FileSystemStore();
            NamespaceManager manager = aFed.RegisterNamespace(store, Namespace);
            manager.WriteTopic(NamespaceManager.DefinitionTopicLocalName, "");
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Contact", Contact, false, author);
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Title", Title, false, author);
            string defaultImportedNamespaces = System.Configuration.ConfigurationManager.AppSettings["DefaultImportedNamespaces"];
            if (defaultImportedNamespaces != null)
            {
                manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Import", defaultImportedNamespaces, false, author);
            }

            // whoever is last should write a new version
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Description", NamespaceDescription, true, author);

            ArrayList answer = new ArrayList();
            answer.Add(Namespace);
            return ArrayList.ReadOnly(answer);
        }
        public IList CreateNamespaces(Federation aFed)
        {
            string author = "";
            FileSystemStore store = new FileSystemStore();
            // If no one has set the Root, we should set it to the default value. If we don't,
            // then the default is the web application directory, which isn't right.
            // It won't hurt if someone has already set, since in that case DefaultedRoot is the
            // same as just Root.
            SetParameter(c_root, DefaultedRoot);
            NamespaceManager manager = aFed.RegisterNamespace(store, Namespace, _parameters);
            manager.WriteTopic(NamespaceManager.DefinitionTopicLocalName, "");
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Contact", Contact, false, author);
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Title", Title, false, author);
            string defaultImportedNamespaces = aFed.Configuration.DefaultImportedNamespaces;
            if (defaultImportedNamespaces != null)
            {
                manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Import", defaultImportedNamespaces, false, author);
            }

            // whoever is last should write a new version
            manager.SetTopicPropertyValue(NamespaceManager.DefinitionTopicLocalName, "Description", NamespaceDescription, true, author);

            ArrayList answer = new ArrayList();
            answer.Add(Namespace);
            return ArrayList.ReadOnly(answer);
        }
 public void LoadNamespaces(Federation aFed)
 {
     int month = 1;
     foreach (string each in NamespaceNames)
     {
         CalendarStore store = new CalendarStore(Year, month++);
         NamespaceManager manager = aFed.RegisterNamespace(store, each);
     }
 }
示例#8
0
		/// <summary>
		/// Called when a provider should instantiate and register all of its namespaces in a federation.  
		/// Note that when a provider is first created (e.g., via the admin UI) that this function is not 
		/// called.
		/// </summary>
		/// <param name="aFed"></param>
		public void LoadNamespaces(Federation aFed)
		{
			SqlStore store = new SqlStore(aFed, Namespace, ConnectionString);
			aFed.RegisterNamespace(store);
		}