Skip to content

Commit

Permalink
Version 0.1.2.0: Merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
olemp committed Feb 4, 2016
1 parent 7f7f769 commit ba5a92c
Show file tree
Hide file tree
Showing 12 changed files with 374 additions and 183 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-sites-core",
"version": "0.1.0.0",
"version": "0.1.2.0",
"homepage": "https://github.com/olemp/js-sites-core",
"authors": [
"olemp <[email protected]>",
Expand Down
222 changes: 139 additions & 83 deletions dist/pzl.sites.core.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/pzl.sites.core.min.js

Large diffs are not rendered by default.

59 changes: 56 additions & 3 deletions dist/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ QuickLaunchEnabled|boolean|The QuickLaunchEnabled attribute of the WebSettings

###PropertyBagEntries
```json
"PropertyBagEntries": {}
"PropertyBagEntries": []
```

An Object of key value pairs
Attibute|Type|Description
--------|----|-----------
PropertyBagEntries|Array<[PropertyBagEntry](#propertybagentry)>|The PropertyBagEntries entries of the PropertyBagEntries, optional collection of elements



Expand Down Expand Up @@ -166,6 +168,20 @@ Defines a ListInstance element
"Description": "",
"Url": "",
"TemplateType": 000,
"EnableVersioning": false,
"EnableMinorVersions": false,
"EnableModeration": false,
"EnableFolderCreation": false,
"EnableAttachments": false,
"RemoveExistingContentTypes": false,
"NoCrawl": false,
"DefaultDisplayFormUrl": "",
"DefaultEditFormUrl": "",
"DefaultNewFormUrl": "",
"DraftVersionVisibility": "",
"ImageUrl": "",
"Hidden": false,
"ForceCheckout": false,
"Folders": [],
"ContentTypeBindings": [],
"FieldRefs": [],
Expand All @@ -182,6 +198,20 @@ Title|string|The Title of the List Instance, required attribute
Description|string|The Description of the List Instance, optional attribute
TemplateType|number|The TemplateType of the List Instance, required attribute Values available here: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.listtemplatetype.aspx
Url|string|The Url of the List Instance, required attribute
EnableVersioning|boolean|The EnableVersioning of the List Instance, optional attribute
EnableMinorVersions|boolean|The EnableMinorVersions of the List Instance, optional attribute
EnableModeration|boolean|The EnableModeration of the List Instance, optional attribute
EnableFolderCreation|boolean|The EnableFolderCreation of the List Instance, optional attribute
EnableAttachments|boolean|The EnableAttachments of the List Instance, optional attribute
RemoveExistingContentTypes|boolean|The RemoveExistingContentTypes of the List Instance, optional attribute
NoCrawl|boolean|The NoCrawl of the List Instance, optional attribute|
DefaultDisplayFormUrl|string|The DefaultDisplayFormUrl of the List Instance, optional attribute
DefaultEditFormUrl|string|The DefaultEditFormUrl of the List Instance, optional attribute
DefaultNewFormUrl|string|The DefaultNewFormUrl of the List Instance, optional attribute
DraftVersionVisibility|string|The DraftVersionVisibility of the List Instance, optional attribute
ImageUrl|string|The ImageUrl of the List Instance, optional attribute
Hidden|boolean|The Hidden of the List Instance, optional attribute
ForceCheckout|boolean|The ForceCheckout of the List Instance, optional attribute
RemoveExistingContentTypes|boolean|The RemoveExistingContentTypes of the List Instance, optional attribute
ContentTypeBindings|Array<[ContentTypeBinding](#contenttypebinding)>|The ContentTypeBindings entries of the List Instance, optional collection of elements
FieldRefs|Array<[FieldRef](#listinstancefieldref)>|The ContentTypeBindings entries of the List Instance, optional collection of elements
Expand Down Expand Up @@ -510,4 +540,27 @@ Defines a Field element

All properties for SP.Field are supported.

https://msdn.microsoft.com/en-us/library/office/aa979575.aspx
<<<<<<< HEAD
https://msdn.microsoft.com/en-us/library/office/aa979575.aspx
=======
https://msdn.microsoft.com/en-us/library/office/aa979575.aspx


##PropertyBagEntry
Defines a PropertyBagEntry element

```json
{
"Key": "",
"Value": "",
"Indexed": true
}
```


Attibute|Type|Description
--------|----|-----------
Key|string|The Key of the PropertyBagEntry, required attribute
Value|string|The Value of the PropertyBagEntry, required attribute
Indexed|boolean|The Indexed of the PropertyBagEntry, optional attribute
>>>>>>> dev
3 changes: 2 additions & 1 deletion src/build.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tsc --out ..\dist\pzl.sites.core.js .\pzl.sites.core.ts --removeComments
uglifyjs --output ..\dist\pzl.sites.core.min.js -- ..\dist\pzl.sites.core.js
uglifyjs --output ..\dist\pzl.sites.core.min.js -- ..\dist\pzl.sites.core.js
explorer.exe ..\dist
178 changes: 108 additions & 70 deletions src/objecthandlers/Lists.ts

Large diffs are not rendered by default.

52 changes: 37 additions & 15 deletions src/objecthandlers/PropertyBagEntries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,60 @@
/// <reference path="..\model\ObjectHandlerBase.ts" />
/// <reference path="..\pzl.sites.core.d.ts" />
/// <reference path="..\resources\pzl.sites.core.resources.ts" />
/// <reference path="..\schema\IPropertyBagEntry.ts" />

module Pzl.Sites.Core.ObjectHandlers {
module Pzl.Sites.Core.ObjectHandlers {
function EncodePropertyKey(propKey) {
var bytes = [];
for (var i = 0; i < propKey.length; ++i) {
bytes.push(propKey.charCodeAt(i));
bytes.push(0);
}
var b64encoded = window.btoa(String.fromCharCode.apply(null, bytes));
return b64encoded;
}
export class PropertyBagEntries extends Model.ObjectHandlerBase {
constructor() {
super("PropertyBagEntries")
}
ProvisionObjects(object : Object) {
ProvisionObjects(objects: Array<Schema.IPropertyBagEntry>) {
Core.Log.Information(this.name, Resources.Code_execution_started);
var def = jQuery.Deferred();

var def = jQuery.Deferred();
var clientContext = SP.ClientContext.get_current();
var web = clientContext.get_web();
var web = clientContext.get_web();
var allProperties = web.get_allProperties();

for(var key in object) {
Core.Log.Information(this.name, String.format(Resources.PropertyBagEntries_setting_propety, key, object[key]));
allProperties.set_item(key, object[key]);
}

var indexedProperties = [];

objects.forEach(o => {
Core.Log.Information(this.name, String.format(Resources.PropertyBagEntries_setting_property, o.Key, o.Value));
allProperties.set_item(o.Key, o.Value);
if(o.Indexed) {
Core.Log.Information(this.name, String.format(Resources.PropertyBagEntries_setting_indexed_property, o.Key));
indexedProperties.push(EncodePropertyKey(o.Key));
}
});

web.update();
clientContext.load(allProperties);
clientContext.executeQueryAsync(
() => {
Core.Log.Information(this.name, Resources.Code_execution_ended);
def.resolve();
if(indexedProperties.length > 0) {
allProperties.set_item("vti_indexedpropertykeys", indexedProperties.join("|"));
web.update();
clientContext.executeQueryAsync(def.resolve, def.resolve);
} else {
Core.Log.Information(this.name, Resources.Code_execution_ended);
def.resolve();
}
},
(sender, args) => {
Core.Log.Information(this.name, Resources.Code_execution_ended);
def.resolve(sender, args);
}
)

return def.promise();
}
}
}
}
2 changes: 1 addition & 1 deletion src/pzl.sites.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module Pzl.Sites.Core {
export function UpdateProgress(index:number, name:string) {
if(!options.WaitMessage) return;
if(!options.WaitMessage.ShowProgress === true) return;
var progress = ((index)/queueItems.length)*100;
var progress = Math.floor(((index)/queueItems.length)*100);
var text = options.WaitMessage.ProgressOverrides ? (options.WaitMessage.ProgressOverrides[name] || name) : name;
document.getElementById(Resources.Provisioning_progressbar_id).innerHTML = String.format(Resources.Provisioning_progressbar_markup, progress);
document.getElementById(Resources.Provisioning_progressbar_text_id).innerHTML = text;
Expand Down
7 changes: 5 additions & 2 deletions src/resources/pzl.sites.core.resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Pzl.Sites.Core.Resources {
export var Lists_list_already_exists = "A list with the specified title {0} already exists in this Web site at Url {1}";
export var Lists_creating_list = "Creating list with title {0} at Url {1}";
export var Lists_creating_folder = "Creating folder {0}";
export var Lists_setting_default_value_for_folder = "Setting default value '{0}' = '{1}' for folder '{2}'";
export var Lists_setting_default_metadata = "Setting default metadata for folder {0}";
export var Lists_enabled_content_types = "Enabled content types for list {0}";
export var Lists_removing_content_type = "Removing content type {0} from list {1}";
Expand All @@ -22,7 +23,8 @@ module Pzl.Sites.Core.Resources {
export var Lists_adding_list_view = "Adding view {0} for list {1}";
export var Lists_adding_eventreceiver = "Adding eventreceiver {0} to list {1}";
export var Lists_adding_field_ref = "Adding field {0} to list {1}";
export var Lists_adding_field = "Adding field '{0}' to list '{1}'";
export var Lists_adding_field = "Adding {0} field '{1}' to list '{2}'";
export var Lists_invalid_lookup_field = "The lookup field '{0}' for list '{1}' is invalid";
export var Lists_inserting_data_row = "Adding data row {0} of {1} to list '{2}'";
export var WebSettings_setting_welcomePage = "Setting welcome page to {0}";
export var WebSettings_setting_alternateCssUrl = "Setting alternate css url to {0}";
Expand All @@ -32,7 +34,8 @@ module Pzl.Sites.Core.Resources {
export var WebSettings_setting_quickLaunchEnabled = "Setting quicklaunch enabled to {0}";
export var WebSettings_setting_recycleBinEnabled= "Setting recyclebin enabled to {0}";
export var WebSettings_setting_treeViewEnabled = "Setting treeview enabled to {0}";
export var PropertyBagEntries_setting_propety = "Setting property '{0}' = '{1}' on web";
export var PropertyBagEntries_setting_property = "Setting property '{0}' = '{1}' on web";
export var PropertyBagEntries_setting_indexed_property = "Setting property '{0}' as indexed";
export var Pages_creating_page = "Creating wiki page with Url {0}";
export var Pages_creating_page_failed = "Failed to create wiki page with Url {0}";
export var Navigation_setting_shared = "Setting useShared to {0}";
Expand Down
2 changes: 2 additions & 0 deletions src/schema/IField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ module Pzl.Sites.Core.Schema {
TypeShortDescription: string;
ValidationFormula: string;
ValidationMessage: string;
Type: string;
Formula: string;
}
}
19 changes: 14 additions & 5 deletions src/schema/IListInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ module Pzl.Sites.Core.Schema {
Url: string;
Description: string,
DocumentTemplate: string;
OnQuickLaunch: Boolean;
OnQuickLaunch: boolean;
TemplateType: number;
EnableVersioning: Boolean;
MinorVersionLimit: number;
MaxVersionLimit: number;
DraftVersionVisibility: number;
EnableVersioning: boolean;
EnableMinorVersions: boolean;
EnableModeration: boolean;
EnableFolderCreation: boolean;
EnableAttachments: boolean;
RemoveExistingContentTypes: boolean;
NoCrawl: boolean;
DefaultDisplayFormUrl: string;
DefaultEditFormUrl: string;
DefaultNewFormUrl: string;
DraftVersionVisibility: string;
ImageUrl: string;
Hidden: boolean;
ForceCheckout: boolean;
ContentTypeBindings: Array<IContentTypeBinding>;
FieldRefs: Array<IListInstanceFieldRef>;
Fields: Array<IField>;
Expand Down
7 changes: 7 additions & 0 deletions src/schema/IPropertyBagEntry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Pzl.Sites.Core.Schema {
export interface IPropertyBagEntry {
Key: string;
Value: string;
Indexed: boolean;
}
}

0 comments on commit ba5a92c

Please sign in to comment.