Beispiel #1
0
 /// <summary>
 /// Quick copy this artefact in the context of the specific package, and the specific containing artefact only.
 /// </summary>
 /// <param name="packageProject">The project.</param>
 /// <param name="parentArtefact">The deployable SharePoint artefact.</param>
 /// <param name="requiresQuickPackage">Flag to indicate it requires a quick package.</param>
 public override void QuickCopy(SharePointPackageArtefact packageProject, QuickCopyableSharePointArtefact parentArtefact, bool requiresQuickPackage)
 {
     if (parentArtefact == null)
     {
         throw new NotSupportedException();
     }
     else if (parentArtefact is SharePointProjectFeatureArtefact || parentArtefact is SharePointPackageArtefact)
     {
         SharePointProjectFeatureArtefact feature = parentArtefact as SharePointProjectFeatureArtefact;
         this.QuickCopy(packageProject, feature, requiresQuickPackage);
     }
     else
     {
         throw new NotSupportedException();
     }
 }
        /// <summary>
        /// Quick copy this artefact in the context of the specific package, and the specific containing artefact only.
        /// </summary>
        /// <param name="packageProject">The project.</param>
        /// <param name="parentArtefact">The deployable SharePoint artefact.</param>
        /// <param name="requiresQuickPackage">Flag to indicate it requires a quick package.</param>
        public override void QuickCopy(SharePointPackageArtefact packageProject, QuickCopyableSharePointArtefact parentArtefact, bool requiresQuickPackage)
        {
            if (parentArtefact == null)
            {
                throw new NotSupportedException();
            }
            else if (parentArtefact is SharePointPackageArtefact)
            {
                string sourcePathBase    = packageProject.BasePackagePath;
                string featureFolderName = this.FeatureFolderName;

                feature.Project.ProjectService.Logger.ActivateOutputWindow();
                feature.Project.ProjectService.Logger.WriteLine("------ Quick Copying Feature: " + this.FeatureFolderName + " ------", LogCategory.Status);

                // Feature.xml must first be Quick Copied.
                if (requiresQuickPackage)
                {
                    // Tokens consist of those from this package, and feature.
                    Dictionary <string, string> allTokens = new Dictionary <string, string>();
                    allTokens.AddRange(packageProject.GetReplacementTokens());
                    allTokens.AddRange(this.Tokens);

                    // TODO: Merge feature.feature.
                    feature.Project.ProjectService.Logger.ActivateOutputWindow();
                    feature.Project.ProjectService.Logger.WriteLine("WARNING: Quick packaging of changes to Feature.feature is not yet supported.  The last packaged version of the file will be copied.", LogCategory.Warning);

                    //QuickDeploymentUtilities.CopyFileWithTokenReplacement(packageProject.Project, file.Name, originalFileProjectRelative, sourcePackagePathProjectRelative, allTokens);
                }

                DeploymentUtilities.CopyFile(packageProject.Project, "Feature.xml", Path.Combine(sourcePathBase, featureFolderName), "{SharePointRoot}\\Template\\Features\\" + featureFolderName);

                // Process items in features.  Note that we are only processing items that have been set to be packaged.
                foreach (SharePointProjectItemArtefact spi in this.ChildArtefacts.Select(ca => ca as SharePointProjectItemArtefact))
                {
                    spi.QuickCopy(packageProject, this, requiresQuickPackage);
                }
            }
            else
            {
                throw new NotSupportedException();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Quick copy this artefact in the context of the specific package, and the specific containing artefact only.
        /// </summary>
        /// <param name="packageProject">The project.</param>
        /// <param name="parentArtefact">The deployable SharePoint artefact.</param>
        /// <param name="requiresQuickPackage">Flag to indicate it requires a quick package.</param>
        public override void QuickCopy(SharePointPackageArtefact packageProject, QuickCopyableSharePointArtefact parentArtefact, bool requiresQuickPackage)
        {
            if (parentArtefact == null)
            {
                throw new NotSupportedException();
            }
            else if (parentArtefact is SharePointProjectFeatureArtefact || parentArtefact is SharePointPackageArtefact)
            {
                packageProject.Project.ProjectService.Logger.ActivateOutputWindow();
                packageProject.Project.ProjectService.Logger.WriteLine("------ Quick Copying SPI in " + (parentArtefact is SharePointPackageArtefact ? "Package" : "Feature") + ": " + item.Name + " ------", LogCategory.Status);

                foreach (SharePointProjectItemFileArtefact spiFile in this.ChildArtefacts.Select(ca => ca as SharePointProjectItemFileArtefact))
                {
                    spiFile.QuickCopy(packageProject, parentArtefact, requiresQuickPackage);
                }
            }
            else
            {
                throw new NotSupportedException();
            }
        }
 /// <summary>
 /// Quick copy this artefact in the context of the specific package, and the specific containing artefact only.
 /// </summary>
 /// <param name="packageProject">The project.</param>
 /// <param name="parentArtefact">The deployable SharePoint artefact.</param>
 /// <param name="requiresQuickPackage">Flag to indicate it requires a quick package.</param>
 public abstract void QuickCopy(SharePointPackageArtefact packageProject, QuickCopyableSharePointArtefact parentArtefact, bool requiresQuickPackage);
Beispiel #5
0
 /// <summary>
 /// Quick copy this artefact in the context of the specific package, and the specific containing artefact only.
 /// </summary>
 /// <param name="packageProject">The project.</param>
 /// <param name="parentArtefact">The deployable SharePoint artefact.</param>
 /// <param name="requiresQuickPackage">Flag to indicate it requires a quick package.</param>
 public override void QuickCopy(SharePointPackageArtefact packageProject, QuickCopyableSharePointArtefact parentArtefact, bool requiresQuickPackage)
 {
     QuickCopy(requiresQuickPackage);
 }