├── .gitattributes ├── .gitignore ├── Assemblies ├── 15 │ ├── Microsoft.SharePoint.Publishing.dll │ ├── Microsoft.SharePoint.Taxonomy.dll │ └── Microsoft.SharePoint.dll ├── 16.0 │ ├── Microsoft.SharePoint.Publishing.dll │ ├── Microsoft.SharePoint.Taxonomy.dll │ └── Microsoft.SharePoint.dll ├── 16.1 │ ├── Microsoft.SharePoint.Publishing.dll │ ├── Microsoft.SharePoint.Taxonomy.dll │ └── Microsoft.SharePoint.dll └── readme.md ├── Enmarcha.SharePoint.Abstract ├── Encamina.SharePoint.snk ├── Enmarcha.SharePoint.Abstract.csproj ├── Entities │ ├── CustomProperties.cs │ └── TaxonomyValue.cs ├── Enum │ ├── ListTemplateType.cs │ ├── RoleType.cs │ ├── TypeDate.cs │ ├── TypeField.cs │ ├── TypeForm.cs │ ├── TypeList.cs │ ├── TypeOperators.cs │ └── TypeOrder.cs ├── Interfaces │ ├── Artefacts │ │ ├── IContentType.cs │ │ ├── IListSharePoint.cs │ │ ├── ILog.cs │ │ ├── IMasterPage.cs │ │ ├── ISite.cs │ │ ├── ISiteColumn.cs │ │ └── ITaxonomy.cs │ └── Data │ │ ├── IPageable.cs │ │ ├── IQuery.cs │ │ └── IRepository.cs └── Properties │ └── AssemblyInfo.cs ├── Enmarcha.SharePoint.Test ├── App.config ├── Base │ └── ContextSharePoint.cs ├── Enmarcha.SharePoint.Test.csproj ├── Integration │ ├── UTIntegrationColumnSite.cs │ ├── UTIntegrationContentType.cs │ ├── UTIntegrationExtensors.cs │ ├── UTIntegrationListSharePoint.cs │ ├── UTIntegrationSite.cs │ └── UTIntegrationTaxonomy.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── Enmarcha.SharePoint.sln ├── Enmarcha.SharePoint ├── Attribute │ └── EnmarchaAttribute.cs ├── Enmarcha.SharePoint.OnPremises.csproj ├── Enmarcha.SharePointOnpremises.snk ├── Entities │ ├── Artefacts │ │ ├── ContentType.cs │ │ ├── ListSharePoint.cs │ │ ├── MasterPage.cs │ │ ├── Site.cs │ │ ├── SiteColumn.cs │ │ └── Taxonomy.cs │ ├── Data │ │ ├── Query.cs │ │ └── SharePointRepository.cs │ └── Logs │ │ ├── ApplicationDirectory.cs │ │ ├── LogManager.cs │ │ └── LoggingService.cs ├── Extensors │ ├── ColumnSite.cs │ ├── ContentType.cs │ ├── Design.cs │ ├── Language.cs │ ├── List.cs │ ├── RolesManagment.cs │ ├── Site.cs │ └── Taxonomy.cs ├── Helpers │ ├── Constants.cs │ ├── Data │ │ ├── Currency.cs │ │ ├── FieldBase.cs │ │ ├── LookupFieldEnc.cs │ │ ├── Taxonomy.cs │ │ ├── UrlField.cs │ │ └── UserSP.cs │ ├── Extensors │ │ ├── ConfigurationColumn.cs │ │ ├── CustomProperty.cs │ │ ├── ParamsColumnSite.cs │ │ └── ParamsCreateSite.cs │ ├── SiteColumn │ │ ├── ParamsSiteColumnBase.cs │ │ ├── ParamsSiteColumnBaseExtended.cs │ │ ├── ParamsSiteColumnChoices.cs │ │ └── ParamsSiteColumnDefaultValue.cs │ └── Taxonomy │ │ └── TaxonomyNavigationValue.cs ├── Properties │ └── AssemblyInfo.cs └── lib │ ├── Microsoft.SharePoint.Publishing.dll │ ├── Microsoft.SharePoint.Taxonomy.dll │ └── Microsoft.SharePoint.dll ├── LICENSE.txt ├── README.md └── Samples ├── Enmarcha.Samples.ImageGalleryWebPart ├── Enmarcha.ImageGalery.Model │ ├── Enmarcha.ImageGalery.Model.csproj │ ├── ImageGallery.cs │ ├── ModelWebPart.snk │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── Enmarcha.ImageGalery.SP │ ├── Enmarcha.ImageGalery.SP.csproj │ ├── Features │ │ └── Main │ │ │ ├── Main.EventReceiver.cs │ │ │ ├── Main.Template.xml │ │ │ └── Main.feature │ ├── Helper │ │ └── Constants.cs │ ├── Module │ │ └── StyleLibrary │ │ │ ├── Elements.xml │ │ │ ├── SharePointProjectItem.spdata │ │ │ ├── css │ │ │ └── liquidcarousel.css │ │ │ ├── images │ │ │ ├── 01.jpg │ │ │ ├── 02.jpg │ │ │ ├── 03.jpg │ │ │ ├── 04.jpg │ │ │ ├── 05.jpg │ │ │ ├── 06.jpg │ │ │ ├── 07.jpg │ │ │ ├── 08.jpg │ │ │ ├── 09.jpg │ │ │ ├── 10.jpg │ │ │ ├── 11.jpg │ │ │ ├── 12.jpg │ │ │ ├── 13.jpg │ │ │ ├── 14.jpg │ │ │ ├── 15.jpg │ │ │ ├── 16.jpg │ │ │ ├── bodybackground.png │ │ │ ├── download.png │ │ │ ├── next.png │ │ │ ├── previous.png │ │ │ └── text.jpg │ │ │ └── js │ │ │ ├── imagegallery │ │ │ └── init.js │ │ │ ├── jquery-1.4.2.min.js │ │ │ └── jquery.liquidcarousel.min.js │ ├── Package │ │ ├── Package.Template.xml │ │ └── Package.package │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── WebPart │ │ └── ImageGalleryWebPart │ │ │ ├── Elements.xml │ │ │ ├── ImageGalleryWebPart.cs │ │ │ ├── ImageGalleryWebPart.webpart │ │ │ ├── ImageGalleryWebPartUserControl.ascx │ │ │ ├── ImageGalleryWebPartUserControl.ascx.cs │ │ │ ├── ImageGalleryWebPartUserControl.ascx.designer.cs │ │ │ └── SharePointProjectItem.spdata │ ├── key.snk │ └── packages.config ├── Enmarcha.ImageGalery.Service │ ├── Enmarcha.ImageGalery.Service.csproj │ ├── Entities │ │ └── ImageGaleryService.cs │ ├── Interface │ │ └── IImageGaleryService.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ServiceWebPart.snk │ └── packages.config ├── Enmarcha.ImageGalery.Test │ ├── Enmarcha.ImageGalery.Test.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UTImageGalleryService.cs │ └── packages.config ├── Enmarcha.ImageGalery.sln └── README.md ├── Enmarcha.Samples.ManageData ├── App.config ├── Enmarcha.Samples.ManageData.csproj ├── Model │ └── Employed.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── README.md └── packages.config ├── Enmarcha.Samples.PermissionList ├── App.config ├── Enmarcha.Samples.PermissionList.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── README.md └── packages.config ├── Enmarcha.Samples.Provisioning ├── App.config ├── Enmarcha.Samples.Provisioning.csproj ├── Model │ └── Employed.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── README.md └── packages.config ├── Enmarcha.Samples.SiteProvisioning ├── App.config ├── Enmarcha.Samples.SiteProvisioning.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── README.md └── packages.config ├── Enmarcha.SharePoint.Samples.sln └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # Roslyn cache directories 20 | *.ide/ 21 | 22 | # MSTest test Results 23 | [Tt]est[Rr]esult*/ 24 | [Bb]uild[Ll]og.* 25 | 26 | #NUNIT 27 | *.VisualState.xml 28 | TestResult.xml 29 | 30 | # Build Results of an ATL Project 31 | [Dd]ebugPS/ 32 | [Rr]eleasePS/ 33 | dlldata.c 34 | 35 | *_i.c 36 | *_p.c 37 | *_i.h 38 | *.ilk 39 | *.meta 40 | *.obj 41 | *.pch 42 | *.pdb 43 | *.pgc 44 | *.pgd 45 | *.rsp 46 | *.sbr 47 | *.tlb 48 | *.tli 49 | *.tlh 50 | *.tmp 51 | *.tmp_proj 52 | *.log 53 | *.vspscc 54 | *.vssscc 55 | .builds 56 | *.pidb 57 | *.svclog 58 | *.scc 59 | 60 | # Chutzpah Test files 61 | _Chutzpah* 62 | 63 | # Visual C++ cache files 64 | ipch/ 65 | *.aps 66 | *.ncb 67 | *.opensdf 68 | *.sdf 69 | *.cachefile 70 | 71 | # Visual Studio profiler 72 | *.psess 73 | *.vsp 74 | *.vspx 75 | 76 | # TFS 2012 Local Workspace 77 | $tf/ 78 | 79 | # Guidance Automation Toolkit 80 | *.gpState 81 | 82 | # ReSharper is a .NET coding add-in 83 | _ReSharper*/ 84 | *.[Rr]e[Ss]harper 85 | *.DotSettings.user 86 | 87 | # JustCode is a .NET coding addin-in 88 | .JustCode 89 | 90 | # TeamCity is a build add-in 91 | _TeamCity* 92 | 93 | # DotCover is a Code Coverage Tool 94 | *.dotCover 95 | 96 | # NCrunch 97 | _NCrunch_* 98 | .*crunch*.local.xml 99 | 100 | # MightyMoose 101 | *.mm.* 102 | AutoTest.Net/ 103 | 104 | # Web workbench (sass) 105 | .sass-cache/ 106 | 107 | # Installshield output folder 108 | [Ee]xpress/ 109 | 110 | # DocProject is a documentation generator add-in 111 | DocProject/buildhelp/ 112 | DocProject/Help/*.HxT 113 | DocProject/Help/*.HxC 114 | DocProject/Help/*.hhc 115 | DocProject/Help/*.hhk 116 | DocProject/Help/*.hhp 117 | DocProject/Help/Html2 118 | DocProject/Help/html 119 | 120 | # Click-Once directory 121 | publish/ 122 | 123 | # Publish Web Output 124 | *.[Pp]ublish.xml 125 | *.azurePubxml 126 | ## TODO: Comment the next line if you want to checkin your 127 | ## web deploy settings but do note that will include unencrypted 128 | ## passwords 129 | #*.pubxml 130 | 131 | # NuGet Packages Directory 132 | packages/* 133 | ## TODO: If the tool you use requires repositories.config 134 | ## uncomment the next line 135 | #!packages/repositories.config 136 | 137 | # Enable "build/" folder in the NuGet Packages folder since 138 | # NuGet packages use it for MSBuild targets. 139 | # This line needs to be after the ignore of the build folder 140 | # (and the packages folder if the line above has been uncommented) 141 | !packages/build/ 142 | 143 | # Windows Azure Build Output 144 | csx/ 145 | *.build.csdef 146 | 147 | # Windows Store app package directory 148 | AppPackages/ 149 | 150 | # Others 151 | sql/ 152 | *.Cache 153 | ClientBin/ 154 | [Ss]tyle[Cc]op.* 155 | ~$* 156 | *~ 157 | *.dbmdl 158 | *.dbproj.schemaview 159 | *.pfx 160 | *.publishsettings 161 | node_modules/ 162 | 163 | # RIA/Silverlight projects 164 | Generated_Code/ 165 | 166 | # Backup & report files from converting an old project file 167 | # to a newer Visual Studio version. Backup files are not needed, 168 | # because we have git ;-) 169 | _UpgradeReport_Files/ 170 | Backup*/ 171 | UpgradeLog*.XML 172 | UpgradeLog*.htm 173 | 174 | # SQL Server files 175 | *.mdf 176 | *.ldf 177 | 178 | # Business Intelligence projects 179 | *.rdl.data 180 | *.bim.layout 181 | *.bim_*.settings 182 | 183 | # Microsoft Fakes 184 | FakesAssemblies/ 185 | 186 | # LightSwitch generated files 187 | GeneratedArtifacts/ 188 | _Pvt_Extensions/ 189 | ModelManifest.xml -------------------------------------------------------------------------------- /Assemblies/15/Microsoft.SharePoint.Publishing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/15/Microsoft.SharePoint.Publishing.dll -------------------------------------------------------------------------------- /Assemblies/15/Microsoft.SharePoint.Taxonomy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/15/Microsoft.SharePoint.Taxonomy.dll -------------------------------------------------------------------------------- /Assemblies/15/Microsoft.SharePoint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/15/Microsoft.SharePoint.dll -------------------------------------------------------------------------------- /Assemblies/16.0/Microsoft.SharePoint.Publishing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.0/Microsoft.SharePoint.Publishing.dll -------------------------------------------------------------------------------- /Assemblies/16.0/Microsoft.SharePoint.Taxonomy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.0/Microsoft.SharePoint.Taxonomy.dll -------------------------------------------------------------------------------- /Assemblies/16.0/Microsoft.SharePoint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.0/Microsoft.SharePoint.dll -------------------------------------------------------------------------------- /Assemblies/16.1/Microsoft.SharePoint.Publishing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.1/Microsoft.SharePoint.Publishing.dll -------------------------------------------------------------------------------- /Assemblies/16.1/Microsoft.SharePoint.Taxonomy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.1/Microsoft.SharePoint.Taxonomy.dll -------------------------------------------------------------------------------- /Assemblies/16.1/Microsoft.SharePoint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Assemblies/16.1/Microsoft.SharePoint.dll -------------------------------------------------------------------------------- /Assemblies/readme.md: -------------------------------------------------------------------------------- 1 | # 16 folder # 2 | - **Current version:** SharePoint Online Client Components from updated Nuget: http://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM (version **16.1.3912.1204**) 3 | - **Version until 10th of April 2015:** SharePoint Online Client Components SDK: http://www.microsoft.com/en-us/download/details.aspx?id=42038 (version **16.0.3104.1200**) 4 | - **Version up until September 3th 2014:** SharePoint Online Client Components SDK: http://www.microsoft.com/en-us/download/details.aspx?id=42038 (version **16.0.2617.1200**) 5 | 6 | # 15 folder # 7 | - **Current version:** version deployed with the April 2015 CU: no separate redist (version **15.0.4711.1000**) 8 | - **Version up until April 15th 2015:** version deployed with the March 2015 CU: no separate redist (version **15.0.4701.1000**) 9 | - **Version up until March 12th 2015:** version deployed with the February 2015 CU: no separate redist (version **15.0.4693.1000**) 10 | - **Version up until February 12th 2015:** version deployed with the December 2014 CU: no separate redist (version **15.0.4675.1000**) 11 | - **Version up until December 14th 2014:** SharePoint Server 2013 Client Components SDK: http://www.microsoft.com/en-us/download/details.aspx?id=35585 (version **15.0.4641.1000**). Note that only the following assemblies have been changed compared to the previous version: 12 | - Microsoft.Online.SharePoint.Client.Tenant.dll 13 | - Microsoft.SharePoint.Client.dll 14 | - **Version up until September 3th 2014:** version deployed with the April 2014 CU: no separate redist (version **15.0.4605.1000**) 15 | - **Up until version 2.0 of Office AMS (=old CodePlex release)**: SharePoint Server 2013 Client Components SDK: http://www.microsoft.com/en-us/download/details.aspx?id=35585 (version **15.0.4420.1017**) -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Encamina.SharePoint.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Enmarcha.SharePoint.Abstract/Encamina.SharePoint.snk -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Entities/CustomProperties.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Entities 2 | { 3 | public sealed class CustomProperties 4 | { 5 | public string Name { get; set; } 6 | public string Value { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Entities/TaxonomyValue.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enmarcha.SharePoint.Abstract.Entities; 3 | 4 | namespace Enmarcha.SharePoint.Abstract.Class 5 | { 6 | public sealed class TaxonomyValue 7 | { 8 | public string Name { get; set; } 9 | public IList Properties { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/ListTemplateType.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum ListTemplateType 4 | { 5 | InvalidType = -1, 6 | NoListTemplate = 0, 7 | GenericList = 100, 8 | DocumentLibrary = 101, 9 | Survey = 102, 10 | Links = 103, 11 | Announcements = 104, 12 | Contacts = 105, 13 | Events = 106, 14 | Tasks = 107, 15 | DiscussionBoard = 108, 16 | PictureLibrary = 109, 17 | DataSources = 110, 18 | WebTemplateCatalog = 111, 19 | UserInformation = 112, 20 | WebPartCatalog = 113, 21 | ListTemplateCatalog = 114, 22 | XMLForm = 115, 23 | MasterPageCatalog = 116, 24 | NoCodeWorkflows = 117, 25 | WorkflowProcess = 118, 26 | WebPageLibrary = 119, 27 | CustomGrid = 120, 28 | SolutionCatalog = 121, 29 | NoCodePublic = 122, 30 | ThemeCatalog = 123, 31 | DesignCatalog = 124, 32 | AppDataCatalog = 125, 33 | DataConnectionLibrary = 130, 34 | WorkflowHistory = 140, 35 | GanttTasks = 150, 36 | HelpLibrary = 151, 37 | AccessRequest = 160, 38 | TasksWithTimelineAndHierarchy = 171, 39 | MaintenanceLogs = 175, 40 | Meetings = 200, 41 | Agenda = 201, 42 | MeetingUser = 202, 43 | Decision = 204, 44 | MeetingObjective = 207, 45 | TextBox = 210, 46 | ThingsToBring = 211, 47 | HomePageLibrary = 212, 48 | Posts = 301, 49 | Comments = 302, 50 | Categories = 303, 51 | Facility = 402, 52 | Whereabouts = 403, 53 | CallTrack = 404, 54 | Circulation = 405, 55 | Timecard = 420, 56 | Holidays = 421, 57 | IMEDic = 499, 58 | ExternalList = 600, 59 | MySiteDocumentLibrary = 700, 60 | IssueTracking = 1100, 61 | AdminTasks = 1200, 62 | HealthRules = 1220, 63 | HealthReports = 1221, 64 | DeveloperSiteDraftApps = 1230, 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/RoleType.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum RoleType 4 | { 5 | None = 0, 6 | Guest = 1, 7 | Reader = 2, 8 | Contributor = 3, 9 | WebDesigner = 4, 10 | Administrator = 5, 11 | Editor = 6, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeDate.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeDate 4 | { 5 | Date, 6 | DateTime 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeField.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeField 4 | { 5 | Text, 6 | DateTime, 7 | Taxonomy, 8 | User, 9 | Lookup, 10 | Choice, 11 | Boolean, 12 | Note, 13 | Url, 14 | Number, 15 | Currency, 16 | MultiUser, 17 | MultiChoice, 18 | Calculated, 19 | Integer, 20 | Double 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeForm.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeForm 4 | { 5 | Edit, 6 | View, 7 | New, 8 | Display 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeList.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeList 4 | { 5 | GenericList, 6 | DocumentLibrary, 7 | PictureLibrary, 8 | CalendarList 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeOperators.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeOperators 4 | { 5 | Eq, 6 | Neq, 7 | Contains, 8 | Geq, 9 | Gt, 10 | IsNotNull, 11 | IsNull, 12 | Leq, 13 | Lt, 14 | And, 15 | Or 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Enum/TypeOrder.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Enum 2 | { 3 | public enum TypeOrder 4 | { 5 | Asc, 6 | Desc 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/IContentType.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 2 | { 3 | //Interface Icontentype 4 | public interface IContentType 5 | { 6 | bool Create(); 7 | bool Create(string id); 8 | 9 | bool Delete(); 10 | bool Exist(); 11 | bool AddColumn(string name); 12 | 13 | bool RemoveColumn(string name); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/IListSharePoint.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enmarcha.SharePoint.Abstract.Enum; 3 | 4 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 5 | { 6 | public interface IListSharePoint 7 | { 8 | bool Create(string description, ListTemplateType type, bool versionControl); 9 | bool Delete(); 10 | bool Exist(); 11 | bool AddContentType(string contentTypeName); 12 | bool DeleteContentType(string contentTypeName); 13 | 14 | bool AddPermissionsGroup(string group, RoleType role); 15 | bool RemovePermissionsGroup(string group); 16 | bool ClearPermisions(); 17 | bool CreateFolder(string name); 18 | IEnumerable GetContentType(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/ILog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 4 | { 5 | public interface ILog 6 | { 7 | 8 | void Debug(string message); 9 | void Debug(string message, params object[] args); 10 | void Info(string message); 11 | void Info(string message, params object[] args); 12 | void Warn(string message); 13 | void Warn(string message, params object[] args); 14 | void Error(string message); 15 | void Error(string message, params object[] args); 16 | 17 | void Error(string message, Exception t); 18 | void Error(string message, Exception t, params object[] args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/IMasterPage.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 2 | { 3 | public interface IMasterPage 4 | { 5 | string GetMasterPage(); 6 | bool SetMasterPage(string name); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/ISite.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | 3 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 4 | { 5 | public interface ISite 6 | { 7 | bool CreateSite(string web, string title, string description, string template, uint lcid); 8 | bool CreateSite(string web, string title, string description, string template, uint lcid, bool breakPermisions); 9 | bool AddPermision(string group, RoleType role); 10 | bool RemovePermision(string group); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/ISiteColumn.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 2 | { 3 | public interface ISiteColumn 4 | { 5 | bool Create(); 6 | bool CreateTaxonomy(string group, string termSet, bool multivalue, bool requiered); 7 | bool Delete(); 8 | bool Exist(); 9 | bool RenameField(string oldName, string newName); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/ITaxonomy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enmarcha.SharePoint.Abstract.Class; 3 | 4 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Artefacts 5 | { 6 | public interface ITaxonomy 7 | { 8 | IDictionary GetAllTerms(); 9 | bool AddGroup(string group); 10 | bool AddTerms(string name); 11 | bool AddTerms(string name, bool naviagation); 12 | IDictionary GetTerms(string term); 13 | IDictionary GetSubTerms(string term, string subtTerm); 14 | 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Data/IPageable.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Data 2 | { 3 | public interface IPageable 4 | { 5 | int PageSize(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Data/IQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enmarcha.SharePoint.Abstract.Enum; 3 | 4 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Data 5 | { 6 | public interface IQuery 7 | { 8 | IQuery Where(); 9 | IQuery Concat(IQuery operacion1, IQuery operacion2, TypeOperators typeTypeOperator); 10 | IQuery Field(string field, string extra); 11 | IQuery Value(string typeField, string value); 12 | IQuery Operator(TypeOperators typTypeOperators); 13 | IQuery OrderBy(IDictionary fields); 14 | IQuery GroupBy(IDictionary fields); 15 | IQuery ViewFields(IDictionary fields); 16 | string Execute(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Interfaces/Data/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Enmarcha.SharePoint.Abstract.Interfaces.Data 4 | { 5 | public interface IRepository : IPageable 6 | { 7 | T Get(int id); 8 | ICollection GetAll(); 9 | ICollection GetAll(int page); 10 | ICollection Query(IQuery query, int page); 11 | 12 | ICollection Query(string query, int page); 13 | int Insert(T data); 14 | bool Save(int id, T data); 15 | bool Delete(int id); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Abstract/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.SharePoint.Abstract")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.SharePoint.Abstract")] 13 | [assembly: AssemblyCopyright("ENCAMINA © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e85e91b9-ed90-4be2-859c-938639490e67")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Base/ContextSharePoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Security; 4 | using Microsoft.SharePoint; 5 | 6 | namespace Enmarcha.SharePoint.Test.Base 7 | { 8 | internal static class ContextSharePoint 9 | { 10 | #region Constructor 11 | static ContextSharePoint() 12 | { 13 | UserName = ConfigurationManager.AppSettings["OnPremUserName"]; 14 | var password = ConfigurationManager.AppSettings["OnPremPassword"]; 15 | Password = GetSecureString(password); 16 | Domain = ConfigurationManager.AppSettings["OnPremDomain"]; 17 | TenantUrl = ConfigurationManager.AppSettings["OnPremSiteCollection"]; 18 | 19 | } 20 | #endregion 21 | 22 | #region Properties 23 | private static string TenantUrl { get; set; } 24 | private static string UserName { get; set; } 25 | private static SecureString Password { get; set; } 26 | private static string Domain { get; set; } 27 | 28 | 29 | 30 | #endregion 31 | 32 | #region Methods 33 | public static SPSite CreateClientContext() 34 | { 35 | try 36 | { 37 | var site = new SPSite(TenantUrl); 38 | return site; 39 | 40 | } 41 | catch (Exception) 42 | { 43 | 44 | return null; 45 | } 46 | } 47 | 48 | private static SecureString GetSecureString(string input) 49 | { 50 | if (string.IsNullOrEmpty(input)) 51 | throw new ArgumentException("Input string is empty and cannot be made into a SecureString", "input"); 52 | 53 | var secureString = new SecureString(); 54 | foreach (var c in input) 55 | { 56 | secureString.AppendChar(c); 57 | } 58 | return secureString; 59 | } 60 | 61 | public static bool VerifyServer(SPSite site) 62 | { 63 | return site != null; 64 | } 65 | 66 | #endregion 67 | 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Integration/UTIntegrationContentType.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Interfaces; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Enmarcha.SharePoint.Class.Logs; 4 | using Enmarcha.SharePoint.Entities.Artefacts; 5 | using Enmarcha.SharePoint.Helpers.SiteColumn; 6 | using Enmarcha.SharePoint.Test.Base; 7 | using Microsoft.SharePoint; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | 10 | namespace Enmarcha.SharePoint.Test.Integration 11 | { 12 | [TestClass] 13 | public class UtIntegrationContentType 14 | { 15 | public SPSite Site; 16 | public ContentType ContentType; 17 | public Entities.Artefacts.SiteColumn SiteColumn; 18 | public ILog Logger; 19 | [TestInitialize] 20 | public void Init() 21 | { 22 | Site = ContextSharePoint.CreateClientContext(); 23 | if (ContextSharePoint.VerifyServer(Site)) 24 | { 25 | SiteColumn = new Entities.Artefacts.SiteColumn(new ParamsSiteColumnBaseExtended 26 | { 27 | AddPrefix = true, 28 | FieldType = SPFieldType.Text, 29 | Group = "Test", 30 | MultiValue = false, 31 | Name = "test1", 32 | Requiered = false, 33 | Web = Site.RootWeb 34 | }); 35 | SiteColumn.Create(); 36 | } 37 | Logger= new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 38 | 39 | } 40 | [TestMethod] 41 | public void CreateContentType() 42 | { 43 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 44 | ContentType= new ContentType(Site.RootWeb,Logger,"Nuevo Tipo Contenido1","TEST","Item"); 45 | Assert.IsTrue(ContentType.Create(string.Empty)); 46 | Assert.IsTrue(ContentType.Delete()); 47 | } 48 | 49 | [TestMethod] 50 | public void CreateContentTypebyGuid() 51 | { 52 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 53 | ContentType= new ContentType(Site.RootWeb,Logger,"Nuevo tipo Contenido","TEst","Elemento"); 54 | Assert.IsTrue(ContentType.Create("0x0100B84152A0E015D14CA1300027B66FAD1F")); 55 | Assert.IsTrue(ContentType.Delete()); 56 | } 57 | [TestMethod] 58 | public void AddFieldContentType() 59 | { 60 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 61 | ContentType = new ContentType(Site.RootWeb, Logger, "Nuevo Tipo Contenido1", "TEST", "Item"); 62 | Assert.IsTrue(ContentType.Create(string.Empty)); 63 | 64 | Assert.IsTrue(ContentType.AddColumn(SiteColumn.Name)); 65 | Assert.IsTrue(ContentType.Delete()); 66 | } 67 | 68 | [TestMethod] 69 | public void RemoveFieldContentType() 70 | { 71 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 72 | ContentType = new ContentType(Site.RootWeb, Logger, "Nuevo Tipo Contenido1", "TEST", "Item"); 73 | Assert.IsTrue(ContentType.Create(string.Empty)); 74 | Assert.IsTrue(ContentType.AddColumn(SiteColumn.Name)); 75 | Assert.IsTrue(ContentType.RemoveColumn(SiteColumn.Name)); 76 | Assert.IsTrue(ContentType.Exist()); 77 | Assert.IsTrue(ContentType.Delete()); 78 | } 79 | 80 | [TestCleanup] 81 | public void CleanUp() 82 | { 83 | if (ContextSharePoint.VerifyServer(Site)) 84 | { 85 | SiteColumn.Delete(); 86 | Site.Dispose(); 87 | } 88 | 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Integration/UTIntegrationExtensors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Enmarcha.SharePoint.Class.Logs; 4 | using Enmarcha.SharePoint.Extensors; 5 | using Enmarcha.SharePoint.Test.Base; 6 | using Microsoft.SharePoint; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | 9 | namespace Enmarcha.SharePoint.Test.Integration 10 | { 11 | [TestClass] 12 | public class UTIntegrationExtensors 13 | { 14 | public SPSite SpSite; 15 | public ILog Logger; 16 | public UTIntegrationExtensors() 17 | { 18 | SpSite = ContextSharePoint.CreateClientContext(); 19 | Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 20 | 21 | } 22 | [TestMethod] 23 | public void PropertyBug() 24 | { 25 | if (!ContextSharePoint.VerifyServer(SpSite)) Assert.Inconclusive(); 26 | SPWeb web = SpSite.RootWeb; 27 | Assert.IsTrue(web.SetPropertyBag("hola11","World")); 28 | Assert.AreEqual(web.GetPropertyBag("hola11"),"World"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Integration/UTIntegrationListSharePoint.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Enmarcha.SharePoint.Class.Logs; 4 | using Enmarcha.SharePoint.Entities.Artefacts; 5 | using Enmarcha.SharePoint.Helpers.SiteColumn; 6 | using Enmarcha.SharePoint.Test.Base; 7 | using Microsoft.SharePoint; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | 10 | namespace Enmarcha.SharePoint.Test.Integration 11 | { 12 | [TestClass] 13 | public class UTIntegrationListSharePoint 14 | { 15 | public SPSite Site; 16 | public ILog Logger; 17 | public ListSharePoint ListSharePoint; 18 | 19 | [TestInitialize] 20 | public void Init() 21 | { 22 | Site = ContextSharePoint.CreateClientContext(); 23 | Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 24 | } 25 | 26 | [TestMethod] 27 | public void CreateList() 28 | { 29 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 30 | ListSharePoint= new ListSharePoint(Site.RootWeb,Logger,"LISTATEST"); 31 | Assert.IsTrue(ListSharePoint.Create("descripcion", ListTemplateType.Contacts, true)); 32 | Assert.IsTrue(ListSharePoint.Delete()); 33 | } 34 | 35 | [TestMethod] 36 | public void CreateListAddContentType() 37 | { 38 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 39 | var contentType= new ContentType(Site.RootWeb,this.Logger,"TESTHELLO","TEST","Elemento"); 40 | contentType.Create(string.Empty); 41 | ListSharePoint = new ListSharePoint(Site.RootWeb, Logger, "LISTATEST"); 42 | Assert.IsTrue(ListSharePoint.Create("descripcion", ListTemplateType.Contacts, true)); 43 | Assert.IsTrue(ListSharePoint.AddContentType("TESTHELLO")); 44 | Assert.IsTrue(ListSharePoint.DeleteContentType("TESTHELLO")); 45 | Assert.IsFalse(ListSharePoint.AddContentType("TESTBYE")); 46 | Assert.IsTrue(ListSharePoint.Delete()); 47 | } 48 | 49 | 50 | [TestMethod] 51 | public void CreateListAddField() 52 | { 53 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 54 | var contentType = new ContentType(Site.RootWeb, this.Logger, "TESTHELLO", "TEST", "Elemento"); 55 | contentType.Create(string.Empty); 56 | ListSharePoint = new ListSharePoint(Site.RootWeb, Logger, "LISTATEST"); 57 | Assert.IsTrue(ListSharePoint.Create("descripcion", ListTemplateType.Contacts, true)); 58 | var siteColumn = new Entities.Artefacts.SiteColumn(new ParamsSiteColumnBaseExtended 59 | { 60 | AddPrefix = false, 61 | FieldType = SPFieldType.Text, 62 | Group = "Lista", 63 | Logger = this.Logger, 64 | MultiValue = false, 65 | Name = "Field1", 66 | Requiered = true, 67 | Web = Site.RootWeb 68 | }); 69 | Assert.IsTrue(ListSharePoint.AddField(siteColumn)); 70 | Assert.IsTrue(ListSharePoint.DeleteField(siteColumn)); 71 | Assert.IsTrue(ListSharePoint.Delete()); 72 | } 73 | 74 | [TestCleanup] 75 | public void CleanUp() 76 | { 77 | if (ContextSharePoint.VerifyServer(Site)) 78 | { 79 | Site.Dispose(); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Integration/UTIntegrationSite.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Enmarcha.SharePoint.Class.Logs; 4 | using Enmarcha.SharePoint.Entities.Artefacts; 5 | using Enmarcha.SharePoint.Test.Base; 6 | using Microsoft.SharePoint; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | 9 | namespace Enmarcha.SharePoint.Test.Integration 10 | { 11 | [TestClass] 12 | public class UTIntegrationSite 13 | { 14 | public SPSite SpSite; 15 | public ILog Logger; 16 | public Site Site; 17 | 18 | [TestInitialize] 19 | public void Init() 20 | { 21 | SpSite = ContextSharePoint.CreateClientContext(); 22 | Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 23 | } 24 | [TestMethod] 25 | public void CreateSite() 26 | { 27 | if (!ContextSharePoint.VerifyServer(SpSite)) Assert.Inconclusive(); 28 | Site = new Site(SpSite.RootWeb,this.Logger); 29 | Assert.IsTrue(Site.CreateSite("Test", "Test", "Descripcion", "STS#0", 3082)); 30 | 31 | } 32 | 33 | [TestMethod] 34 | public void CreateSiteFail() 35 | { 36 | if (!ContextSharePoint.VerifyServer(SpSite)) Assert.Inconclusive(); 37 | Site = new Site(null, this.Logger); 38 | Assert.IsFalse(Site.CreateSite("Test", "Test", "Descripcion", "STS#0", 3082)); 39 | } 40 | 41 | [TestMethod] 42 | public void Permision() 43 | { 44 | if (!ContextSharePoint.VerifyServer(SpSite)) Assert.Inconclusive(); 45 | Site = new Site(SpSite.RootWeb, this.Logger); 46 | Assert.IsTrue(Site.AddPermision("Administradores de jerarquías",RoleType.Administrator)); 47 | Assert.IsTrue(Site.RemovePermision("Administradores de jerarquías")); 48 | 49 | } 50 | 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Integration/UTIntegrationTaxonomy.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Enmarcha.SharePoint.Class.Logs; 4 | using Enmarcha.SharePoint.Entities.Artefacts; 5 | using Enmarcha.SharePoint.Test.Base; 6 | using Microsoft.SharePoint; 7 | using Microsoft.VisualStudio.TestTools.UnitTesting; 8 | 9 | namespace Enmarcha.SharePoint.Test.Integration 10 | { 11 | [TestClass] 12 | public class UTIntegrationTaxonomy 13 | { 14 | public SPSite Site; 15 | public ILog Logger; 16 | public Taxonomy Taxonomy; 17 | [TestInitialize] 18 | public void Init() 19 | { 20 | Site = ContextSharePoint.CreateClientContext(); 21 | Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 22 | 23 | } 24 | [TestMethod] 25 | public void AddGroup() 26 | { 27 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 28 | Taxonomy= new Taxonomy(this.Site,this.Logger,"Managed Metadata Service"); 29 | Assert.IsTrue(Taxonomy.AddGroup("Test")); 30 | } 31 | [TestMethod] 32 | public void AddGroupFail() 33 | { 34 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 35 | Taxonomy = new Taxonomy(this.Site, this.Logger, string.Empty); 36 | Assert.IsFalse(Taxonomy.AddGroup("Test")); 37 | } 38 | [TestMethod] 39 | public void AddTerm() 40 | { 41 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 42 | Taxonomy = new Taxonomy(this.Site, this.Logger, "Managed Metadata Service","Test"); 43 | Assert.IsTrue(Taxonomy.AddTerms("Adrian")); 44 | } 45 | [TestMethod] 46 | public void GetTerm() 47 | { 48 | if (!ContextSharePoint.VerifyServer(Site)) Assert.Inconclusive(); 49 | Taxonomy = new Taxonomy(this.Site, this.Logger, "Managed Metadata Service", "Test"); 50 | Assert.IsTrue(Taxonomy.GetAllTerms().Any()); 51 | Assert.IsTrue(Taxonomy.GetTerms("Test").Any()); 52 | Assert.IsTrue(Taxonomy.GetSubTerms("Test","Adrian").Count==0); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.SharePoint.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.SharePoint.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("43d7f549-63e7-4c12-87a2-50776a726f03")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint.Test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Attribute/EnmarchaAttribute.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | 3 | namespace Enmarcha.SharePoint.Attribute 4 | { 5 | public sealed class EnmarchaAttribute : System.Attribute 6 | { 7 | public EnmarchaAttribute() 8 | { 9 | Create = true; 10 | SourceList = string.Empty; 11 | Choice = null; 12 | Term = string.Empty; 13 | MultiValue = false; 14 | ValueDefault = string.Empty; 15 | AddPrefeix = true; 16 | Hidden = false; 17 | DisplayName = string.Empty; 18 | Required = false; 19 | Group = "ENCAMINA"; 20 | Formula = string.Empty; 21 | ReadOnly = false; 22 | Date = TypeDate.DateTime; 23 | FormatCurrency = 0; 24 | 25 | } 26 | public TypeField Type { get; set; } 27 | public string Formula { get; set; } 28 | public bool ReadOnly { get; set; } 29 | public bool Create { get; set; } 30 | public string Group { get; set; } 31 | public string[] Choice { get; set; } 32 | public string SourceList { get; set; } 33 | public string Term { get; set; } 34 | public bool MultiValue { get; set; } 35 | public string ValueDefault { get; set; } 36 | public bool AddPrefeix { get; set; } 37 | public string DisplayName { get; set; } 38 | public bool Hidden { get; set; } 39 | public bool Required { get; set; } 40 | public TypeDate Date { get; set; } 41 | public int FormatCurrency { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Enmarcha.SharePointOnpremises.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Enmarcha.SharePoint/Enmarcha.SharePointOnpremises.snk -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Artefacts/ContentType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 4 | using Microsoft.SharePoint; 5 | 6 | namespace Enmarcha.SharePoint.Entities.Artefacts 7 | { 8 | public sealed class ContentType:IContentType 9 | { 10 | #region Properties 11 | 12 | public string Name { get; set; } 13 | public string GroupName { get; set; } 14 | public string Parent { get; set; } 15 | public SPWeb Web { get; set; } 16 | public ILog Logger { get; set; } 17 | 18 | #endregion 19 | 20 | #region Constructor 21 | 22 | /// 23 | /// Constructor 24 | /// 25 | /// 26 | /// 27 | public ContentType(SPWeb web,ILog logger) 28 | { 29 | Web = web; 30 | Logger = logger; 31 | } 32 | 33 | public ContentType(SPWeb web,ILog logger, string name, string groupName, string parent) : this(web,logger) 34 | { 35 | Name = name; 36 | GroupName = groupName; 37 | Parent = parent; 38 | } 39 | 40 | #endregion 41 | 42 | #region Interface 43 | /// 44 | /// Create Te 45 | /// 46 | /// 47 | public bool Create() 48 | { 49 | return Create(string.Empty); 50 | } 51 | /// 52 | /// Create the Content Type 53 | /// 54 | /// GUID the ContentType 55 | /// 56 | public bool Create(string id) 57 | { 58 | try 59 | { 60 | SPContentTypeId idContentType; 61 | SPContentType contentType; 62 | if (!string.IsNullOrEmpty(id)) 63 | { 64 | idContentType = new SPContentTypeId(id); 65 | contentType = Web.ContentTypes[idContentType]; 66 | if (contentType != null) 67 | { 68 | return true; 69 | } 70 | contentType = new SPContentType(idContentType, Web.ContentTypes, Name); 71 | Web.ContentTypes.Add(contentType); 72 | } 73 | else 74 | { 75 | var itemCType = Web.AvailableContentTypes[Parent]; 76 | var cType = new SPContentType(itemCType, Web.ContentTypes, Name) 77 | { 78 | Group = GroupName 79 | }; 80 | contentType = Web.ContentTypes.Add(cType); 81 | idContentType = contentType.Id; 82 | } 83 | 84 | 85 | Web.ContentTypes[idContentType].Group = GroupName; 86 | Web.Update(); 87 | return true; 88 | } 89 | catch (Exception exception) 90 | { 91 | Logger.Error(string.Concat("Error Create ContentType:", exception.Message)); 92 | return false; 93 | } 94 | } 95 | 96 | /// 97 | /// Delete the ContentType 98 | /// 99 | /// 100 | public bool Delete() 101 | { 102 | try 103 | { 104 | var cType = Web.ContentTypes[Name]; 105 | cType.Delete(); 106 | } 107 | catch (Exception exception) 108 | { 109 | Logger.Error(string.Concat("Delete ContentType", exception.Message)); 110 | return false; 111 | } 112 | return true; 113 | } 114 | 115 | /// 116 | /// Checks for this content type 117 | /// 118 | /// 119 | public bool Exist() 120 | { 121 | try 122 | { 123 | var contentTypeCollection = Web.ContentTypes; 124 | return contentTypeCollection.Cast().Any(itemContentType => itemContentType.Name == Name); 125 | } 126 | catch (Exception exception) 127 | { 128 | Logger.Error(string.Concat("Exist ContentType:", exception.Message)); 129 | return false; 130 | } 131 | } 132 | 133 | /// 134 | /// Add Column Site of Content Type 135 | /// 136 | /// name of column 137 | /// 138 | public bool AddColumn(string name) 139 | { 140 | try 141 | { 142 | 143 | var contentType = Web.ContentTypes[Name]; 144 | var field = GetField(name, Web); 145 | var fieldLink = new SPFieldLink(field); 146 | if (contentType.FieldLinks[fieldLink.Id] == null) 147 | { 148 | contentType.FieldLinks.Add(fieldLink); 149 | } 150 | contentType.Update(true); 151 | 152 | } 153 | catch (Exception exception) 154 | { 155 | Logger.Error(string.Concat("Add Column ContentType: ", exception.Message)); 156 | return false; 157 | } 158 | return true; 159 | } 160 | 161 | /// 162 | /// Remove the Column Site in ContentType 163 | /// 164 | /// name of column 165 | /// 166 | public bool RemoveColumn(string name) 167 | { 168 | var result = true; 169 | try 170 | { 171 | 172 | var contentType = Web.ContentTypes[Name]; 173 | contentType.FieldLinks.Delete(name); 174 | contentType.Update(true); 175 | } 176 | catch (Exception exception) 177 | { 178 | Logger.Error(string.Concat("Remove Column ContentType: ", exception.Message)); 179 | result = false; 180 | } 181 | 182 | return result; 183 | } 184 | 185 | #endregion 186 | 187 | #region Methods Privates 188 | /// 189 | /// Get the field 190 | /// 191 | /// Name the Field 192 | /// 193 | /// 194 | private static SPField GetField(string name, SPWeb web) 195 | { 196 | return web.Fields.Cast().FirstOrDefault(field => field.InternalName.Equals(name)); 197 | } 198 | #endregion 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Artefacts/MasterPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Microsoft.SharePoint; 4 | 5 | namespace Enmarcha.SharePoint.Entities.Artefacts 6 | { 7 | public sealed class MasterPage 8 | { 9 | #region Properties 10 | 11 | public SPWeb Web { get; set; } 12 | public ILog Logger { get; set; } 13 | 14 | #endregion 15 | 16 | #region Constructores 17 | 18 | public MasterPage(SPWeb web,ILog logger) 19 | { 20 | Web = web; 21 | Logger = logger; 22 | } 23 | 24 | #endregion 25 | 26 | #region Interface 27 | /// 28 | /// Return the Url of the Master Page 29 | /// 30 | /// 31 | public string GetMasterPage() 32 | { 33 | return Web.Site.RootWeb.MasterUrl; 34 | } 35 | 36 | /// 37 | /// Set de MasterPage of Default 38 | /// 39 | /// 40 | /// 41 | public bool SetMasterPage(string name) 42 | { 43 | try 44 | { 45 | Web.Site.RootWeb.CustomMasterUrl = name; 46 | Web.Site.RootWeb.MasterUrl = name; 47 | Web.Update(); 48 | return true; 49 | } 50 | catch (Exception excepcion) 51 | { 52 | Logger.Error(string.Concat("Error Set MasterPage:", excepcion.Message)); 53 | return false; 54 | } 55 | } 56 | 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Artefacts/Site.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Enmarcha.SharePoint.Abstract.Enum; 3 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 4 | using Microsoft.SharePoint; 5 | 6 | namespace Enmarcha.SharePoint.Entities.Artefacts 7 | { 8 | public sealed class Site : ISite 9 | { 10 | #region Properties 11 | public SPWeb Web { get; set; } 12 | public ILog Logger { get; set; } 13 | #endregion 14 | #region Constructors 15 | public Site(SPWeb web,ILog logger) 16 | { 17 | Web = web; 18 | Logger = logger; 19 | } 20 | #endregion 21 | /// 22 | /// Add Permission in a Site 23 | /// 24 | /// 25 | /// 26 | /// 27 | public bool AddPermision(string group, RoleType role) 28 | { 29 | try 30 | { 31 | var oGroup = Web.Site.RootWeb.SiteGroups.GetByName(group); 32 | var roleAssignment = new SPRoleAssignment(oGroup); 33 | var roleDefinition = Web.RoleDefinitions.GetByType((SPRoleType) role); 34 | roleAssignment.RoleDefinitionBindings.Add(roleDefinition); 35 | if (!Web.HasUniqueRoleAssignments) 36 | { 37 | Web.BreakRoleInheritance(false); 38 | } 39 | Web.RoleAssignments.Add(roleAssignment); 40 | Web.Update(); 41 | return true; 42 | } 43 | catch (Exception exception) 44 | { 45 | Logger.Error(string.Concat("Error AddPermission :", exception.Message)); 46 | return false; 47 | } 48 | } 49 | 50 | /// 51 | /// Create Site in SharePoint 52 | /// 53 | /// 54 | /// 55 | /// 56 | /// 57 | /// 58 | /// 59 | public bool CreateSite(string web, string title, string description, string template, uint lcid) 60 | { 61 | return CreateSite(web, title, description, template, lcid, false); 62 | } 63 | 64 | /// 65 | /// Create Site in SharePoint 66 | /// 67 | /// 68 | /// 69 | /// 70 | /// 71 | /// 72 | /// 73 | /// 74 | public bool CreateSite(string web, string title, string description, string template, uint lcid, bool breakPermisions) 75 | { 76 | try 77 | { 78 | using (var result = Web.Webs.Add(web, title, description, lcid, template, false, false)) 79 | { 80 | if (!breakPermisions) 81 | { 82 | return true; 83 | } 84 | result.BreakRoleInheritance(false); 85 | result.Update(); 86 | } 87 | return true; 88 | } 89 | catch (Exception exception) 90 | { 91 | Logger.Error(string.Concat("Create Site: ", exception.Message)); 92 | return false; 93 | } 94 | } 95 | /// 96 | /// Remove Permissions a group in SharePoint 97 | /// 98 | /// 99 | /// 100 | public bool RemovePermision(string group) 101 | { 102 | try 103 | { 104 | var oGroup = Web.Site.RootWeb.SiteGroups.GetByName(group); 105 | Web.RoleAssignments.RemoveById(oGroup.ID); 106 | Web.Update(); 107 | return true; 108 | } 109 | catch (Exception exception) 110 | { 111 | Logger.Error(string.Concat("Error AddPermission :", exception.Message)); 112 | return false; 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Data/Query.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | using Enmarcha.SharePoint.Abstract.Enum; 4 | using Enmarcha.SharePoint.Abstract.Interfaces.Data; 5 | 6 | namespace Enmarcha.SharePoint.Class.Data 7 | { 8 | public sealed class Query : IQuery 9 | { 10 | public string query { get; set; } 11 | public Query() 12 | { 13 | query = string.Empty; 14 | } 15 | public IQuery Where() 16 | { 17 | query = "{0}"; 18 | return new Query 19 | { 20 | query = query 21 | }; 22 | } 23 | 24 | public IQuery Concat(IQuery operacion1, IQuery operacion2, TypeOperators typeOperator) 25 | { 26 | var value=string.Empty; 27 | switch (typeOperator) 28 | { 29 | case TypeOperators.And: 30 | value = (string.Format("{0}{1}", operacion1.Execute(), operacion2.Execute())); 31 | break; 32 | case TypeOperators.Or: 33 | default: 34 | value = (string.Format("{0}{1}", operacion1.Execute(), operacion2.Execute())); 35 | break; 36 | } 37 | query = string.IsNullOrEmpty(query) ? value : query.Replace("{0}", value); 38 | 39 | return new Query 40 | { 41 | query = query 42 | }; 43 | } 44 | 45 | public IQuery Field(string field,string extra) 46 | { 47 | query = string.IsNullOrEmpty(query) 48 | ? 49 | string.Format(@"Val", 50 | string.Concat("", field), extra) : 51 | query.Replace("{0}", 52 | string.Format(@"Val", 53 | string.Concat("", field), 54 | extra)); 55 | return new Query 56 | { 57 | query = query 58 | }; 59 | } 60 | 61 | public IQuery Value(string typeField,string value) 62 | { 63 | query = query.Replace("Val", string.Format(@"{0}", value, typeField)); 64 | return new Query 65 | { 66 | query = query 67 | }; 68 | } 69 | 70 | public IQuery Operator(TypeOperators typTypeOperators) 71 | { 72 | query = query.Replace("Op", typTypeOperators.ToString()); 73 | return new Query 74 | { 75 | query = query 76 | }; 77 | } 78 | 79 | public IQuery OrderBy(IDictionary fields) 80 | { 81 | var sb = new StringBuilder(); 82 | sb.Append(""); 83 | foreach (KeyValuePair field in fields) 84 | { 85 | sb.AppendFormat("", string.Concat("", field.Key), field.Value); 86 | } 87 | sb.Append(""); 88 | query += (sb.ToString()); 89 | return new Query 90 | { 91 | query = query 92 | }; 93 | } 94 | 95 | public IQuery GroupBy(IDictionary fields) 96 | { 97 | var sb = new StringBuilder(); 98 | sb.Append(""); 99 | foreach (var field in fields) 100 | { 101 | sb.AppendFormat("", string.Concat("", field.Key)); 102 | } 103 | sb.Append(""); 104 | query += (sb.ToString()); 105 | return new Query 106 | { 107 | query = query 108 | }; 109 | } 110 | 111 | public IQuery ViewFields(IDictionary fields) 112 | { 113 | var sb = new StringBuilder(); 114 | sb.Append(""); 115 | foreach (var field in fields) 116 | { 117 | sb.AppendFormat("", string.Concat("", field.Key)); 118 | } 119 | sb.Append(""); 120 | query += (sb.ToString()); 121 | return new Query 122 | { 123 | query = query 124 | }; 125 | } 126 | 127 | public string Execute() 128 | { 129 | return query; 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Logs/ApplicationDirectory.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Class.Logs 2 | { 3 | internal static class ApplicationDirectory 4 | { 5 | public static class Logging 6 | { 7 | public const string DiagnosticAreaName = "ENMARCHA_ULS"; 8 | // Category names 9 | public const string LogDebug = "[DEBUG]"; 10 | public const string LogInfo = "[INFO]"; 11 | public const string LogWarn = "[WARN]"; 12 | public const string LogError = "[ERROR]"; 13 | 14 | public const string Disabled = "off"; 15 | 16 | public const string DefaultLevelFileLog = "debug"; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Entities/Logs/LogManager.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Interfaces; 2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | 4 | namespace Enmarcha.SharePoint.Class.Logs 5 | { 6 | public class LogManager 7 | { 8 | #region Properties 9 | 10 | #region Private Static 11 | 12 | private LoggingService _loggingService; 13 | 14 | #endregion 15 | 16 | #endregion 17 | 18 | public ILog GetLogger(System.Diagnostics.StackFrame currentStackFrame) 19 | { 20 | _loggingService = new LoggingService(currentStackFrame); 21 | return _loggingService; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Extensors/ContentType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 4 | using Enmarcha.SharePoint.Class.Logs; 5 | using Enmarcha.SharePoint.Helpers; 6 | using Enmarcha.SharePoint.Helpers.Extensors; 7 | using Microsoft.SharePoint; 8 | 9 | namespace Enmarcha.SharePoint.Extensors 10 | { 11 | public static class ContentType 12 | { 13 | private static readonly ILog Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 14 | /// 15 | /// Create Content Type and add a List of Site Column 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | public static bool CreateContentType(this SPWeb web, string name, string groupName, string parent, IList columnSite) 24 | { 25 | return CreateContentType(web, name, groupName, parent, columnSite, string.Empty); 26 | } 27 | /// 28 | /// Create a content 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | /// 37 | public static bool CreateContentType(this SPWeb web, string name, string groupName, string parent, IList columnSite, 38 | string guidContentType) 39 | { 40 | try 41 | { 42 | var result = false; 43 | var contentType = new Entities.Artefacts.ContentType(web, Logger, name, groupName, parent); 44 | contentType.Create(guidContentType); 45 | foreach (var item in columnSite) 46 | { 47 | result = 48 | contentType.AddColumn( (!item.Prefix)?item.Name:string.Concat(Constants.Prefix, item.Name)); 49 | 50 | } 51 | 52 | return result; 53 | } 54 | catch (Exception exception) 55 | { 56 | Logger.Error(string.Concat("Error CreateContentType", exception.Message)); 57 | return false; 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Extensors/Language.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 5 | using Enmarcha.SharePoint.Class.Logs; 6 | using Microsoft.SharePoint; 7 | 8 | namespace Enmarcha.SharePoint.Extensors 9 | { 10 | public static class Language 11 | { 12 | private static readonly ILog Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 13 | /// 14 | /// Languaje function to activate some of which we have installed 15 | /// 16 | /// Sitio Web donde lo queremos desplegar 17 | /// LCID of language we want to activate 18 | /// 19 | public static bool EnableSiteCollectionLanguage(this SPWeb web, int lcidLanguage) 20 | { 21 | var result = true; 22 | try 23 | { 24 | if (web.Site.GetWebTemplates(web.Language)[web.WebTemplate].SupportsMultilingualUI) 25 | { 26 | web.IsMultilingual = true; 27 | 28 | var installed = SPLanguageSettings.GetGlobalInstalledLanguages(15); 29 | var supported = web.SupportedUICultures; 30 | foreach (SPLanguage language in installed) 31 | { 32 | var culture = new CultureInfo(language.LCID); 33 | if (!supported.Contains(culture) && language.LCID == lcidLanguage) 34 | { 35 | web.AddSupportedUICulture(culture); 36 | } 37 | } 38 | web.Update(); 39 | } 40 | 41 | } 42 | catch (Exception exception) 43 | { 44 | 45 | Logger.Error("Error EnableSiteCollectionLanguage", exception.Message); 46 | result = false; 47 | } 48 | return result; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Extensors/RolesManagment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 5 | using Enmarcha.SharePoint.Class.Logs; 6 | using Enmarcha.SharePoint.Helpers.Data; 7 | using Microsoft.SharePoint; 8 | 9 | namespace Enmarcha.SharePoint.Extensors 10 | { 11 | public static class RolesManagment 12 | { 13 | private static readonly ILog Logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); 14 | /// 15 | /// Create SharePoint grou 16 | /// 17 | /// 18 | /// SharePoint group name 19 | /// Type of Permission 20 | /// 21 | public static bool CreateGroup(this SPWeb web, string groupName, SPRoleType permissionLevel) 22 | { 23 | try 24 | { 25 | var owner = web.SiteAdministrators[0]; 26 | var member = web.SiteAdministrators[0]; 27 | var groups = web.SiteGroups; 28 | groups.Add(groupName, member, owner, string.Empty); 29 | var newSPGroup = groups[groupName]; 30 | var role = web.RoleDefinitions.GetByType(permissionLevel); 31 | var roleAssignment = new SPRoleAssignment(newSPGroup); 32 | roleAssignment.RoleDefinitionBindings.Add(role); 33 | web.RoleAssignments.Add(roleAssignment); 34 | web.Update(); 35 | return true; 36 | } 37 | catch (Exception exception) 38 | { 39 | Logger.Error(string.Concat("Error Create ", exception.Message)); 40 | return false; 41 | } 42 | } 43 | 44 | /// 45 | /// Add user of group 46 | /// 47 | /// 48 | /// SharePoint group name 49 | /// 50 | /// 51 | public static bool AddUserGroup(this SPWeb web, string groupName, UserSP user) 52 | { 53 | try 54 | { 55 | var groups = web.SiteGroups; 56 | var groupSP = groups[groupName]; 57 | groupSP.AddUser(web.EnsureUser(user.Value)); 58 | return true; 59 | } 60 | catch (Exception exception) 61 | { 62 | Logger.Error(string.Concat("Error AddUserGroup ", exception.Message)); 63 | return false; 64 | } 65 | } 66 | /// 67 | /// Remove User of Group 68 | /// 69 | /// 70 | /// 71 | /// 72 | /// 73 | public static bool RemoveUserGroup(this SPWeb web, string groupName, UserSP user) 74 | { 75 | try 76 | { 77 | var groups = web.SiteGroups; 78 | var groupSP = groups[groupName]; 79 | groupSP.RemoveUser(web.EnsureUser(user.Value)); 80 | return true; 81 | } 82 | catch (Exception exception) 83 | { 84 | Logger.Error(string.Concat("Error RemoveUserGroup:", exception.Message)); 85 | return false; 86 | } 87 | } 88 | 89 | /// 90 | /// Return de user exist in group 91 | /// 92 | /// 93 | /// 94 | /// 95 | public static IList GetUserInGroup(this SPWeb web, string groupName) 96 | { 97 | try 98 | { 99 | IList resultUser = null; 100 | var groups = web.SiteGroups; 101 | var groupSP = groups[groupName]; 102 | var collecctionUser = groupSP.Users; 103 | if (collecctionUser.Count > 0) 104 | { 105 | resultUser = new List(); 106 | } 107 | foreach (SPUser user in collecctionUser) 108 | { 109 | resultUser.Add(new UserSP 110 | { 111 | Key = user.ID.ToString(), 112 | LoginName = user.LoginName, 113 | Value = user.Name 114 | }); 115 | } 116 | 117 | return resultUser; 118 | } 119 | catch (Exception exception) 120 | { 121 | Logger.Error(string.Concat("Error GetUserInGroup:", exception.Message)); 122 | return null; 123 | } 124 | } 125 | /// 126 | /// Get Groups by User 127 | /// 128 | /// 129 | /// 130 | /// 131 | public static ICollection GetGroupByUser(this SPSite site, string userId) 132 | { 133 | var result = new List(); 134 | var spWeb = site.RootWeb; 135 | var groupCollection = spWeb.EnsureUser(userId).Groups; 136 | result.AddRange(from SPGroup @group in groupCollection 137 | select new UserSP 138 | { 139 | Key = @group.ID.ToString(), 140 | LoginName = @group.LoginName, 141 | Value = @group.Name 142 | }); 143 | return result.Any() ? result : null; 144 | } 145 | /// 146 | /// Get the User's Groups 147 | /// 148 | /// 149 | public static IList GetGroupsUser(this SPWeb web) 150 | { 151 | IList groupCollection = new List(); 152 | 153 | foreach (SPGroup group in web.SiteGroups) 154 | { 155 | if (group.ContainsCurrentUser) 156 | { 157 | groupCollection.Add(group); 158 | } 159 | } 160 | return groupCollection; 161 | } 162 | 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers 2 | { 3 | public static class Constants 4 | { 5 | public static readonly string Prefix = "ENMARCHA"; 6 | 7 | public static class FieldTypeColumns 8 | { 9 | public const string Boolean = "Boolean"; 10 | public const string Choice = "Choice"; 11 | public const string MultiChoice = "MultiChoice"; 12 | public const string DateTime = "DateTime"; 13 | public const string Lookup = "Lookup"; 14 | public const string User = "User"; 15 | public const string Note = "Note"; 16 | public const string Number = "Number"; 17 | public const string Currency = "Currency"; 18 | public const string Url = "Url"; 19 | public const string Calculated = "Calculated"; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/Currency.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public sealed class Currency 4 | { 5 | public double Value { get; set; } 6 | public int Format { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/FieldBase.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public class FieldBase 4 | { 5 | public string Key { get; set; } 6 | public string Value { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/LookupFieldEnc.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public sealed class LookupFieldEnc : FieldBase 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/Taxonomy.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public sealed class Taxonomy:FieldBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/UrlField.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public sealed class UrlField 4 | { 5 | public string Url { get; set; } 6 | public string Description { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Data/UserSP.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Data 2 | { 3 | public sealed class UserSP: FieldBase 4 | { 5 | 6 | public string LoginName { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Extensors/ConfigurationColumn.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Extensors 2 | { 3 | public sealed class ConfigurationColumn 4 | { 5 | public string Name { get; set; } 6 | public bool Prefix { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Extensors/CustomProperty.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.SharePoint.Helpers.Extensors 2 | { 3 | public sealed class CustomProperty 4 | { 5 | public string Name { get; set; } 6 | public string Value { get; set; } 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Extensors/ParamsColumnSite.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Specialized; 2 | using Enmarcha.SharePoint.Entities.Artefacts; 3 | 4 | namespace Enmarcha.SharePoint.Helpers.Extensors 5 | { 6 | public class ParamsColumnSite 7 | { 8 | public ListSharePoint List { get; set; } 9 | public string Name { get; set; } 10 | public string DisplayName { get; set; } 11 | public string FieldType { get; set; } 12 | public bool Requiered { get; set; } 13 | public string DefaultValue { get; set; } 14 | public StringCollection Choice { get; set; } 15 | public string Group { get; set; } 16 | public bool MultiValue { get; set; } 17 | public bool AddPrefix { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Extensors/ParamsCreateSite.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Specialized; 2 | using Enmarcha.SharePoint.Abstract.Enum; 3 | using Microsoft.SharePoint; 4 | 5 | namespace Enmarcha.SharePoint.Helpers.Extensors 6 | { 7 | public sealed class ParamsCreateSite 8 | { 9 | public SPWeb Web { get; set; } 10 | public string Name { get; set; } 11 | public string FieldType { get; set; } 12 | public bool Requiered { get; set; } 13 | public string DefaultValue { get; set; } 14 | public StringCollection Choice { get; set; } 15 | public string Group { get; set; } 16 | public string Term { get; set; } 17 | public bool MultiValue { get; set; } 18 | public string DisplayName { get; set; } 19 | public bool Hidden { get; set; } 20 | public string GroupTerm { get; set; } 21 | public bool AddPrefix { get; set; } 22 | public string Formula { get; set; } 23 | public int FormatCurrency { get; set; } 24 | public TypeDate Date { get; set; } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/SiteColumn/ParamsSiteColumnBase.cs: -------------------------------------------------------------------------------- 1 |  2 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 3 | using Microsoft.SharePoint; 4 | 5 | namespace Enmarcha.SharePoint.Helpers.SiteColumn 6 | { 7 | public class ParamsSiteColumnBase 8 | { 9 | 10 | public SPWeb Web { get; set; } 11 | public bool AddPrefix { get; set; } 12 | public string Name { get; set; } 13 | public string DisplayName { get; set; } 14 | public ILog Logger { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/SiteColumn/ParamsSiteColumnBaseExtended.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SharePoint; 2 | 3 | namespace Enmarcha.SharePoint.Helpers.SiteColumn 4 | { 5 | public class ParamsSiteColumnBaseExtended:ParamsSiteColumnBase 6 | { 7 | public SPFieldType FieldType { get; set; } 8 | public bool Requiered { get; set; } 9 | public string Group { get; set; } 10 | public bool MultiValue { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/SiteColumn/ParamsSiteColumnChoices.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Specialized; 2 | 3 | namespace Enmarcha.SharePoint.Helpers.SiteColumn 4 | { 5 | public sealed class ParamsSiteColumnChoices:ParamsSiteColumnBaseExtended 6 | { 7 | public StringCollection Choices { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/SiteColumn/ParamsSiteColumnDefaultValue.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Enmarcha.SharePoint.Helpers.SiteColumn 3 | { 4 | public sealed class ParamsSiteColumnDefaultValue:ParamsSiteColumnBaseExtended 5 | { 6 | public string DefaultValue { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Helpers/Taxonomy/TaxonomyNavigationValue.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SharePoint.Publishing.Navigation; 2 | 3 | namespace Enmarcha.SharePoint.Helpers.Taxonomy 4 | { 5 | public sealed class TaxonomyNavigationValue 6 | { 7 | public string Name { get; set; } 8 | public NavigationLinkType TypeLink { get; set; } 9 | public string Link { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.SharePoint")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.SharePoint")] 13 | [assembly: AssemblyCopyright("ENCAMINA © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("45abbf76-3804-48b3-a69b-a61dae45260d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Enmarcha.SharePoint/lib/Microsoft.SharePoint.Publishing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Enmarcha.SharePoint/lib/Microsoft.SharePoint.Publishing.dll -------------------------------------------------------------------------------- /Enmarcha.SharePoint/lib/Microsoft.SharePoint.Taxonomy.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Enmarcha.SharePoint/lib/Microsoft.SharePoint.Taxonomy.dll -------------------------------------------------------------------------------- /Enmarcha.SharePoint/lib/Microsoft.SharePoint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Enmarcha.SharePoint/lib/Microsoft.SharePoint.dll -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 ENCAMINA S.L. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![NuGet version](https://badge.fury.io/nu/Enmarcha.SharePoint.svg)](https://badge.fury.io/nu/Enmarcha.SharePoint) 2 | # ENMARCHA SharePoint - Open Source 3 | 4 | ENMARCHA es el framework de desarrollo que usamos en ENCAMINA para acelerar la construcción de soluciones Microsoft. 5 | 6 | ![alt text](https://encaminastorage.blob.core.windows.net/images/enmarcha-270.png "Logo Enmarcha") 7 | 8 | El repositorio ['ENMARCHA SharePoint'](https://github.com/encamina/enmarcha-sharepoint) es donde desarrollamos la implementación de SharePoint OnPremises, ofreciendo una capa de abstracción a la API de servidor que ofrece Microsoft SharePoint. 9 | 10 | ## Colaboraciones 11 | Puedes participar en el proyecto con: 12 | 13 | * [Enviando bugs y solicitando nuevas funcionalidades](https://github.com/encamina/enmarcha-sharepoint/issues) and help us verify as they are checked in 14 | * Revisar [cambios en el código fuente](https://github.com/encamina/enmarcha-sharepoint/pulls) 15 | 16 | ## Requisitos 17 | * SharePoint Server 2013 18 | * .NET Framework 4.5 19 | * Visual Studio 2013 20 | 21 | ## Ejemplos de uso 22 | Para aprender a usar ENMARCHA, os hemos creado los siguientes [ejemplos](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples): 23 | 24 | * [Enmarcha.Samples.ManageData](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.ManageData) - Trabajar con datos (listas y bibliotecas de documentos en SharePoint) 25 | * [Enmarcha.Samples.PermissionList](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.PermissionList) - Gestionar los permisos a grupos de SharePoint dentro de una lista 26 | * [Enmarcha.Samples.Provisioning](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.Provisioning) - Provisionar artefactos de SharePoint 27 | * [Enmarcha.Samples.SitesProvisioning](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.SiteProvisioning) - Provisionaremos Sitios y Subsitios dentro de ShareProint 28 | 29 | ## Licencia 30 | [MIT](LICENSE.txt) 31 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/Enmarcha.ImageGalery.Model.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2E857DFC-765D-46A7-B901-D1C851D83C5F} 8 | Library 9 | Properties 10 | Enmarcha.ImageGalery.Model 11 | Enmarcha.ImageGalery.Model 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | true 34 | 35 | 36 | ModelWebPart.snk 37 | 38 | 39 | 40 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 41 | True 42 | 43 | 44 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 45 | True 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/ImageGallery.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | using Enmarcha.SharePoint.Attribute; 3 | using Enmarcha.SharePoint.Helpers.Data; 4 | 5 | namespace Enmarcha.ImageGalery.Model 6 | { 7 | public class ImageGallery 8 | { 9 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 10 | public string ID { get; set; } 11 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 12 | public string Title { get; set; } 13 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Boolean, DisplayName = "Visible in ImageGallery")] 14 | public bool Visible { get; set; } 15 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Boolean, DisplayName = "Open Link in new Page")] 16 | public bool OpenWindows { get; set; } 17 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Url, DisplayName = "Url of image")] 18 | public UrlField Image { get; set; } 19 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Url, DisplayName = "Url of new")] 20 | public UrlField UrlNew { get; set; } 21 | 22 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Descripcion")] 23 | public string Description { get; set; } 24 | 25 | public string NewUrl 26 | { 27 | get { return UrlNew.Url; } 28 | } 29 | 30 | public string PictureUrl 31 | { 32 | get { return Image.Url; } 33 | } 34 | 35 | public string TargetBlank 36 | { 37 | get { return (OpenWindows == true) ? " target='_blank'" : string.Empty; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/ModelWebPart.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/ModelWebPart.snk -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.ImageGalery.Model")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.ImageGalery.Model")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e6e4582a-7221-4ad2-ae6b-8b3c144e6ab0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Model/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Features/Main/Main.Template.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Features/Main/Main.feature: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Helper/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace Enmarcha.ImageGalery.SP.Helper 2 | { 3 | public static class Constants 4 | { 5 | public static class List 6 | { 7 | public const string ImageGallery = "Image Galery"; 8 | } 9 | 10 | public static class ContentType 11 | { 12 | public const string ImageGallery = "Image Galery"; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/css/liquidcarousel.css: -------------------------------------------------------------------------------- 1 | .liquid { 2 | background:#313b31 url('../images/bodybackground.png') repeat-y scroll 50% 0; 3 | border:2px solid #19301C; 4 | -moz-border-radius:10px 10px 10px 10px; 5 | -webkit-border-radius:10px 10px 10px 10px; 6 | border-radius:10px 10px 10px 10px; 7 | padding:10px 0; 8 | } 9 | .liquid .previous { 10 | display:block; 11 | height:126px; 12 | width:64px; 13 | background-image:url('../images/previous.png'); 14 | float:left; 15 | margin:0; 16 | padding:0; 17 | } 18 | .liquid .next { 19 | display:block; 20 | height:126px; 21 | width:64px; 22 | background-image:url('../images/next.png'); 23 | float:right; 24 | margin:0; 25 | padding:0; 26 | } 27 | .liquid ul li { 28 | width:126px; 29 | padding:0 2px; 30 | margin:0; 31 | } 32 | .liquid ul li a img { 33 | -moz-box-shadow: 5px 5px 3px #222; 34 | -webkit-box-shadow: 5px 5px 3px #222; 35 | box-shadow: 5px 5px 3px #222; 36 | } 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/01.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/02.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/03.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/04.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/05.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/06.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/07.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/08.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/09.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/10.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/11.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/12.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/13.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/14.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/15.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/16.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/bodybackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/bodybackground.png -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/download.png -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/next.png -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/previous.png -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/text.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/images/text.jpg -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/js/imagegallery/init.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('.liquid').liquidcarousel({ height: 160 }); 3 | }); -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Module/StyleLibrary/js/jquery.liquidcarousel.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery liquid carousel v1.0 3 | * http://www.nikolakis.net 4 | * 5 | * Copyright 2010, John Nikolakis 6 | * Free to use under the GPL license. 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | (function($){$.fn.liquidcarousel=function(options){var defaults={height:150,duration:100,hidearrows:true};var options=$.extend(defaults,options);return this.each(function(){var divobj=$(this);$(divobj).height(options.height);$(divobj).css('overflow','hidden');$('> .wrapper',divobj).height(options.height);$('> .wrapper',divobj).css('overflow','hidden');$('> .wrapper',divobj).css('float','left');$('> .wrapper > ul',divobj).height(options.height);$('> .wrapper > ul',divobj).css('float','left');$('> .wrapper > ul',divobj).css('margin','0');$('> .wrapper > ul',divobj).css('padding','0');$('> .wrapper > ul',divobj).css('display','block');$('> .wrapper > ul > li',divobj).height(options.height);$('> .wrapper > ul > li',divobj).css('display','block');$('> .wrapper > ul > li',divobj).css('float','left');var originalmarginright=parseInt($('> .wrapper > ul > li',divobj).css('marginRight'));var originalmarginleft=parseInt($('> .wrapper > ul > li',divobj).css('marginLeft'));var visiblelis=0;var totallis=$('> .wrapper > ul > li',this).length;var currentposition=0;var liwidth=$('> .wrapper > ul > li:first',divobj).outerWidth(true);var additionalmargin=0;var totalwidth=liwidth+additionalmargin;$(window).resize(function(e){var divwidth=$(divobj).width();var availablewidth=(divwidth-$('> .previous',divobj).outerWidth(true)-$('> .next',divobj).outerWidth(true));previousvisiblelis=visiblelis;visiblelis=Math.floor((availablewidth/liwidth));if(visiblelis .wrapper > ul > li',divobj).css('marginRight',originalmarginright+halfadditionalmargin);$('> .wrapper > ul > li',divobj).css('marginLeft',originalmarginleft+halfadditionalmargin);if(visiblelis>previousvisiblelis||totallis<=visiblelis){currentposition-=(visiblelis-previousvisiblelis);if(currentposition<0||totallis<=visiblelis){currentposition=0;}} 12 | $('> .wrapper > ul',divobj).css('marginLeft',-(currentposition*totalwidth));if(visiblelis>=totallis||((divwidth>=(totallis*liwidth))&&options.hidearrows)){if(options.hidearrows){$('> .previous',divobj).hide();$('> .next',divobj).hide();additionalmargin=Math.floor((divwidth-(totallis*liwidth))/totallis);halfadditionalmargin=Math.floor(additionalmargin/2);totalwidth=liwidth+additionalmargin;$('> .wrapper > ul > li',divobj).css('marginRight',originalmarginright+halfadditionalmargin);$('> .wrapper > ul > li',divobj).css('marginLeft',originalmarginleft+halfadditionalmargin);} 13 | $('> .wrapper',divobj).width(totallis*totalwidth);$('> ul',divobj).width(totallis*totalwidth);$('> .wrapper',divobj).css('marginLeft',0);currentposition=0;}else{$('> .previous',divobj).show();$('> .next',divobj).show();$('> .wrapper',divobj).width(visiblelis*totalwidth);$('> ul',divobj).width(visiblelis*totalwidth);}});$('> .next',divobj).click(function(){if(totallis<=visiblelis){currentposition=0;}else if((currentposition+(visiblelis*2))=totallis-1){currentposition=totallis-visiblelis;} 14 | $('> .wrapper > ul',divobj).stop();$('> .wrapper > ul',divobj).animate({'marginLeft':-(currentposition*totalwidth)},options.duration);});$('> .previous',divobj).click(function(){if((currentposition-visiblelis)>0){currentposition-=visiblelis;}else if((currentposition-(visiblelis*2))<=0){currentposition=0;} 15 | $('> .wrapper > ul',divobj).stop();$('> .wrapper > ul',divobj).animate({'marginLeft':-(currentposition*totalwidth)},options.duration);});$('> .next',divobj).dblclick(function(e){e.preventDefault();clearSelection();});$('> .previous',divobj).dblclick(function(e){e.preventDefault();clearSelection();});function clearSelection(){if(document.selection&&document.selection.empty){document.selection.empty();}else if(window.getSelection){var sel=window.getSelection();sel.removeAllRanges();}} 16 | $(window).resize();});};})(jQuery); -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Package/Package.Template.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Package/Package.package: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Security; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Enmarcha.ImageGalery.SP")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Enmarcha.ImageGalery.SP")] 14 | [assembly: AssemblyCopyright("Copyright © 2016")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("4bedc7cc-fec4-4e0d-b40f-4a76518edd3c")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.0.0.0")] 37 | [assembly: AssemblyFileVersion("1.0.0.0")] 38 | 39 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/Elements.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/ImageGalleryWebPart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Web; 4 | using System.Web.UI; 5 | using System.Web.UI.WebControls; 6 | using System.Web.UI.WebControls.WebParts; 7 | using Microsoft.SharePoint; 8 | using Microsoft.SharePoint.WebControls; 9 | 10 | namespace Enmarcha.ImageGalery.SP.WebPart.ImageGalleryWebPart 11 | { 12 | [ToolboxItemAttribute(false)] 13 | public class ImageGalleryWebPart : System.Web.UI.WebControls.WebParts.WebPart 14 | { 15 | // Visual Studio might automatically update this path when you change the Visual Web Part project item. 16 | private const string _ascxPath = @"~/_CONTROLTEMPLATES/15/Enmarcha.ImageGalery.SP.WebPart/ImageGalleryWebPart/ImageGalleryWebPartUserControl.ascx"; 17 | 18 | protected override void CreateChildControls() 19 | { 20 | Control control = Page.LoadControl(_ascxPath); 21 | Controls.Add(control); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/ImageGalleryWebPart.webpart: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $Resources:core,ImportErrorMessage; 7 | 8 | 9 | 10 | ImageGalleryWebPart 11 | WebPart que muestra un carrusel de imagenes 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/ImageGalleryWebPartUserControl.ascx: -------------------------------------------------------------------------------- 1 | <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> 2 | <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 3 | <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 4 | <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 5 | <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> 6 | <%@ Import Namespace="Microsoft.SharePoint" %> 7 | <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 8 | <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ImageGalleryWebPartUserControl.ascx.cs" Inherits="Enmarcha.ImageGalery.SP.WebPart.ImageGalleryWebPart.ImageGalleryWebPartUserControl" %> 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 29 |
30 | 31 |
-------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/ImageGalleryWebPartUserControl.ascx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Web.UI; 4 | using System.Web.UI.WebControls; 5 | using System.Web.UI.WebControls.WebParts; 6 | using Enmarcha.ImageGalery.Service.Entities; 7 | using Enmarcha.ImageGalery.SP.Helper; 8 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 9 | using Enmarcha.SharePoint.Class.Logs; 10 | using Microsoft.SharePoint; 11 | 12 | namespace Enmarcha.ImageGalery.SP.WebPart.ImageGalleryWebPart 13 | { 14 | public partial class ImageGalleryWebPartUserControl : UserControl 15 | { 16 | public ILog Logger= new LogManager().GetLogger(new StackTrace().GetFrame(0)); 17 | protected void Page_Load(object sender, EventArgs e) 18 | { 19 | if (!Page.IsPostBack) 20 | { 21 | LoadData(); 22 | } 23 | } 24 | 25 | private void LoadData() 26 | { 27 | try 28 | { 29 | var listSharePoint = SPContext.Current.Web.Lists.TryGetList(Constants.List.ImageGallery); 30 | var imageGaleryService = new ImageGaleryService(listSharePoint, 5); 31 | var imageGaleryCollection = imageGaleryService.GetNews(); 32 | listViewImageGalery.DataSource = imageGaleryCollection; 33 | listViewImageGalery.DataBind(); 34 | } 35 | catch (Exception exception) 36 | { 37 | Logger.Error(string.Concat("Error Concat LoadData",exception.Message)); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/ImageGalleryWebPartUserControl.ascx.designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace Enmarcha.ImageGalery.SP.WebPart.ImageGalleryWebPart { 11 | 12 | 13 | public partial class ImageGalleryWebPartUserControl { 14 | 15 | /// 16 | /// listViewImageGalery control. 17 | /// 18 | /// 19 | /// Auto-generated field. 20 | /// To modify move field declaration from designer file to code-behind file. 21 | /// 22 | protected global::System.Web.UI.WebControls.ListView listViewImageGalery; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/WebPart/ImageGalleryWebPart/SharePointProjectItem.spdata: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/key.snk -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.SP/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/Enmarcha.ImageGalery.Service.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E7A4BE31-3EAA-4C94-BB56-AF666356A1C1} 8 | Library 9 | Properties 10 | Enmarcha.ImageGalery.Service 11 | Enmarcha.ImageGalery.Service 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | true 34 | 35 | 36 | ServiceWebPart.snk 37 | 38 | 39 | 40 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 41 | True 42 | 43 | 44 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 45 | True 46 | 47 | 48 | False 49 | ..\..\..\..\..\..\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | {2e857dfc-765d-46a7-b901-d1c851d83c5f} 71 | Enmarcha.ImageGalery.Model 72 | 73 | 74 | 75 | 82 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/Entities/ImageGaleryService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using Enmarcha.ImageGalery.Model; 6 | using Enmarcha.ImageGalery.Service.Interface; 7 | using Enmarcha.SharePoint.Abstract.Interfaces.Artefacts; 8 | using Enmarcha.SharePoint.Class.Data; 9 | using Enmarcha.SharePoint.Class.Logs; 10 | using Microsoft.SharePoint; 11 | 12 | namespace Enmarcha.ImageGalery.Service.Entities 13 | { 14 | public class ImageGaleryService:IImageGaleryService 15 | { 16 | public SPList List { get; set; } 17 | public ILog Logger { get; set; } 18 | public int Items { get; set; } 19 | public ImageGaleryService(SPList list,int items) 20 | { 21 | this.List = list; 22 | this.Items = items; 23 | this.Logger = new LogManager().GetLogger(new StackTrace().GetFrame(0)); 24 | } 25 | public IList GetNews() 26 | { 27 | try 28 | { 29 | var repositorySharePoint = new SharePointRepository(this.List.ParentWeb, this.Logger, 30 | this.List.Title, this.Items); 31 | var imageCollection = repositorySharePoint.GetAll(); 32 | return imageCollection.ToList(); 33 | } 34 | catch (Exception exception) 35 | { 36 | this.Logger.Error(string.Concat("Error GetNews",exception.Message)); 37 | return null; 38 | } 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/Interface/IImageGaleryService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Enmarcha.ImageGalery.Model; 3 | 4 | namespace Enmarcha.ImageGalery.Service.Interface 5 | { 6 | public interface IImageGaleryService 7 | { 8 | IList GetNews(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.ImageGalery.Service")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.ImageGalery.Service")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3cb8596a-4da8-47a6-8061-ce6377e334d7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/ServiceWebPart.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Encamina/Enmarcha-SharePoint/356df0661c74b1d21b2bc716b09f0158d119486f/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/ServiceWebPart.snk -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Test/Enmarcha.ImageGalery.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {D445422D-0CA0-40C2-A8E4-F75B88DCA7F6} 7 | Library 8 | Properties 9 | Enmarcha.ImageGalery.Test 10 | Enmarcha.ImageGalery.Test 11 | v4.5 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 40 | True 41 | 42 | 43 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 44 | True 45 | 46 | 47 | False 48 | ..\..\..\..\..\..\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll 49 | 50 | 51 | 52 | ..\..\..\..\..\..\Program Files (x86)\Telerik\JustMock\Libraries\Telerik.JustMock.dll 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | {2e857dfc-765d-46a7-b901-d1c851d83c5f} 77 | Enmarcha.ImageGalery.Model 78 | 79 | 80 | {e7a4be31-3eaa-4c94-bb56-af666356a1c1} 81 | Enmarcha.ImageGalery.Service 82 | 83 | 84 | 85 | 86 | 87 | 88 | False 89 | 90 | 91 | False 92 | 93 | 94 | False 95 | 96 | 97 | False 98 | 99 | 100 | 101 | 102 | 103 | 104 | 111 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.ImageGalery.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.ImageGalery.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d6e6bac8-0afa-4c51-b8a6-7b941a0d2641")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Test/UTImageGalleryService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Enmarcha.ImageGalery.Model; 5 | using Enmarcha.ImageGalery.Service.Entities; 6 | using Enmarcha.SharePoint.Helpers.Data; 7 | using Microsoft.SharePoint; 8 | using Microsoft.VisualStudio.TestTools.UnitTesting; 9 | using Telerik.JustMock; 10 | 11 | namespace Enmarcha.ImageGalery.Test 12 | { 13 | [TestClass] 14 | public class UTImageGalleryService 15 | { 16 | [TestMethod] 17 | public void GetNews() 18 | { 19 | var fakeSiteUrl = "http://www.telerik.com"; 20 | var fakeSharepointSite = Mock.Create(); 21 | var fakeSharePointList = Mock.Create(); 22 | 23 | Mock.Arrange(() => SPContext.Current.Site).Returns(fakeSharepointSite); 24 | Mock.Arrange(() => fakeSharepointSite.RootWeb.Lists.TryGetList("demo")).Returns(fakeSharePointList); 25 | 26 | var service = new ImageGaleryService(fakeSharePointList, 10); 27 | Mock.Arrange(() => service.GetNews()).Returns(new List 28 | { new ImageGallery 29 | { 30 | Title = "Imagen", 31 | Description = "Image", 32 | UrlNew = new UrlField {Description = string.Empty,Url = "http://google.es"}, 33 | Image = new UrlField {Description = string.Empty,Url = "http://google.es"}, 34 | Visible = true, 35 | ID = "1", 36 | OpenWindows = true 37 | } }); 38 | 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.ImageGalery.SP", "Enmarcha.ImageGalery.SP\Enmarcha.ImageGalery.SP.csproj", "{4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.ImageGalery.Model", "Enmarcha.ImageGalery.Model\Enmarcha.ImageGalery.Model.csproj", "{2E857DFC-765D-46A7-B901-D1C851D83C5F}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.ImageGalery.Service", "Enmarcha.ImageGalery.Service\Enmarcha.ImageGalery.Service.csproj", "{E7A4BE31-3EAA-4C94-BB56-AF666356A1C1}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.ImageGalery.Test", "Enmarcha.ImageGalery.Test\Enmarcha.ImageGalery.Test.csproj", "{D445422D-0CA0-40C2-A8E4-F75B88DCA7F6}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 23 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Release|Any CPU.Build.0 = Release|Any CPU 25 | {4BEDC7CC-FEC4-4E0D-B40F-4A76518EDD3C}.Release|Any CPU.Deploy.0 = Release|Any CPU 26 | {2E857DFC-765D-46A7-B901-D1C851D83C5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2E857DFC-765D-46A7-B901-D1C851D83C5F}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2E857DFC-765D-46A7-B901-D1C851D83C5F}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2E857DFC-765D-46A7-B901-D1C851D83C5F}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {E7A4BE31-3EAA-4C94-BB56-AF666356A1C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {E7A4BE31-3EAA-4C94-BB56-AF666356A1C1}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {E7A4BE31-3EAA-4C94-BB56-AF666356A1C1}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {E7A4BE31-3EAA-4C94-BB56-AF666356A1C1}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {D445422D-0CA0-40C2-A8E4-F75B88DCA7F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {D445422D-0CA0-40C2-A8E4-F75B88DCA7F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {D445422D-0CA0-40C2-A8E4-F75B88DCA7F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {D445422D-0CA0-40C2-A8E4-F75B88DCA7F6}.Release|Any CPU.Build.0 = Release|Any CPU 38 | EndGlobalSection 39 | GlobalSection(SolutionProperties) = preSolution 40 | HideSolutionNode = FALSE 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ImageGalleryWebPart/README.md: -------------------------------------------------------------------------------- 1 | # WebPart Galeria de Imagenes # 2 | 3 | ### Resumen ### 4 | Este ejemplo muestra crear un WebPart Visual realizando consultas sobre listas de SharePoint. Y como aprovisionar los artefactos necesarios para el correcto funcionamiento del WebPart. 5 | 6 | ### Funciona con ### 7 | - SharePoint 2013 on-premises 8 | 9 | ### Prerequisitos ### 10 | Visual Studio 2013 o superior 11 | 12 | ### Solucion ### 13 | Solución | Autor(s) 14 | ---------|---------- 15 | Enmarcha.ImageGalery | [Adrian Diaz Cervera](https://github.com/AdrianDiaz81) (**ENCAMINA**) 16 | 17 | ### Version history ### 18 | Version | Fecha | Comentarios 19 | ---------| -----| -------- 20 | 1.0 | Febrero 01 2016 | Initial release 21 | 22 | ### Disclaimer ### 23 | **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** 24 | 25 | ---------- 26 | 27 | ## ESCENARIO ## 28 | En este escenario vamos a crear un WebPart Visual. En primer lugar nos crearemos una Feature en la que aprovisonaremos los artefactos que nos hace falta para el correcto funcionaiento del WebPart. En segundo lugar, utilizaremos una arquitectura de N-Capas para separar la lógica de la aplicación de la interfaz de usuario. Y para finalizar, realizaremos test unitarios utilizando la herramienta [JustMock de Telerik](http://www.telerik.com/products/mocking.aspx). (para poder ejecutarlo es necesario tener licencia sobre este sofware) 29 | 30 | ### Visual Studio ### 31 | 32 | 1.- Abrimos la solución Enmarcha.ImageGalery.sln con Visual Studio 2013/ Visual Studio 2015 33 | 34 | 2.- Restauramos los paquetes Nuget de la Solución 35 | 36 | ### Feature Main ### 37 | 1.- Abrimos el Event Receiver asociado a la Feature Main (Main.eventReceiver.cs). Dentro de este código esta la creación de las Columnas de sitio, tipos de contenido y lista de ImageGalery. 38 | 39 | ```C# 40 | var site = properties.Feature.Parent as SPSite; 41 | var web = site.RootWeb; 42 | ILog log = new LogManager().GetLogger(new StackTrace().GetFrame(0)); ; 43 | var columnSiteCollection = web.CreateColumnSite("Image Galery", typeof(ImageGallery)); 44 | web.CreateContentType(Constants.ContentType.ImageGallery, "Enmarcha ContentType", "Elemento", columnSiteCollection); 45 | web.CreateList(Constants.List.ImageGallery, "Lista de la galeria de imagenes", TypeList.GenericList, true); 46 | var list = web.Lists.TryGetList(Constants.List.ImageGallery); 47 | if (list != null) 48 | { 49 | list.AddContentTypeLibrary("Image Galery"); 50 | } 51 | ``` 52 | 2.- En la propia feature, se despliega los ficheros javascript y css que utiliza el WebPArt, para ello en la carpeta Module hay un modulo Style Library donde se despliegua estos elementos. 53 | 54 | 3.- En el CodeBehind del WebPart vamos a realizar la llamada a nuestro servicio de [ImageGalery](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.ImageGalleryWebPart/Enmarcha.ImageGalery.Service) 55 | ```C# 56 | private void LoadData() 57 | { 58 | try 59 | { 60 | var listSharePoint = SPContext.Current.Web.Lists.TryGetList(Constants.List.ImageGallery); 61 | var imageGaleryService = new ImageGaleryService(listSharePoint, 5); 62 | var imageGaleryCollection = imageGaleryService.GetNews(); 63 | listViewImageGalery.DataSource = imageGaleryCollection; 64 | listViewImageGalery.DataBind(); 65 | } 66 | catch (Exception exception) 67 | { 68 | Logger.Error(string.Concat("Error Concat LoadData",exception.Message)); 69 | } 70 | } 71 | ``` 72 | ### Test ### 73 | 1.- La Api de SharePoint esta cerrada por lo que para realizar test unitarios es necesario bien hacer un Mock sobre SharePoint o bien utilizar una herramienta de terceros en nuestros caso hemos utilzado JustMock de Telerik 74 | ```C# 75 | [TestMethod] 76 | public void GetNews() 77 | { 78 | var fakeSiteUrl = "http://www.telerik.com"; 79 | var fakeSharepointSite = Mock.Create(); 80 | var fakeSharePointList = Mock.Create(); 81 | 82 | Mock.Arrange(() => SPContext.Current.Site).Returns(fakeSharepointSite); 83 | Mock.Arrange(() => fakeSharepointSite.RootWeb.Lists.TryGetList("demo")).Returns(fakeSharePointList); 84 | 85 | var service = new ImageGaleryService(fakeSharePointList, 10); 86 | Mock.Arrange(() => service.GetNews()).Returns(new List 87 | { new ImageGallery 88 | { 89 | Title = "Imagen", 90 | Description = "Image", 91 | UrlNew = new UrlField {Description = string.Empty,Url = "http://google.es"}, 92 | Image = new UrlField {Description = string.Empty,Url = "http://google.es"}, 93 | Visible = true, 94 | ID = "1", 95 | OpenWindows = true 96 | } }); 97 | } 98 | ``` 99 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/Enmarcha.Samples.ManageData.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85} 8 | Exe 9 | Properties 10 | Enmarcha.Samples.ManageData 11 | Enmarcha.Samples.ManageData 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | true 37 | bin\x64\Debug\ 38 | DEBUG;TRACE 39 | full 40 | x64 41 | prompt 42 | MinimumRecommendedRules.ruleset 43 | true 44 | 45 | 46 | bin\x64\Release\ 47 | TRACE 48 | true 49 | pdbonly 50 | x64 51 | prompt 52 | MinimumRecommendedRules.ruleset 53 | true 54 | 55 | 56 | 57 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 58 | True 59 | 60 | 61 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 62 | True 63 | 64 | 65 | False 66 | ..\..\dll\Microsoft.SharePoint.dll 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 94 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/Model/Employed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enmarcha.SharePoint.Abstract.Enum; 4 | using Enmarcha.SharePoint.Attribute; 5 | using Enmarcha.SharePoint.Helpers.Data; 6 | 7 | namespace Enmarcha.Samples.ManageData.Model 8 | { 9 | public class Employed 10 | { 11 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 12 | public string ID { get; set; } 13 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Fist Name")] 14 | public string Name { get; set; } 15 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Last Name")] 16 | public string LastName { get; set; } 17 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.DateTime, DisplayName = "Date of Born")] 18 | public DateTime DateBorn { get; set; } 19 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Choice, DisplayName = "Job",Choice= new []{"Developer","Designer"})] 20 | public string Job { get; set; } 21 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Country")] 22 | public string Country { get; set; } 23 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.User, DisplayName = "Boss Primary")] 24 | public IList Boss { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Enmarcha.Samples.ManageData.Model; 4 | using Enmarcha.SharePoint.Abstract.Enum; 5 | using Enmarcha.SharePoint.Class.Data; 6 | using Enmarcha.SharePoint.Class.Logs; 7 | using Enmarcha.SharePoint.Extensors; 8 | using Microsoft.SharePoint; 9 | 10 | namespace Enmarcha.Samples.ManageData 11 | { 12 | internal class Program 13 | { 14 | private static void Main() 15 | { 16 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 17 | const string listName = "Employed"; 18 | using (var site = new SPSite(urlSharePointOnpremise)) 19 | { 20 | var web = site.OpenWeb(); 21 | var list = web.Lists.TryGetList(listName); 22 | if (list == null) 23 | { 24 | var createList= web.CreateList(listName, "List of Employed of my Company", TypeList.GenericList, false, 25 | typeof (Employed)); 26 | Console.WriteLine(string.Concat("List Employed Created", createList)); 27 | } 28 | 29 | var employed = new Employed 30 | { 31 | Country = "Spain", 32 | DateBorn = new DateTime(1981, 5, 10), 33 | Job = "Sofware Architect", 34 | LastName = "Diaz Cervera", 35 | Name = "Adrian" 36 | }; 37 | 38 | var employed2 = new Employed 39 | { 40 | Country = "Spain", 41 | DateBorn = new DateTime(1979, 5, 10), 42 | Job = "Head of Innovation", 43 | LastName = "Diaz Martin", 44 | Name = "Alberto" 45 | }; 46 | 47 | var logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); ; 48 | var repository= new SharePointRepository(web,logger,listName,10); 49 | 50 | var resultInsert= repository.Insert(employed); 51 | Console.WriteLine(string.Concat("Insertado el elemento: ", resultInsert)); 52 | resultInsert = repository.Insert(employed2); 53 | Console.WriteLine(string.Concat("Insertado el elemento: ", resultInsert)); 54 | 55 | var employed3= repository.Get(resultInsert); 56 | Console.WriteLine(string.Concat("Return employed: ", employed3.Name)); 57 | var employedCollection= repository.GetAll(); 58 | Console.WriteLine(string.Concat("Count Employed: ", employedCollection.Count)); 59 | var resultBool = repository.Delete(resultInsert); 60 | Console.WriteLine(string.Concat("Elemento Eliminado ", resultBool)); 61 | employedCollection = repository.GetAll(); 62 | Console.WriteLine(string.Concat("Count Employed: ", employedCollection.Count)); 63 | var queryCaml = @" 64 | 65 | 66 | Adrian 67 | 68 | "; 69 | var queryCollection = repository.Query(queryCaml, 1); 70 | Console.WriteLine(string.Concat("Count Employed: ", queryCollection.Count)); 71 | var query = new Query().Where().Field("Name",string.Empty).Operator(TypeOperators.Eq).Value("Text","Adrian"); 72 | queryCollection = repository.Query(query, 1); 73 | Console.WriteLine(string.Concat("Count Employed: ", queryCollection.Count)); 74 | var firstEmployed = queryCollection.FirstOrDefault(); 75 | firstEmployed.Name = "Alberto Javier"; 76 | var updateOperation= repository.Save(Convert.ToInt32(firstEmployed.ID), firstEmployed); 77 | Console.WriteLine(string.Concat("Update Employed: ", updateOperation)); 78 | Console.ReadLine(); 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.Samples.ManageData")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.Samples.ManageData")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6505d4e9-e35e-444f-95f7-8ec6646b1c85")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/README.md: -------------------------------------------------------------------------------- 1 | # Administrar datos en Listas # 2 | 3 | ### Resumen ### 4 | Este ejemplo muestra como hacer operaciones CRUD utilizando el Repositorio de Enmarcha de datos. 5 | 6 | ### Funciona con ### 7 | - SharePoint 2013 on-premises 8 | 9 | ### Prerequisitos ### 10 | Visual Studio 2013 o superior 11 | 12 | ### Solucion ### 13 | Solucin | Autor(s) 14 | ---------|---------- 15 | Enmarcha.Samples.ManageData | [Adrian Diaz Cervera](https://github.com/AdrianDiaz81) (**ENCAMINA**) 16 | 17 | ### Version history ### 18 | Version | Fecha | Comentarios 19 | ---------| -----| -------- 20 | 1.0 | Enero 29 2016 | Initial release 21 | 22 | ### Disclaimer ### 23 | **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** 24 | 25 | ---------- 26 | 27 | ## ESCENARIO ## 28 | En este escenario vamos a mostrar como trabajar con una lista utilizando la clase [SharePointRepository](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Entities/Data/SharePointRepository.cs) 29 | 30 | ### Visual Studio ### 31 | 32 | 1.- Abrimos la solución Enmarcha.Samples.sln con Visual Studio 2013/ Visual Studio 2015 33 | 34 | 2.- Restauramos los paquetes Nuget de la Solución 35 | 36 | 3.- Abrimos el fichero Program.cs e introducimos la url de nuestro sitio de SharePoint que esta asignada en la constante urlSharePointOnpremise: 37 | ```C# 38 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 39 | ``` 40 | 4.- Para crear la lista utilizaremos el método extensor [CreateList](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/List.cs) 41 | ```C# 42 | var createList= web.CreateList(listName, "List of Employed of my Company", TypeList.GenericList, false, 43 | typeof (Employed)); 44 | ``` 45 | Esto crea una lista y le añade los campos, cada una de las propiedades que hay en la clase [Employed.cs](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Samples/Enmarcha.Samples.ManageData/Model/Employed.cs). 46 | Para saber que tipo de Columnas de SharePoint son necesarios a cada propiedad le asignamos unos Atributos donde se condigura estos valores: 47 | ```C# 48 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 49 | public string ID { get; set; } 50 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Fist Name")] 51 | public string Name { get; set; } 52 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Last Name")] 53 | public string LastName { get; set; } 54 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.DateTime, DisplayName = "Date of Born")] 55 | public DateTime DateBorn { get; set; } 56 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Choice, DisplayName = "Job",Choice= new []{"Developer","Designer"})] 57 | public string Job { get; set; } 58 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Country")] 59 | public string Country { get; set; } 60 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.User, DisplayName = "Boss Primary")] 61 | public IList Boss { get; set; } 62 | ``` 63 | Los Atributos que se pueden añadir a cada propiedad estan dentro de la Clase [EnmarchaAttribute.cs]https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Attribute/EnmarchaAttribute.cs) 64 | AddPrefeix-> Le añada un prefijo cuando crea el campo de forma que se evita que coincida con algun campo ya declarado 65 | Create -> Indica si esta propiedad hay que crearla o no. 66 | Type -> Tipo de SharePoint con el que representa esta propiedad 67 | 68 | 5.-A continuación, inicialicaremos la clase SharePointRepository, los parametros que son necesarios son: 69 | 70 | . SPweb 71 | 72 | . Log (Enmarcha por defecto trae un Log que graba en los [logs de SharePoint](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Entities/Logs/LogManager.cs) pero se puede utilizar cualquier Log siemple que se implemente la interfaz [ILog](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint.Abstract/Interfaces/Artefacts/ILog.cs) 73 | 74 | ```C# 75 | var logger = new LogManager().GetLogger(new System.Diagnostics.StackTrace().GetFrame(0)); ; 76 | var repository= new SharePointRepository(web,logger,listName,10); 77 | ``` 78 | 79 | 6.- Ahora para insertar un elemento sobre la lista de SharePoint Employed, tendremos en primer lugar crear una elemento basado en la clase Employed y a continuación pasarle ese elemento al metodo "Insert" de nuestro repositorio de SharePoint. de 80 | ```C# 81 | var employed = new Employed 82 | { 83 | Country = "Spain", 84 | DateBorn = new DateTime(1981, 5, 10), 85 | Job = "Sofware Architect", 86 | LastName = "Diaz Cervera", 87 | Name = "Adrian" 88 | }; 89 | var resultInsert= repository.Insert(employed); 90 | ``` 91 | 7.- Para realizar una modificación sobre un elemento hay que pasarle los datos que se quierean modificar y el identificador del elemento que vamos actualizar 92 | ```C# 93 | var firstEmployed= new Employed { Job = "Sofware Architect Lead"}; 94 | var updateOperation= repository.Save(Convert.ToInt32(resultInsert), firstEmployed); 95 | ``` 96 | 97 | 8.- Eliminar un elemento 98 | ```C# 99 | var resultBool = repository.Delete(resultInsert); 100 | ``` 101 | 102 | 9.- Como hacer Hacer consultas sobre las listas, se pueden hacer de dos formas pasando la Caml Query de forma directa: 103 | ```C# 104 | var queryCaml = @" 105 | 106 | 107 | Adrian 108 | 109 | "; 110 | var queryCollection = repository.Query(queryCaml, 1); 111 | ``` 112 | o bien podemos utilizar un [generador de consultas](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Entities/Data/Query.cs) que esta dentro de Enmarcha 113 | ```C# 114 | var query = new Query().Where().Field("Name",string.Empty).Operator(TypeOperators.Eq).Value("Text","Adrian"); 115 | queryCollection = repository.Query(query, 1); 116 | ``` 117 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.ManageData/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/Enmarcha.Samples.PermissionList.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {FD35E9A6-5832-44D6-B799-5591F7058343} 8 | Exe 9 | Properties 10 | Enmarcha.Samples.PermissionList 11 | Enmarcha.Samples.PermissionList 12 | v4.5 13 | 512 14 | true 15 | 16 | 17 | 18 | x64 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 39 | True 40 | 41 | 42 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 43 | True 44 | 45 | 46 | False 47 | ..\..\..\..\..\..\..\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 74 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/Program.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.SharePoint.Abstract.Enum; 2 | using Enmarcha.SharePoint.Extensors; 3 | using Microsoft.SharePoint; 4 | 5 | namespace Enmarcha.Samples.PermissionList 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 12 | const string listSample = "listSample"; 13 | using (var site = new SPSite(urlSharePointOnpremise)) 14 | { 15 | using (var web = site.OpenWeb()) 16 | { 17 | var list = web.Lists.TryGetList(listSample); 18 | if (list == null) web.CreateList(listSample, string.Empty, TypeList.GenericList,true); 19 | web.CreateGroup("Test",SPRoleType.Reader); 20 | var result= list.AddPermisionLibrary("Test", RoleType.Contributor); 21 | 22 | 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.Samples.PermissionList")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.Samples.PermissionList")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fd35e9a6-5832-44d6-b799-5591f7058343")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/README.md: -------------------------------------------------------------------------------- 1 | # Administrar permisos en Listas # 2 | 3 | ### Resumen ### 4 | Este ejemplo muestra como dar permisos a los grupos en las Listas de SharePoint. 5 | 6 | ### Funciona con ### 7 | - SharePoint 2013 on-premises 8 | 9 | ### Prerequisitos ### 10 | Visual Studio 2013 o superior 11 | 12 | ### Solucion ### 13 | Solución | Autor(s) 14 | ---------|---------- 15 | Enmarcha.Samples.PermissionList | [Adrian Diaz Cervera](https://github.com/AdrianDiaz81) (**ENCAMINA**) 16 | 17 | ### Version history ### 18 | Version | Fecha | Comentarios 19 | ---------| -----| -------- 20 | 1.0 | Enero 29 2016 | Initial release 21 | 22 | ### Disclaimer ### 23 | **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** 24 | 25 | ---------- 26 | 27 | ## ESCENARIO ## 28 | En este escenario vamos a mostrar como Enmarcha [extiende la API de SharePoint Server](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/List.cs) para ahorrar funcionalidad. 29 | 30 | ### Visual Studio ### 31 | 32 | 1.- Abrimos la solución Enmarcha.Samples.sln con Visual Studio 2013/ Visual Studio 2015 33 | 34 | 2.- Restauramos los paquetes Nuget de la Solución 35 | 36 | 3.- Abrimos el fichero Program.cs e introducimos la url de nuestro sitio de SharePoint que esta asignada en la constante urlSharePointOnpremise: 37 | ```C# 38 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 39 | ``` 40 | 4.- Para crear la lista utilizaremos el método extensor [CreateList](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/List.cs) 41 | ```C# 42 | if (list == null) web.CreateList(listSample, string.Empty, TypeList.GenericList,true); 43 | ``` 44 | 45 | 5.- Creamos un grupo con el método Extensor [CreateGroup](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/RolesManagment.cs) 46 | ```C# 47 | web.CreateGroup("Test",SPRoleType.Reader); 48 | ``` 49 | 50 | 6.- Consultaremos la lista de SharePoint 51 | ```C# 52 | var list = web.Lists.TryGetList(listSample); 53 | ``` 54 | 7.-Y utilizando el método extensor de la lista AddPermissionLibrary le añadiremos al grupo recien creado el rol de "Contributor". 55 | ```C# 56 | var result= list.AddPermisionLibrary("Test", RoleType.Contributor); 57 | ``` 58 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.PermissionList/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/Enmarcha.Samples.Provisioning.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8EBC1C9A-0913-404D-B0DD-192488503E02} 8 | Exe 9 | Properties 10 | Enmarcha.Samples.Provisioning 11 | Enmarcha.Samples.Provisioning 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 38 | True 39 | 40 | 41 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 42 | True 43 | 44 | 45 | False 46 | ..\..\dll\Microsoft.SharePoint.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 74 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/Model/Employed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Enmarcha.SharePoint.Abstract.Enum; 4 | using Enmarcha.SharePoint.Attribute; 5 | using Enmarcha.SharePoint.Helpers.Data; 6 | 7 | namespace Enmarcha.Samples.Provisioning.Model 8 | { 9 | public class Employed 10 | { 11 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 12 | public string ID { get; set; } 13 | [Enmarcha(AddPrefeix = true, Create = true, Type = TypeField.Text, DisplayName = "Fist Name")] 14 | public string Name { get; set; } 15 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Last Name")] 16 | public string LastName { get; set; } 17 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.DateTime, DisplayName = "Date of Born")] 18 | public DateTime DateBorn { get; set; } 19 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Choice, DisplayName = "Job",Choice= new []{"Developer","Designer"})] 20 | public string Job { get; set; } 21 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Country")] 22 | public string Country { get; set; } 23 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.User, DisplayName = "Boss Primary")] 24 | public IList Boss { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/Program.cs: -------------------------------------------------------------------------------- 1 | using Enmarcha.Samples.Provisioning.Model; 2 | using Enmarcha.SharePoint.Abstract.Enum; 3 | using Enmarcha.SharePoint.Extensors; 4 | using Microsoft.SharePoint; 5 | 6 | namespace Enmarcha.Samples.Provisioning 7 | { 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | const string urlSharePointOnpremise = "[enteryoururlhere]"; 13 | using (var site = new SPSite(urlSharePointOnpremise)) 14 | { 15 | using (var web = site.OpenWeb()) 16 | { 17 | 18 | 19 | var columnSite = web.CreateColumnSite("ENMARCHA ContentType", typeof(Employed)); 20 | web.CreateContentType("EmployedBussines", "ENMARCHA","Elemento", columnSite); 21 | 22 | web.CreateList("Empleados", "Lista de Empleados", TypeList.GenericList, true); 23 | var list = web.Lists.TryGetList("Empleados"); 24 | list.AddContentTypeLibrary("EmployedBussines"); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.Samples.Provisioning")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.Samples.Provisioning")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8ebc1c9a-0913-404d-b0dd-192488503e02")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/README.md: -------------------------------------------------------------------------------- 1 | # Administrar datos en Listas # 2 | 3 | ### Resumen ### 4 | Este ejemplo muestra como aprovisionar Columnas de Sitio, Tipos de Contenido, Listas en un sitio de SharePoint. 5 | 6 | ### Funciona con ### 7 | - SharePoint 2013 on-premises 8 | 9 | ### Prerequisitos ### 10 | Visual Studio 2013 o superior 11 | 12 | ### Solución ### 13 | Solucin | Autor(s) 14 | ---------|---------- 15 | Enmarcha.Samples.Provisioning | [Adrian Diaz Cervera](https://github.com/AdrianDiaz81) (**ENCAMINA**) 16 | 17 | ### Version history ### 18 | Version | Fecha | Comentarios 19 | ---------| -----| -------- 20 | 1.0 | Enero 29 2016 | Initial release 21 | 22 | ### Disclaimer ### 23 | **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** 24 | 25 | ---------- 26 | 27 | ## ESCENARIO ## 28 | En este escenario vamos a mostrar como trabajar con una lista utilizando la clase [SharePointRepository](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Entities/Data/SharePointRepository.cs) 29 | 30 | ### Visual Studio ### 31 | 32 | 1.- Abrimos la solución Enmarcha.Samples.sln con Visual Studio 2013/ Visual Studio 2015 33 | 34 | 2.- Restauramos los paquetes Nuget de la Solución 35 | 36 | 3.- Abrimos el fichero Program.cs e introducimos la url de nuestro sitio de SharePoint que esta asignada en la constante urlSharePointOnpremise: 37 | ```C# 38 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 39 | ``` 40 | 4.-En primer lugar se creará una Columna de Sitio en base la clase [Employed.cs](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Samples/Enmarcha.Samples.Provisioning/Model/Employed.cs) 41 | ```C# 42 | var columnSite = web.CreateColumnSite("ENMARCHA ContentType", typeof(Employed)); 43 | ``` 44 | Esto crea una lista y le añade los campos, cada una de las propiedades que hay en la clase [Employed.cs](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Samples/Enmarcha.Samples.ManageData/Model/Employed.cs). 45 | Para saber que tipo de Columnas de SharePoint son necesarios a cada propiedad le asignamos unos Atributos donde se condigura estos valores: 46 | ```C# 47 | [Enmarcha(AddPrefeix = false, Create = false, Type = TypeField.Text)] 48 | public string ID { get; set; } 49 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Fist Name")] 50 | public string Name { get; set; } 51 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Last Name")] 52 | public string LastName { get; set; } 53 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.DateTime, DisplayName = "Date of Born")] 54 | public DateTime DateBorn { get; set; } 55 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Choice, DisplayName = "Job",Choice= new []{"Developer","Designer"})] 56 | public string Job { get; set; } 57 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.Text, DisplayName = "Country")] 58 | public string Country { get; set; } 59 | [Enmarcha(AddPrefeix = false, Create = true, Type = TypeField.User, DisplayName = "Boss Primary")] 60 | public IList Boss { get; set; } 61 | ``` 62 | Los Atributos que se pueden añadir a cada propiedad estan dentro de la Clase [EnmarchaAttribute.cs](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Attribute/EnmarchaAttribute.cs) 63 | 64 | AddPrefeix-> Le añada un prefijo cuando crea el campo de forma que se evita que coincida con algun campo ya declarado 65 | 66 | Create -> Indica si esta propiedad hay que crearla o no. 67 | 68 | Type -> Tipo de SharePoint con el que representa esta propiedad 69 | 70 | 5.-A continuación, crearemos un tipo de contenido, añadiendo las columnas de sitio creadas en el paso anterior 71 | 72 | ```C# 73 | web.CreateContentType("EmployedBussines", "ENMARCHA","Elemento", columnSite); 74 | ``` 75 | 76 | 6.- Ahora creamos una lista y le agregamos el tipo de contenido creado 77 | ```C# 78 | web.CreateList("Empleados", "Lista de Empleados", TypeList.GenericList, true); 79 | var list = web.Lists.TryGetList("Empleados"); 80 | list.AddContentTypeLibrary("EmployedBussines"); 81 | ``` 82 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.Provisioning/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/Enmarcha.Samples.SiteProvisioning.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E6F4B089-27F4-419F-8419-48FE9BD672B9} 8 | Exe 9 | Properties 10 | Enmarcha.Samples.SiteProvisioning 11 | Enmarcha.Samples.SiteProvisioning 12 | v4.5 13 | 512 14 | true 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.dll 38 | True 39 | 40 | 41 | ..\packages\Enmarcha.SharePoint.0.0.0.1\lib\net45\Enmarcha.SharePoint.Abstract.dll 42 | True 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 69 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.SharePoint; 3 | using Enmarcha.SharePoint.Extensors; 4 | 5 | namespace Enmarcha.Samples.SiteProvisioning 6 | { 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 12 | 13 | using (var site = new SPSite(urlSharePointOnpremise)) 14 | { 15 | Console.WriteLine("Creating sample site"); 16 | var siteCreationSuccess = site.CreateSite("sample", "Sample Site", "This is a sample site", "STS"); 17 | Console.WriteLine("Sample site creaction success"); 18 | 19 | Console.WriteLine("Creating sample subsite"); 20 | using (var web = site.OpenWeb("sample")) 21 | { 22 | var subSiteCreationSuccess = web.CreateSubSite("samplesubsite", "Sample Subsite", "This is a sample subsite", "STS"); 23 | Console.WriteLine("Sample subsite creation success"); 24 | } 25 | 26 | } 27 | 28 | Console.ReadLine(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Enmarcha.Samples.SiteProvisioning")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Enmarcha.Samples.SiteProvisioning")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ded2febf-6fc6-45b8-9855-b887891dba01")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/README.md: -------------------------------------------------------------------------------- 1 | # Aprovisionamiento de sitios # 2 | 3 | ### Resumen ### 4 | Este ejemplo muestra como crear Sitios y SubSitios dentro de nuestro Sitio de SharePoint. 5 | 6 | ### Funciona con ### 7 | - SharePoint 2013 on-premises 8 | 9 | ### Prerequisitos ### 10 | Visual Studio 2013 o superior 11 | 12 | ### Solucion ### 13 | Solución | Autor(s) 14 | ---------|---------- 15 | Enmarcha.Samples.ManageData | [Juan Carlos Martínez](https://github.com/jcmartinez23) (**ENCAMINA**) 16 | 17 | ### Version history ### 18 | Version | Fecha | Comentarios 19 | ---------| -----| -------- 20 | 1.0 | Enero 29 2016 | Initial release 21 | 22 | ### Disclaimer ### 23 | **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** 24 | 25 | ---------- 26 | 27 | ## ESCENARIO ## 28 | En este escenario vamos crear un sitio y un subsitio de SharePoint. 29 | 30 | ### Visual Studio ### 31 | 32 | 1.- Abrimos la solución Enmarcha.Samples.sln con Visual Studio 2013/ Visual Studio 2015 33 | 34 | 2.- Restauramos los paquetes Nuget de la Solución 35 | 36 | 3.- Abrimos el fichero Program.cs e introducimos la url de nuestro sitio de SharePoint que esta asignada en la constante urlSharePointOnpremise: 37 | ```C# 38 | const string urlSharePointOnpremise = "urlsiteSharePoint"; 39 | ``` 40 | 4.- Crearemos un sitio utilizando el método extensor [CreateSite](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/Site.cs) 41 | ```C# 42 | var siteCreationSuccess = site.CreateSite("sample", "Sample Site", "This is a sample site", "STS"); 43 | ``` 44 | 5.- Crearemos un sub sitio utilizando el método extensor [CreateSite](https://github.com/Encamina/Enmarcha-SharePoint/blob/master/Enmarcha.SharePoint/Extensors/Site.cs) 45 | ```C# 46 | var subSiteCreationSuccess = web.CreateSubSite("samplesubsite", "Sample Subsite", "This is a sample subsite", "STS"); 47 | ``` 48 | -------------------------------------------------------------------------------- /Samples/Enmarcha.Samples.SiteProvisioning/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Samples/Enmarcha.SharePoint.Samples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.Samples.ManageData", "Enmarcha.Samples.ManageData\Enmarcha.Samples.ManageData.csproj", "{6505D4E9-E35E-444F-95F7-8EC6646B1C85}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.Samples.Provisioning", "Enmarcha.Samples.Provisioning\Enmarcha.Samples.Provisioning.csproj", "{8EBC1C9A-0913-404D-B0DD-192488503E02}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.Samples.PermissionList", "Enmarcha.Samples.PermissionList\Enmarcha.Samples.PermissionList.csproj", "{FD35E9A6-5832-44D6-B799-5591F7058343}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enmarcha.Samples.SiteProvisioning", "Enmarcha.Samples.SiteProvisioning\Enmarcha.Samples.SiteProvisioning.csproj", "{E6F4B089-27F4-419F-8419-48FE9BD672B9}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|x64 = Debug|x64 18 | Release|Any CPU = Release|Any CPU 19 | Release|x64 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Debug|x64.ActiveCfg = Debug|x64 25 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Debug|x64.Build.0 = Debug|x64 26 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Release|x64.ActiveCfg = Release|x64 29 | {6505D4E9-E35E-444F-95F7-8EC6646B1C85}.Release|x64.Build.0 = Release|x64 30 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Debug|x64.ActiveCfg = Debug|Any CPU 33 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Debug|x64.Build.0 = Debug|Any CPU 34 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Release|x64.ActiveCfg = Release|Any CPU 37 | {8EBC1C9A-0913-404D-B0DD-192488503E02}.Release|x64.Build.0 = Release|Any CPU 38 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Debug|x64.Build.0 = Debug|Any CPU 42 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Release|x64.ActiveCfg = Release|Any CPU 45 | {FD35E9A6-5832-44D6-B799-5591F7058343}.Release|x64.Build.0 = Release|Any CPU 46 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Debug|x64.ActiveCfg = Debug|Any CPU 49 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Debug|x64.Build.0 = Debug|Any CPU 50 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Release|x64.ActiveCfg = Release|Any CPU 53 | {E6F4B089-27F4-419F-8419-48FE9BD672B9}.Release|x64.Build.0 = Release|Any CPU 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | EndGlobal 59 | -------------------------------------------------------------------------------- /Samples/README.md: -------------------------------------------------------------------------------- 1 | # Ejemplos de uso 2 | 3 | Para aprender a usar ENMARCHA, os hemos creado los siguientes ejemplos: 4 | * [Enmarcha.Samples.ImageGaleryWebPart](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.ImageGalleryWebPart) - Ejemplo de crear un WebPart y hacer uso de Enmarcha tanto para aprovisionamiento de artefactos (Columnas de Sitio, Tipos de contenido, listas) como para trabajar con datos (listas y bibliotecas de documentos en SharePoint) 5 | * [Enmarcha.Samples.ManageData](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.ManageData) - Trabajar con datos (listas y bibliotecas de documentos en SharePoint) 6 | * [Enmarcha.Samples.PermissionList](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.PermissionList) - Gestionar los permisos a grupos de SharePoint dentro de una lista 7 | * [Enmarcha.Samples.Provisioning](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.Provisioning) - Provisionar artefactos de SharePoint 8 | * [Enmarcha.Samples.SitesProvisioning](https://github.com/Encamina/Enmarcha-SharePoint/tree/master/Samples/Enmarcha.Samples.SiteProvisioning) - Provisionaremos Sitios y Subsitios dentro de ShareProint 9 | --------------------------------------------------------------------------------