Skip to content

Commit 4d9828d

Browse files
committed
All projects up to point v0.9.8.1u
1 parent 4ab2221 commit 4d9828d

36 files changed

+1068
-131
lines changed

WBFWebParts/Classes/WBFWebPartsUtils.cs

+60-12
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ internal class WBFWebPartsUtils
3333
{
3434
internal const String WBF_WEB_PARTS__RECORDS_LIBRARY__PUBLIC = "Public Library";
3535
internal const String WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED = "Protected Library";
36+
internal const String WBF_WEB_PARTS__RECORDS_LIBRARY__LOCAL = "Local Public Library";
3637

3738
internal const String SP_SITE_PROPERTY__RECORDS_LIBRARY_TO_USE = "wbf__sp_site__wbf_web_parts__records_library_to_use";
39+
internal const String SP_SITE_PROPERTY__LOCAL_PUBLIC_LIBRARY_URL = "wbf__sp_site__wbf_web_parts__local_public_library_url";
3840
internal const String SP_SITE_PROPERTY__USE_EXTRANET_LIBRARY = "wbf__sp_site__wbf_web_parts__use_extranet_library";
41+
internal const String SP_SITE_PROPERTY__LOCAL_EXTRANET_LIBRARY_URL = "wbf__sp_site__wbf_web_parts__local_extranet_library_url";
3942
internal const String SP_SITE_PROPERTY__SHOW_FILE_ICONS = "wbf__sp_site__wbf_web_parts__show_file_icons";
4043
internal const String SP_SITE_PROPERTY__SHOW_KB_FILE_SIZE = "wbf__sp_site__wbf_web_parts__show_kb_file_size";
4144
internal const String SP_SITE_PROPERTY__SHOW_DESCRIPTION = "wbf__sp_site__wbf_web_parts__show_description";
@@ -53,6 +56,8 @@ internal static List<String> GetRecordsLibraryOptions()
5356
options.Add(WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED);
5457
}
5558

59+
options.Add(WBF_WEB_PARTS__RECORDS_LIBRARY__LOCAL);
60+
5661
return options;
5762
}
5863

@@ -65,13 +70,15 @@ internal static String GetRecordsLibraryToUse(SPSite site) {
6570
}
6671
else
6772
{
68-
if (site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__RECORDS_LIBRARY_TO_USE) == WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED)
73+
String libraryToUse = site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__RECORDS_LIBRARY_TO_USE);
74+
75+
if (String.IsNullOrEmpty(libraryToUse))
6976
{
70-
return WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED;
77+
return WBF_WEB_PARTS__RECORDS_LIBRARY__PUBLIC;
7178
}
72-
else
79+
else
7380
{
74-
return WBF_WEB_PARTS__RECORDS_LIBRARY__PUBLIC;
81+
return libraryToUse;
7582
}
7683
}
7784
}
@@ -88,22 +95,37 @@ internal static void SetRecordsLibraryToUse(SPSite site, String recordsLibraryTo
8895
site.RootWeb.WBxSetProperty(SP_SITE_PROPERTY__RECORDS_LIBRARY_TO_USE, recordsLibraryToUse);
8996
}
9097

98+
internal static void SetLocalPublicLibraryURL(SPSite site, String localPublicURL)
99+
{
100+
site.RootWeb.WBxSetProperty(SP_SITE_PROPERTY__LOCAL_PUBLIC_LIBRARY_URL, localPublicURL);
101+
}
102+
103+
internal static String GetLocalPublicLibraryURL(SPSite site)
104+
{
105+
return site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__LOCAL_PUBLIC_LIBRARY_URL);
106+
}
107+
108+
91109
internal static String GetRecordsLibraryURL(SPSite site)
92110
{
93111
WBFarm farm = WBFarm.Local;
94112

95-
if (GetRecordsLibraryToUse(site) == WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED)
113+
String libraryToUse = GetRecordsLibraryToUse(site);
114+
String localLibraryURL = site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__LOCAL_PUBLIC_LIBRARY_URL);
115+
116+
if (libraryToUse == WBF_WEB_PARTS__RECORDS_LIBRARY__PROTECTED)
96117
{
97118
return farm.ProtectedRecordsLibraryUrl;
98119
}
99-
else
120+
else if (libraryToUse == WBF_WEB_PARTS__RECORDS_LIBRARY__LOCAL && !String.IsNullOrEmpty(localLibraryURL))
100121
{
101-
return farm.PublicRecordsLibraryUrl;
122+
return localLibraryURL;
123+
}
124+
else
125+
{
126+
return farm.PublicRecordsLibraryUrl;
102127
}
103-
}
104-
105-
106-
128+
}
107129

108130
internal static bool UseExtranetLibrary(SPSite site)
109131
{
@@ -112,9 +134,35 @@ internal static bool UseExtranetLibrary(SPSite site)
112134

113135
internal static void SetUseExtranetLibrary(SPSite site, bool value)
114136
{
115-
site.RootWeb.WBxSetBoolProperty(SP_SITE_PROPERTY__USE_EXTRANET_LIBRARY, value);
137+
site.RootWeb.WBxSetBoolProperty(SP_SITE_PROPERTY__USE_EXTRANET_LIBRARY, value);
116138
}
117139

140+
internal static String GetExtranetLibraryURL(SPSite site)
141+
{
142+
WBFarm farm = WBFarm.Local;
143+
144+
String localExtranetURL = site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__LOCAL_EXTRANET_LIBRARY_URL);
145+
146+
if (String.IsNullOrEmpty(localExtranetURL))
147+
{
148+
return farm.PublicExtranetRecordsLibraryUrl;
149+
}
150+
else
151+
{
152+
return localExtranetURL;
153+
}
154+
}
155+
156+
internal static void SetLocalExtranetLibraryURL(SPSite site, String localExtranetURL)
157+
{
158+
site.RootWeb.WBxSetProperty(SP_SITE_PROPERTY__LOCAL_EXTRANET_LIBRARY_URL, localExtranetURL);
159+
}
160+
161+
internal static String GetLocalExtranetLibraryURL(SPSite site)
162+
{
163+
return site.RootWeb.WBxGetProperty(SP_SITE_PROPERTY__LOCAL_EXTRANET_LIBRARY_URL);
164+
}
165+
118166

119167
internal static bool ShowKBFileSize(SPSite site)
120168
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.GenericElement" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site, WebApplication, Farm, Package" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
3+
<Files />
4+
</ProjectItem>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
3+
4+
<CustomActionGroup
5+
Description = "Site Settings group for the Work Box Framework"
6+
Id = "WorkBoxFramework.SiteSettingsGroup"
7+
Location = "Microsoft.SharePoint.SiteSettings"
8+
Sequence = "1123"
9+
Title = "Work Box Framework"
10+
ImageUrl="/_layouts/images/WBFWebParts/work-box-48.png"
11+
>
12+
</CustomActionGroup>
13+
14+
</Elements>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.GenericElement" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site, WebApplication, Farm, Package" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
3+
<Files>
4+
<ProjectItemFile Source="Elements.xml" Target="WBFWebPartsAdminGroup\" Type="ElementManifest" />
5+
</Files>
6+
</ProjectItem>

WBFWebParts/Features/ExtranetWebParts/ExtranetWebParts.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feature xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="061c5b12-6d9e-4873-b139-16a15d20b184" featureId="061c5b12-6d9e-4873-b139-16a15d20b184" imageUrl="" scope="Site" solutionId="00000000-0000-0000-0000-000000000000" title="WBFWebParts - Extranet Web Parts" version="" deploymentPath="$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/FeatureModel">
2+
<feature xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="061c5b12-6d9e-4873-b139-16a15d20b184" featureId="061c5b12-6d9e-4873-b139-16a15d20b184" imageUrl="" scope="Site" solutionId="00000000-0000-0000-0000-000000000000" title="WBF Web Parts - Documents Group Web Part" version="" deploymentPath="$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/FeatureModel">
33
<projectItems>
44
<projectItemReference itemId="2da6489a-5a87-421d-84a3-60cba87a5620" />
55
</projectItems>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
3+
</Feature>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<feature xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="31e3f8ed-2d9b-47ef-82cd-8ecd87d38a60" description="Only activate this feature on a public farm where the Work Box Framework has not been installed as a WSP solution. This feature creates the custom action group needed to access the configuration pages for the WBFWebParts features." featureId="31e3f8ed-2d9b-47ef-82cd-8ecd87d38a60" imageUrl="" scope="Site" solutionId="00000000-0000-0000-0000-000000000000" title="WBF Web Parts - Public Farm Admin" version="" deploymentPath="$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/FeatureModel">
3+
<projectItems>
4+
<projectItemReference itemId="a5feb75c-0378-4eec-876c-64dfdd510385" />
5+
</projectItems>
6+
</feature>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.MappedFolder" SupportedTrustLevels="FullTrust" SupportedDeploymentScopes="Package" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
3+
<ProjectItemFolder Target="Images" Type="TemplateFile" />
4+
</ProjectItem>
6.17 KB
Loading

WBFWebParts/Layouts/WBFWebParts/EditDocumentsGroup.aspx.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public TableRow CreateEditableTableRow(SPSite site, SPWeb web, SPList library, i
210210
{
211211
if (extranetRecordsLibrary == null)
212212
{
213-
string extranetRecordsLibraryURL = WBFarm.Local.PublicExtranetRecordsLibraryUrl;
213+
string extranetRecordsLibraryURL = WBFWebPartsUtils.GetExtranetLibraryURL(SPContext.Current.Site);
214214
extranetRecordsSite = new SPSite(extranetRecordsLibraryURL);
215215
extranetRecordsWeb = extranetRecordsSite.OpenWeb();
216216
extranetRecordsLibrary = extranetRecordsWeb.GetList(extranetRecordsLibraryURL);

WBFWebParts/Layouts/WBFWebParts/PublishedDocumentPicker.aspx.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private void RefreshBoundData()
386386

387387
if (Request.QueryString["Library"] == "Extranet")
388388
{
389-
recordsLibraryURL = WBFarm.Local.PublicExtranetRecordsLibraryUrl;
389+
recordsLibraryURL = WBFWebPartsUtils.GetExtranetLibraryURL(SPContext.Current.Site);
390390
}
391391

392392
using (SPSite site = new SPSite(recordsLibraryURL))

WBFWebParts/Layouts/WBFWebParts/WBFWebPartsConfig.aspx

+45-3
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ Configure the features of the <b>Related Documents</b> and <b>Documents Group</b
2626
<table class="ms-propertysheet" border="0" width="100%" cellspacing="0" cellpadding="0">
2727

2828

29-
<!-- Farm Instance Section -->
3029
<wssuc:InputFormSection
3130
id="UsePublicOrProtectedLibrarySection"
32-
title="Use Public Or Protected Library"
33-
description="On public facing websites you must use the public library"
31+
title="Use Which Records Library?"
32+
description="On public facing websites you must use a public library"
3433
runat="server"
3534
>
3635
<Template_InputFormControls>
@@ -49,6 +48,27 @@ Configure the features of the <b>Related Documents</b> and <b>Documents Group</b
4948
</Template_InputFormControls>
5049
</wssuc:InputFormSection>
5150

51+
<wssuc:InputFormSection
52+
id="LocalPublicLibrarySection"
53+
title="Local Public Library URL"
54+
description="If there is a local copy of the public library, what is its URL?"
55+
runat="server"
56+
>
57+
<Template_InputFormControls>
58+
<wssuc:InputFormControl runat="server">
59+
<Template_Control>
60+
<table border="0" width="100%" cellspacing="0" cellpadding="2">
61+
<tr>
62+
<td class="ms-authoringcontrols" valign="top" align="left">
63+
<asp:TextBox ID="LocalPublicLibraryURL" runat="server" columns="50"/>
64+
</td>
65+
</tr>
66+
67+
</table>
68+
</Template_Control>
69+
</wssuc:InputFormControl>
70+
</Template_InputFormControls>
71+
</wssuc:InputFormSection>
5272

5373

5474
<!-- Records Center Section -->
@@ -77,6 +97,28 @@ Configure the features of the <b>Related Documents</b> and <b>Documents Group</b
7797
</Template_InputFormControls>
7898
</wssuc:InputFormSection>
7999

100+
<wssuc:InputFormSection
101+
id="LocalExtranetLibrarySection"
102+
title="Local Extranet Library URL"
103+
description="If there is a local copy of the extranet library, what is its URL?"
104+
runat="server"
105+
>
106+
<Template_InputFormControls>
107+
<wssuc:InputFormControl runat="server">
108+
<Template_Control>
109+
<table border="0" width="100%" cellspacing="0" cellpadding="2">
110+
<tr>
111+
<td class="ms-authoringcontrols" valign="top" align="left">
112+
<asp:TextBox ID="LocalExtranetLibraryURL" runat="server" columns="50"/>
113+
</td>
114+
</tr>
115+
116+
</table>
117+
</Template_Control>
118+
</wssuc:InputFormControl>
119+
</Template_InputFormControls>
120+
</wssuc:InputFormSection>
121+
80122

81123
<!-- Records Center Section -->
82124
<wssuc:InputFormSection

WBFWebParts/Layouts/WBFWebParts/WBFWebPartsConfig.aspx.cs

+19-11
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,38 @@ protected void Page_Load(object sender, EventArgs e)
1414
{
1515
WBFarm farm = WBFarm.Local;
1616

17+
SPSite site = SPContext.Current.Site;
18+
1719
RecordsLibraryToUse.DataSource = WBFWebPartsUtils.GetRecordsLibraryOptions();
1820
RecordsLibraryToUse.DataBind();
19-
RecordsLibraryToUse.WBxSafeSetSelectedValue(WBFWebPartsUtils.GetRecordsLibraryToUse(SPContext.Current.Site));
21+
RecordsLibraryToUse.WBxSafeSetSelectedValue(WBFWebPartsUtils.GetRecordsLibraryToUse(site));
22+
LocalPublicLibraryURL.Text = WBFWebPartsUtils.GetLocalPublicLibraryURL(site);
2023

21-
UseExtranetLibrary.Checked = WBFWebPartsUtils.UseExtranetLibrary(SPContext.Current.Site);
24+
UseExtranetLibrary.Checked = WBFWebPartsUtils.UseExtranetLibrary(site);
25+
LocalExtranetLibraryURL.Text = WBFWebPartsUtils.GetLocalExtranetLibraryURL(site);
2226

23-
ShowFileIcons.Checked = WBFWebPartsUtils.ShowFileIcons(SPContext.Current.Site);
24-
ShowKBFileSize.Checked = WBFWebPartsUtils.ShowKBFileSize(SPContext.Current.Site);
25-
ShowDescription.Checked = WBFWebPartsUtils.ShowDescription(SPContext.Current.Site);
27+
ShowFileIcons.Checked = WBFWebPartsUtils.ShowFileIcons(site);
28+
ShowKBFileSize.Checked = WBFWebPartsUtils.ShowKBFileSize(site);
29+
ShowDescription.Checked = WBFWebPartsUtils.ShowDescription(site);
2630
}
2731
}
2832

2933

3034
protected void okButton_OnClick(object sender, EventArgs e)
3135
{
32-
WBFWebPartsUtils.SetRecordsLibraryToUse(SPContext.Current.Site, RecordsLibraryToUse.SelectedValue);
36+
SPSite site = SPContext.Current.Site;
37+
38+
WBFWebPartsUtils.SetRecordsLibraryToUse(site, RecordsLibraryToUse.SelectedValue);
39+
WBFWebPartsUtils.SetLocalPublicLibraryURL(site, LocalPublicLibraryURL.Text);
3340

34-
WBFWebPartsUtils.SetUseExtranetLibrary(SPContext.Current.Site, UseExtranetLibrary.Checked);
41+
WBFWebPartsUtils.SetUseExtranetLibrary(site, UseExtranetLibrary.Checked);
42+
WBFWebPartsUtils.SetLocalExtranetLibraryURL(site, LocalExtranetLibraryURL.Text);
3543

36-
WBFWebPartsUtils.SetShowFileIcons(SPContext.Current.Site, ShowFileIcons.Checked);
37-
WBFWebPartsUtils.SetShowKBFileSize(SPContext.Current.Site, ShowKBFileSize.Checked);
38-
WBFWebPartsUtils.SetShowDescription(SPContext.Current.Site, ShowDescription.Checked);
44+
WBFWebPartsUtils.SetShowFileIcons(site, ShowFileIcons.Checked);
45+
WBFWebPartsUtils.SetShowKBFileSize(site, ShowKBFileSize.Checked);
46+
WBFWebPartsUtils.SetShowDescription(site, ShowDescription.Checked);
3947

40-
SPContext.Current.Site.RootWeb.Update();
48+
site.RootWeb.Update();
4149

4250
SPUtility.Redirect("settings.aspx", SPRedirectFlags.RelativeToLayoutsPage, Context);
4351
}

WBFWebParts/Layouts/WBFWebParts/WBFWebPartsConfig.aspx.designer.cs

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WBFWebParts/Package/Package.package

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="b32a8c64-fa93-454a-a541-2ac4abe02186" solutionId="b32a8c64-fa93-454a-a541-2ac4abe02186" resetWebServer="false" name="WBFWebParts v0.9.6u" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/PackageModel">
3-
<assemblies>
4-
<projectOutputAssembly location="WorkBoxFramework.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\WorkBoxFramework\WorkBoxFramework.csproj" />
5-
</assemblies>
63
<features>
74
<featureReference itemId="17e13b5d-3985-408c-857c-e8bdd63eb727" />
85
<featureReference itemId="29136b9c-a30c-498d-bc1f-1b0def8b1b68" />
96
<featureReference itemId="2cc6f326-8b92-41ee-b29d-d7c0dc4a51f4" />
7+
<featureReference itemId="21cc6075-b136-42a4-9691-0f91ae71a1fa" />
108
</features>
119
<projectItems>
1210
<projectItemReference itemId="9752ad71-1af0-4f62-9dfd-5c615c4b5776" />
1311
<projectItemReference itemId="51d75317-6203-4bd4-9b34-ded752d680bb" />
1412
<projectItemReference itemId="26b0455b-a541-4030-824c-b296337f028a" />
13+
<projectItemReference itemId="67cd90ac-9fa7-4324-baa3-42baa2157d2b" />
1514
</projectItems>
1615
</package>

0 commit comments

Comments
 (0)