Did you know the Government is proposing an internet censorship scheme that goes further than any other democracy in the world?
I've just signed a petition to prevent the scheme that will make the internet up to 87% slower, more expensive, accidentally block up to one in 12 legitimate sites, will miss the vast majority of inappropriate content and is very easily sidestepped. The government of the day may add any 'unwanted' site to a secret blacklist under the scheme.
Our Government should be doing all in its power to take Australia into the 21st century economy, and to protect our children. This proposed internet censorship does neither. Can you join me and take action on the net today to save the net?
http://www.getup.org.au/campaign/SaveTheNet/442
Thanks!
Not sure which port you should not use?
Check out IANA http://www.iana.org/assignments/port-numbers
Reviews come down to personal opinions. So in order to know whether the reviewer’s opinion will
resonate with you it’s important to know what the reviewer likes and dislikes,
and how he/she thinks.
Scoring:
I will never give out a 100 point score because that means it could not be
improved on. Anything above 50 points should be considered good and anything
below it not good.
Above 60 is very good.
70’s are really recommended.
80’s are exceptional and rare.
90’s and you’re in the region of the elite. A 90 score can only be given by
somebody who has had decades experience with 80’s. I can give a movie/gadget/game
a 90 score, but I can’t give out 90’s for Scotch.
My taste:
I like warm happy sweet things, with a side of extreme. I like full bodied Shiraz
or Grenache, with a particular preference for South Australia’s Barossa and
some Rioja baja . I don’t like white wines.
I like a steak that’s been cooked on a hot BBQ pink in the middle with a taste
of either garlic or wood smoke. I like grilled fish salted on the skin. I like
a blue brie cheese. I like a rich chocolate ice cream.
I avoid
anything marked as light or diet, low in something, I want full flavor or
nothing.
I don’t like bitter or liquorish tastes. But I like grape fruit, lemons and
limes.
What I look for in a Scotch:
When I drink Scotch, I’m looking for a sweet smoky scent. I want a peaty smoky
sweet creamy taste. I want the flavor to linger. I want the empty glass to emanate
the essence of the Scotch. I want the effect of the alcohol to lift my spirits and of
those around me. The next day I want a clear head with zero body load; so I don’t
want the Scotch to remind me of it presence. I don't mix the SCotch with water or ice, I use my saliva to dilute if required ratio of 1:3... and sip it slowly.
Event ID: 6398 6482 7076
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I read a lot of posts saying this was caused by SharePoint and fixed with SP1, and/or an issues with .net 2.0 fixed with .net 2.1. Both are incorrect for my scenario; my servers were completely up to date and all of a sudden I started getting these errors. I also read that restarting the Services Timer would resolve the issue. All of these are incorrect. The issue is caused by IIS (Adsiis.dll & Wadsiis.dll) and >2 AD users trying to access the same process. None of my dev machines have exhibited these errors because none use AD accounts.
Fix: http://support.microsoft.com/kb/946517/en-us
Sounds easy enough, but it wasn't immediately obvious.
The below creates a list, adds a Rich Text field with full HTML and adds it to the default view.
27 SPWeb oWeb = null;
28 oWeb = oSite.RootWeb;
29 Guid gList;
30 SPList oList = null;
31 gList = oWeb.Lists.Add("My List", "Some description", SPListTemplateType.GenericList);
32 oWeb.Update();
33 oList = oWeb.Lists[gList];
34 SPFieldMultiLineText oFldBody = (SPFieldMultiLineText)oList.Fields[oList.Fields.Add("Body", SPFieldType.Note, true)];
35 oFldBody.Description = "Replaceable Parameters: {password}, {userid}, {usergroups}, {usersite}, {siteadmin}";
36 oFldBody.RichText = true;
37 oFldBody.RichTextMode = SPRichTextMode.FullHtml;
38 oFldBody.Update();
39 oList.Update();
40
41 SPView oView = oList.DefaultView;
42 SPViewFieldCollection oViewFields = oView.ViewFields;
43 oViewFields.Add(oFldBody);
44 oView.Update();
There doesn't seem to be any OOTB solution to copy list items to > 1 other site... so I wrote a quick aspx page and added it to a feature/solution which I would like to share with you.
The APX page just loops through the Web collection and checks for the list and if it's available enables a checkbox so you can copy the item.
The feature adds a context menu to a list item with a link to the page.
There's nothing compiled so it's easy to edit (just open the solution file).
Feature link: Download
To Do: Optimize sorting DataView/DataTable, add Doc Library support, add a FeatureActivated/Deactivated to add ASPX page to sitemap, add option to create list if it doesn't exist and change to a dll/code behind.
Keywords: SPGridView, SPList, SPListItem, Copy, Add, Deploy, Feature, context menu.
Notes: I haven't tested this in a production environment
Screenshots:
Sometimes you need to filter data (ListViews/DataViews/Other web parts) based on some criteria be it the persons name, their email, a specific date range or from a parameter.
Microsoft provide a number of these Web Parts called filters. The problem is they only provide these in the Enterpri$e ver$ion.
So I made my own and I'm sharing them with you....
ray1.net Web Part Filters feature is comprised of 6 web parts.
- ray1.net Content Connector. This is a simple Literal Control that renders the value of a connection, or the text you specify. You can use it with, say the UserFilter and render some text that says "Welcome to my site UserFilter value!"
- ray1.net Filter Web Part: Current Page. This web part provides a filter connection that send information about the current page. The page needs to be in a list. You can use this to filter content based on who created the page or the file size or the modified date.
- ray1.net Filter Web Part: Date. This web part provides a filter connection that sends information about a selected date or date range. Say you had a DataView web part that sent a parameter to an SQL stored procedure.
- ray1.net Filter Web Part: QueryString. This filter accepts a QueryString parameter and connects to another web part. Pretty simple really, name the filter the same as the querystring parameter and your done.
- ray1.net Filter Web Part: User Name. This web part provides a User Name connection filter. This web part makes this feature incompatible with WSS v3, as I use the "Microsoft.Office.Server.UserProfiles.UserProfileManager" class.
- ray1.net Filter Web Part: Web ID. This web part provides a filter connection that sends the Web ID. Another simple one, but useful... Say you have a bunch of sites using the same template and you wanted to filter an SQL query.
All the filters accept multiple connections, and this is what they look like in edit mode.
This is what they look like normally
Download link: ray1.net Web Part Filters
To do: I could add a Text Filter and maybe change the Content Connector to accept n number of connections.
Keywords: Filter, web part, listview, SPSlicerBaseWebPart, ToolPart, IWebPartField, GetConnectionInterface, Connection Consumer Provider
If you have Report Server running in a virtual directory under a SharePoint web app.
Error: The type Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c does not implement IReportViewerMessages or could not be found.
Cause: Look in your SharePoint web.config file you'll see <add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />.
Fix: I looked at the Microsoft.SharePoint.Portal.Analytics Namespace and couldn't find a UI.ReportViewerMessages, so I just removed it from the web.config and I haven't experienced any issues.
You can also remove the setting from your ReportServer web.config's just add:
<appSettings>
<remove key="ReportViewerMessages" />
</appSettings>
This also applies to the error message: Microsoft.ReportingServices.UI.Global+RSWebServiceWrapper+CantCommunicateWithReportServerException: The report server is not responding. Verify that the report server is running and can be accessed from this computer.
This took me a little while to figure out, but my initial suspicion was that it was related to the fact I was using it in a Host Header site, ei: I had changed lmhosts or I had multiple web sites using port 80.
Cause:
Report server uses the machine name when setting the config files, but when it tries to reference the url it can't be found because it's in another web site.
In my case the server was called MOSSDEV, and the report server virtual directories were in a web site called premisys.
Fix:
- Open "RSWebApplication.config" in the "Report Manager Virtual Directory".
Right click the virtual directory icon in inetmgr, choose open.
Default is: C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager
- Enter the full Report Server URL in the <ReportServerUrl> node.
Eg:
<ReportServerUrl>http://premisys/ReportServer</ReportServerUrl>
- Delete the <ReportServerVirtualDirectory> value but not the node.
- Open "rsreportserver.config" in the "Report Server Virtual Directory".
Default is: C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer
- Change the <urlroot>http://<servername>/ReportServer</urlroot>
to match your URL.
There are a couple ways of doing this.
- Modify ..\12\TEMPLATE\FEATURES\ContentLightup\Controls\searchArea.xml
- Modify ..\12\TEMPLATE\CONTROLTEMPLATES\searcharea.ascx
- Create a new feature and control
- Create a new feature that changes parameters for "SmallSearchInputBox"
I believe option 4 to be the best as it uses Microsoft.SharePoint.PortalWebControls.SearchBoxEx class and you don't need to create a new control.
There are a large number of properties you can use to customize the control and you should find the one you're looking for
microsoft.sharepoint.portal.webcontrols.searchboxex_properties.
So how do we customize it?
Create a new feature.
- Create a new directory anywhere eg: C:\RPSearchFeature
- Create a new manifest.xml in C:\RPSearchFeature with the following:
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SolutionId="GENERATE_A_GUID"
ResetWebServer="True"
xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests>
<FeatureManifest Location="PortalSearch\feature.xml" />
</FeatureManifests>
</Solution>
- Create "C:\RPSearchFeature\PortalSearch\feature.xml" with:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="7095f774-1efa-4879-b074-ff211f5559c7"
Title="Small Portal Search"
Description="Smaller search bar without scopes"
Version="12.0.0.0"
Hidden="FALSE"
Scope="Web"
DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>
- Create "C:\RPSearchFeature\PortalSearch\elements.xml" with:
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control
Id="SmallSearchInputBox"
Sequence="25"
ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx"
ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Property Name="SearchResultPageURL">/search/results.aspx</Property>
<Property Name="FrameType">None</Property>
<Property Name="DropDownMode">HideDD_NoScope</Property>
<Property Name="TextBoxWidth">140</Property>
<Property Name="ShowAdvancedSearch">false</Property>
</Control>
</Elements>
-
Wrap the feature up in to a solution "SearchFeature.wsp" with cabpack
-
Deploy the solution.
-
Enable the feature (Scope is web, but you can change it to site if that suits you).
The instruction that will enable these parameters over the default is the sequence number. The default sequence is 99, so anything below 99 will load first. The parameters I'm using set the "SearchResultPageURL", hide the scope drop down and remove the advance search link.
After adding the Reports Services virtual directories to a sharepoint site/web application you see the below in the event log.
Event Type: Error
Event Source: Office SharePoint Server
Event Category: Publishing Cache
Event ID: 5785
Date: 21/05/2008
Time: 3:01:52 PM
User: N/A
Computer:
Description:
Unable to connect publishing custom string handler for output caching. IIS Instance Id is '1957155781', Url is 'http://localhost/ReportServer/ReportService2005.asmx'.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Cause: microsoft.sharepoint.publishing.publishinghttpmodule is trying to cache an unmanaged path.
Fix: Remove this httpmodule from the ./ReportServer virtual directory web.config.
Steps:
- Open the web.config file (D:\Program Files\Microsoft SQL Server\MSSQL.1\Reporting Services\ReportServer\web.config)
- Locate the <httpModules> node, if it's not there create it below the <httpHandlers> node.
- Add the following <remove name="PublishingHttpModule" />.
Everytime you call a report or the reportserver URL/web service SharePoint tries to turn caching on and it's not a managed path it throws an error, so we need to remove the module in the reportserver.
I watched the extended version of Mr. Nobody the other night. I thought director Jaco Van Dormael did a fantastic job with the great attention to detail. Jared Leto was good too.
Mr. Nobody
imdb.com
I watched an entertaining movie with Christian Slater the other day I feel is worth a mention...
He Was a Quiet Man
imdb.com
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10016
Date: 27/04/2008
Time: 9:35:28 AM
User: VMDomain\SPConfigAcct
Computer: VMDEV
Description:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{61738644-F196-11D0-9953-00C04FD919C1}
to the user VMDomain\SPConfigAcct SID (S-1-5-21-2183741768-1351022156-4028051374-1111). This security permission can be modified using the Component Services administrative tool.
The event kind of tells you how to fix it: "This security permission can be modified using the Component Services administrative tool".
But first we need to figure out what 61738644-F196-11D0-9953-00C04FD919C1 is;
Win + R > regedit > search = IIS WAMREG admin Service
- Win + R C:\WINDOWS\system32\Com\comexp.msc
- Expand Component Services > Computers > My Comp > DCOM Config
- Right Click IIS WAMREG admin Service
- Select Properties > Security
- Launch and Activation Permissions "Customize" > Edit
- You need to grant the "user" rights.
- My user is a SharePoint Config account and as such belongs to the IIS_WPG group, but is also the sole member of WSS_RESTRICTED_WPG group so using the safest security I'm going to use WSS_RESTRICTED_WPG until more errors appear.
Because it's not going to need to lauch or activate remotely I just need to enable "Local".
THE MIRACLE OF TOILET PAPER Fresh from my shower, I stood in front of the mirror complaining to my husband that my breasts are too small. Instead of romantically telling me this is not true, he uncharacteristically comes up with a suggestion: 'If you want your breasts to grow, then take a piece of toilet paper and rub it between them for a few seconds every day' Willing to try anything, I got a piece of toilet paper and stood in front of the mirror, rubbing it between my breasts. How long will this take?' I asked. They will grow larger over a period of years,' my husband replies. I stopped. 'Do you really think rubbing a piece of toilet paper between my breasts every day will make my breasts larger over the years?' Without missing a beat he said 'Worked for your bum, didn't it?' He's still alive, and with a great deal of therapy, he may even walk again although he will probably continue to take his meals through a straw.
I was recently tasked with resolving a date issue for a Global Portal. People outside the US were complaining about the date format (MM/DD/YYYY)... I've long been a proponent of ISO dates (YYYY-MM-DD) and 28 day months... OK maybe 28 day months wouldn't be so fun for savants to calculate.
Anyway the solution was obviously to include the month name. My first reaction was to change FLDTYPES.xml, then to create a custom field type, and finally it soon became obvious a calculated field should do the trick.
So I searched a minute for a formula to render the date with the month name in the middle... I didn't find any so I created it.
It is a piece of cake to do it in VB and C#, but what does a calculated field provide? As it turns out quite a lot. Everybody knows your classic [Today], LTrim, etc... but what I didn't know it that it supports a lot of Excel functions (not the VBA ones).
Before we get to the list of functions, here's how to write the month name formula:
=TEXT([DateField],"dd") &"/"& TEXT([DateField],"mmm") &"/"& TEXT([DateField],"yyyy")
or
=DAY([DateField]) &"/"& TEXT([DateField],"mmm") &"/"& YEAR([DateField])
or better
=IF(NOT(ISBLANK([DateField])),DAY([DateField])&" "&TEXT([DateField],"mmm")&" "&YEAR([DateField]),"")
Now here's probably what your here for, a list of SharePoint Calculated Field/Column functions:
source (http://office.microsoft.com/en-us/excel/HP100791861033.aspx)
Date and time functions
Function | Description |
DATE | Returns the serial number of a particular date |
DATEVALUE | Converts a date in the form of text to a serial number |
DAY | Converts a serial number to a day of the month |
DAYS360 | Calculates the number of days between two dates based on a 360-day year |
EDATE | Returns the serial number of the date that is the indicated number of months before or after the start date |
EOMONTH | Returns the serial number of the last day of the month before or after a specified number of months |
HOUR | Converts a serial number to an hour |
MINUTE | Converts a serial number to a minute |
MONTH | Converts a serial number to a month |
NETWORKDAYS | Returns the number of whole workdays between two dates |
NOW | Returns the serial number of the current date and time |
SECOND | Converts a serial number to a second |
TIME | Returns the serial number of a particular time |
TIMEVALUE | Converts a time in the form of text to a serial number |
TODAY | Returns the serial number of today's date |
WEEKDAY | Converts a serial number to a day of the week |
WEEKNUM | Converts a serial number to a number representing where the week falls numerically with a year |
WORKDAY | Returns the serial number of the date before or after a specified number of workdays |
YEAR | Converts a serial number to a year |
YEARFRAC | Returns the year fraction representing the number of whole days between start_date and end_date |
Information functions
Function | Description |
CELL | Returns information about the formatting, location, or contents of a cell |
ERROR.TYPE | Returns a number corresponding to an error type |
INFO | Returns information about the current operating environment |
ISBLANK | Returns TRUE if the value is blank |
ISERR | Returns TRUE if the value is any error value except #N/A |
ISERROR | Returns TRUE if the value is any error value |
ISEVEN | Returns TRUE if the number is even |
ISLOGICAL | Returns TRUE if the value is a logical value |
ISNA | Returns TRUE if the value is the #N/A error value |
ISNONTEXT | Returns TRUE if the value is not text |
ISNUMBER | Returns TRUE if the value is a number |
ISODD | Returns TRUE if the number is odd |
ISREF | Returns TRUE if the value is a reference |
ISTEXT | Returns TRUE if the value is text |
N | Returns a value converted to a number |
NA | Returns the error value #N/A |
TYPE | Returns a number indicating the data type of a value |
Logical functions
Function | Description |
AND | Returns TRUE if all of its arguments are TRUE |
FALSE | Returns the logical value FALSE |
IF | Specifies a logical test to perform |
IFERROR | Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula |
NOT | Reverses the logic of its argument |
OR | Returns TRUE if any argument is TRUE |
TRUE | Returns the logical value TRUE |
Math and trigonometry functions
Function | Description |
ABS | Returns the absolute value of a number |
ACOS | Returns the arccosine of a number |
ACOSH | Returns the inverse hyperbolic cosine of a number |
ASIN | Returns the arcsine of a number |
ASINH | Returns the inverse hyperbolic sine of a number |
ATAN | Returns the arctangent of a number |
ATAN2 | Returns the arctangent from x- and y-coordinates |
ATANH | Returns the inverse hyperbolic tangent of a number |
CEILING | Rounds a number to the nearest integer or to the nearest multiple of significance |
COMBIN | Returns the number of combinations for a given number of objects |
COS | Returns the cosine of a number |
COSH | Returns the hyperbolic cosine of a number |
DEGREES | Converts radians to degrees |
EVEN | Rounds a number up to the nearest even integer |
EXP | Returns e raised to the power of a given number |
FACT | Returns the factorial of a number |
FACTDOUBLE | Returns the double factorial of a number |
FLOOR | Rounds a number down, toward zero |
GCD | Returns the greatest common divisor |
INT | Rounds a number down to the nearest integer |
LCM | Returns the least common multiple |
LN | Returns the natural logarithm of a number |
LOG | Returns the logarithm of a number to a specified base |
LOG10 | Returns the base-10 logarithm of a number |
MDETERM | Returns the matrix determinant of an array |
MINVERSE | Returns the matrix inverse of an array |
MMULT | Returns the matrix product of two arrays |
MOD | Returns the remainder from division |
MROUND | Returns a number rounded to the desired multiple |
MULTINOMIAL | Returns the multinomial of a set of numbers |
ODD | Rounds a number up to the nearest odd integer |
PI | Returns the value of pi |
POWER | Returns the result of a number raised to a power |
PRODUCT | Multiplies its arguments |
QUOTIENT | Returns the integer portion of a division |
RADIANS | Converts degrees to radians |
ROMAN | Converts an arabic numeral to roman, as text |
ROUND | Rounds a number to a specified number of digits |
ROUNDDOWN | Rounds a number down, toward zero |
ROUNDUP | Rounds a number up, away from zero |
SERIESSUM | Returns the sum of a power series based on the formula |
SIGN | Returns the sign of a number |
SIN | Returns the sine of the given angle |
SINH | Returns the hyperbolic sine of a number |
SQRT | Returns a positive square root |
SQRTPI | Returns the square root of (number * pi) |
SUBTOTAL | Returns a subtotal in a list or database |
SUM | Adds its arguments |
SUMIF | Adds the cells specified by a given criteria |
SUMIFS | Adds the cells in a range that meet multiple criteria |
SUMPRODUCT | Returns the sum of the products of corresponding array components |
SUMSQ | Returns the sum of the squares of the arguments |
SUMX2MY2 | Returns the sum of the difference of squares of corresponding values in two arrays |
SUMX2PY2 | Returns the sum of the sum of squares of corresponding values in two arrays |
SUMXMY2 | Returns the sum of squares of differences of corresponding values in two arrays |
TAN | Returns the tangent of a number |
TANH | Returns the hyperbolic tangent of a number |
TRUNC | Truncates a number to an integer |
Statistical functions
Function | Description |
AVEDEV | Returns the average of the absolute deviations of data points from their mean |
AVERAGE | Returns the average of its arguments |
AVERAGEA | Returns the average of its arguments, including numbers, text, and logical values |
AVERAGEIF | Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria |
AVERAGEIFS | Returns the average (arithmetic mean) of all cells that meet multiple criteria. |
BETADIST | Returns the beta cumulative distribution function |
BETAINV | Returns the inverse of the cumulative distribution function for a specified beta distribution |
BINOMDIST | Returns the individual term binomial distribution probability |
CHIDIST | Returns the one-tailed probability of the chi-squared distribution |
CHIINV | Returns the inverse of the one-tailed probability of the chi-squared distribution |
CHITEST | Returns the test for independence |
CONFIDENCE | Returns the confidence interval for a population mean |
CORREL | Returns the correlation coefficient between two data sets |
COUNT | Counts how many numbers are in the list of arguments |
COUNTA | Counts how many values are in the list of arguments |
COUNTBLANK | Counts the number of blank cells within a range |
COUNTIF | Counts the number of cells within a range that meet the given criteria |
COUNTIFS | Counts the number of cells within a range that meet multiple criteria |
COVAR | Returns covariance, the average of the products of paired deviations |
CRITBINOM | Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value |
DEVSQ | Returns the sum of squares of deviations |
EXPONDIST | Returns the exponential distribution |
FDIST | Returns the F probability distribution |
FINV | Returns the inverse of the F probability distribution |
FISHER | Returns the Fisher transformation |
FISHERINV | Returns the inverse of the Fisher transformation |
FORECAST | Returns a value along a linear trend |
FREQUENCY | Returns a frequency distribution as a vertical array |
FTEST | Returns the result of an F-test |
GAMMADIST | Returns the gamma distribution |
GAMMAINV | Returns the inverse of the gamma cumulative distribution |
GAMMALN | Returns the natural logarithm of the gamma function, Γ(x) |
GEOMEAN | Returns the geometric mean |
GROWTH | Returns values along an exponential trend |
HARMEAN | Returns the harmonic mean |
HYPGEOMDIST | Returns the hypergeometric distribution |
INTERCEPT | Returns the intercept of the linear regression line |
KURT | Returns the kurtosis of a data set |
LARGE | Returns the k-th largest value in a data set |
LINEST | Returns the parameters of a linear trend |
LOGEST | Returns the parameters of an exponential trend |
LOGINV | Returns the inverse of the lognormal distribution |
LOGNORMDIST | Returns the cumulative lognormal distribution |
MAX | Returns the maximum value in a list of arguments |
MAXA | Returns the maximum value in a list of arguments, including numbers, text, and logical values |
MEDIAN | Returns the median of the given numbers |
MIN | Returns the minimum value in a list of arguments |
MINA | Returns the smallest value in a list of arguments, including numbers, text, and logical values |
MODE | Returns the most common value in a data set |
NEGBINOMDIST | Returns the negative binomial distribution |
NORMDIST | Returns the normal cumulative distribution |
NORMINV | Returns the inverse of the normal cumulative distribution |
NORMSDIST | Returns the standard normal cumulative distribution |
NORMSINV | Returns the inverse of the standard normal cumulative distribution |
PEARSON | Returns the Pearson product moment correlation coefficient |
PERCENTILE | Returns the k-th percentile of values in a range |
PERCENTRANK | Returns the percentage rank of a value in a data set |
PERMUT | Returns the number of permutations for a given number of objects |
POISSON | Returns the Poisson distribution |
PROB | Returns the probability that values in a range are between two limits |
QUARTILE | Returns the quartile of a data set |
RANK | Returns the rank of a number in a list of numbers |
RSQ | Returns the square of the Pearson product moment correlation coefficient |
SKEW | Returns the skewness of a distribution |
SLOPE | Returns the slope of the linear regression line |
SMALL | Returns the k-th smallest value in a data set |
STANDARDIZE | Returns a normalized value |
STDEV | Estimates standard deviation based on a sample |
STDEVA | Estimates standard deviation based on a sample, including numbers, text, and logical values |
STDEVP | Calculates standard deviation based on the entire population |
STDEVPA | Calculates standard deviation based on the entire population, including numbers, text, and logical values |
STEYX | Returns the standard error of the predicted y-value for each x in the regression |
TDIST | Returns the Student's t-distribution |
TINV | Returns the inverse of the Student's t-distribution |
TREND | Returns values along a linear trend |
TRIMMEAN | Returns the mean of the interior of a data set |
TTEST | Returns the probability associated with a Student's t-test |
VAR | Estimates variance based on a sample |
VARA | Estimates variance based on a sample, including numbers, text, and logical values |
VARP | Calculates variance based on the entire population |
VARPA | Calculates variance based on the entire population, including numbers, text, and logical values |
WEIBULL | Returns the Weibull distribution |
ZTEST | Returns the one-tailed probability-value of a z-test |
Text functions
Function | Description |
ASC | Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters |
CHAR | Returns the character specified by the code number |
CLEAN | Removes all nonprintable characters from text |
CODE | Returns a numeric code for the first character in a text string |
CONCATENATE | Joins several text items into one text item |
DOLLAR | Converts a number to text, using the $ (dollar) currency format |
EXACT | Checks to see if two text values are identical |
FIND, FINDB | Finds one text value within another (case-sensitive) |
FIXED | Formats a number as text with a fixed number of decimals |
JIS | Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters |
LEFT, LEFTB | Returns the leftmost characters from a text value |
LEN, LENB | Returns the number of characters in a text string |
LOWER | Converts text to lowercase |
MID, MIDB | Returns a specific number of characters from a text string starting at the position you specify |
PHONETIC | Extracts the phonetic (furigana) characters from a text string |
PROPER | Capitalizes the first letter in each word of a text value |
REPLACE, REPLACEB | Replaces characters within text |
REPT | Repeats text a given number of times |
RIGHT, RIGHTB | Returns the rightmost characters from a text value |
SEARCH, SEARCHB | Finds one text value within another (not case-sensitive) |
T | Converts its arguments to text |
TEXT | Formats a number and converts it to text |
TRIM | Removes spaces from text |
UPPER | Converts text to uppercase |
VALUE | Converts a text argument to a number |
We are
living in a period of rampant global inflation. Some may argue it’s been the
past 8 years of cheap money. I’m going to look at two crisis and give my brief
opinion on the cause… The credit crisis and agrarian commodity speculation or
as the media terms it “The Food Crisis”.
This all
started with the dotcom bust of April 2000, I was in the Dominican Republic watching it unfold on HBO; upon my return my portfolio had lost
85% of its value. I thought it best to just leave the money put and hope for an
up turn, but two weeks later my broker Suretrade.com sent me an email saying
they were closing international accounts and they would be sending me a check
for the balance… there’s a long story in that bubble and con game that was the
dotcom, but I’m here to rant about the fore mentioned ones.
Fast forward
to 2003 after Enron and WorldCom; there were more accounting cons behind the
scenes which lead to quick regulations. Greenspan's fed policies to stimulate the economy had made contract mortgage rates in the US hit an all time low of just
above 5%, which hadn’t been seen
since 1965.
What you
gona do if you want to make money the easy way?
Sell cheap money or asset backed loans (mortgages)! Because with almost free money you’d have to be plain stupid
no to want it. Take note "they" think the average person is only 1/2 stupid.
Now the people selling the mortgages had an incentive to sell; a commission for each
mortgage sold, and when your objective is to turn over as many contracts as possible you aren't going to perform a detailed check of who is borrowing
the money as this costs.
The pieces
of the puzzle so far:
- cheap
money
- incentive
to sell cheap money
Who’s
lending the money? Mostly banks, but the banks are doing some proper checks
before they lend, so how are all these mortgages being sold?
Here comes
the key stone… mortgage brokers not affiliated with banks are selling them and then
sending the mortgage contract to a “clearing” house where the mortgage amount
is evaluated at the prevailing increase rate for the area and cut up and mixed
with other cash assets and called a cash CDO (collaterised debt obligation).
Yup I know
you’ve heard of CDO’s, and yes the above is an over simplified view, but I’m
not going to go in to detail about CDO’s.
CDO’s are
now investment products I mean SIV's (Structured Investment Vehicles). But before you, I, your pension fund can invest in
these products (become note holders) they have to be risk rated (AAA, AA, A, BB, ...) by a rating agency. The problem is that CDO’s are complicated if not
close to impossible to model, so rating agencies basically went by what they
were told.
2005
everybody is happy; CDO’s have good return rates people who borrowed money have
seen their home values soar, people who want to borrow are being tempted by $0
down payments/deposits, stock markets are booming because the CDO yields are
good, money flowing… but as with EVERY pyramid schema the first ones in do
well, but it progressively gets worse, and towards the end of 2005 the pool of
people who could afford to borrow and hadn’t was dwindling.
House
prices had been over inflated in Europe, America and Australia by cheap money
and the incentive to sell mortgages. People stop being able to pay the
repayments after the bonus/intro rate changed and it all starts to crumble.
March 2007
banks started to realize that they were holding notes for CDO’s with ratings of
AA and even AAA comprised of sub prime mortgages on over inflated properties.
They
realized that they could lose big, and if they could lose, so could any other
institution who had bought the bad “eggs”. So the first thing they did was stop
buying from the hedge funds causing a couple of them to collapse under their
own crap, and second stop exchanging money with anyone who
may be holding bad eggs.
Who have
been the winners?
The people who bought a home in 2003 and sold in 2006.
The mortgage brokers.
But the real winners have been the hedge fund managers who put together the CDO’s and
sold them to your bank and pension fund, other funds, and then go out. And they
can’t be prosecuted for no following lending guidelines.
Who are
these hedge fund/asset managers?
If you’re a Christian you may think of them as the “Money Changers” or their
agents, if your Muslim “Sheitan” is probably an apt word, if you’re an
investment banker you know them as the “Super Elite”.
Basically they’re people who ask for your money so that they can make
you rich, and they take a cut of what they make. Yup, that’s it they gamble
with other peoples money. But the big ones won't bother with you for less than a couple million invested. With
that in mind, what are they to do when their latest scam or bubble pops? Find
another. Since we live in a capitalist system which demands perpetual profits
and higher yields… they saw an opportunity with commodities while they wait for carbon trading.
Did you
really buy that bullshit story about oil demand pushing prices up? Yeah me to…
but then I realized hey oil demand couldn’t have increased 110% in 4 years, and
oh look it really started taking off in 2006, and so did other commodities. I
know China is making more trinkets than ever and the dollar sank but the correlation
is there, it was the “investors”/"speculators"/"gamblers".
Now I hear
on CNN, CNBC, BBC, etc about the food crisis… global warming, China wants meat,
Indian’s getting fatter, Bio fuels, Australia’s drought… but not a single
mention of the primary cause, yes it’s the “speculators" again. Investors demand healthy
yields and hedge fund managers go looking for ways to get those yields.
If I have US$1,000,0000,000
and I can triple it in two weeks by buying rice futures… what should I do? Think
about the poor people, or think about that 2nd yacht to take my helicopter
and McLaren F1 to Cannes next spring?
If you
thought the WTO was for the good of man you went so far down the rabbit hole you
missed the exit. Its to give the “money changers” more control and force countries to import stuff they don't want (Korea, US hormone beef any one?).
Now with
the help of Forbes (http://www.forbes.com/2008/04/15/paulson-falcone-earners-biz-wall-cz_js_0416wallstreet_slide_2.html?thisSpeed=15000
) let’s see who the “Super Elite” are… yeah I know Bill Gates makes billions,
but that’s OK'ish cos you buy a product and he gives a lot of it away. I want to
look at the hedge fund managers that are causing rampant inflation and hunger
in poor countries.
- John Paulson
made US$3,300,000,000 last year shorting on the sub prime crisis he probably
helped cause. And look he's acquired Greenspan John Paulson Acquires an Alan Greenspan
- George Soros
made US$2, 400,000,000 I have mixed feelings about him.
- Philip Falcone
US$1,700,000,000 again betting people couldn’t pay back money they borrowed.
- Kenneth Griffin
US$1,500,000,000, 39 years old.
And the list goes on and on.
What
should society do?
The really sad truth is that we have made such a mess, any change is going to
be painful. If the banks and investors don’t get they’re returns the system is
going to start collapsing and that’s going to cause wide spread misery. I think
the governments need to reappropriate some funds or force internal investment, they could use the moral dynamic of "with power comes responsibilities"
- Regulate
investment options (what can and can't be gambled).
- Tax all
financial transactions, 1% internal and 3% external.
- Limit the size of institutions... it isn't a level playing field when you're competing with somebody 10000 times bigger than you!
The bankers
and super elite are going to squeal like pigs in a barn on fire, banks will
pass on any tax, and the investors won’t get such good returns but the rest will
benefit from a more stable financial system.
The other option
There is one other option which I can’t claim credit for, and that is the shock treatment of a “Fight Club” scenario… you know where they blow up all the financial buildings in one go… this would have to be effected by the military as there are numerous data centres in well fortified places; they could call it "Operation Financial Freedom" on second thought from experience I'm not sure I agree with military use of the word freedom. We could let the “bankers” rebuild their financial assets from their tax records…that would be soooo funny.
Any good? There is
one good thing about such massive amounts of personal wealth some people have
amassed, and that is technology and luxury goods. Space tourism is soon going
to take off in a big way… no not for you or me but for them, but eventually it
will trickle down. What about those massive yacht's used to transport other yacht's... yes they exist google it! Personal aviation, etc... there are some way cool toys out there that would have never been invented were in not for such wealthy people.
I’ve given
a very brief overview, obviously generalizing and over simplifying…
If you want
to find out more, research, don’t believe a word from CNBC/Sky Business they’re behind the
curb and not where you want to ever be.
I can
recommend these books to see how the elite enjoy the billions they make:
- Richistan:
http://www.amazon.com/Richistan-Journey-Through-American-Wealth/dp/0307339262
- All the
Money in the World: http://www.amazon.com/All-Money-World-Make-Spend-Their/dp/0307266125/
Of course I
could just be talking rubbish as I have no money and all I am is programmer
recovering from a broken back. But I’ve been too scared to invest after being
burnt once by the dotcom con, and another time by a mining company collapse…
and I know that atop the pyramid exists the architect/s and if he/they
decide it’s time for a new pyramid it’s time and all I’ll be able to do is sit
back, hope for the best and marvel in the brilliance of the design… I can
almost imagine how the Egyptians felt 5,500 years ago. Godspeed fellow traveler.
You may at some stage have to work for a client who's very particular about security, what web parts can be used and even whether sharepoint designer can be used.
Recently I had the opportunity to work for one such client who wanted considerable customization, but without the use of SPD, creating a custom web part was out of the question, the sharepoint servers were on another continent, and I was given contribute permissions one a subsite. Like I've said many times before I hate telling somebody something can't be done.
The customizations involved cross site permissions checking, aggregating, site meta data displaying and performing actions on new/edit forms for particular content types. The only option I could think of was talking to sharepoint's web services with IE's XMLHttpRequest object.
Some people think that AJAX is some fancy new'ish library that enables you to do clientside post backs; well it is and it isn't... it's been around since the turn of the millennium and most of the AJAX tool kits/libraries have a lot fluff for browser compatibility, and if your not working in an environment where you need to support multiple browsers I wouldn't bother with any pre-packaged library/toolkit.
All you need is to instantiate an HttpRequest object, IE7 and FF have it built in so you can call methods without creating the ActiveXObject.
So how is it done?
1.- Assign a variable to the Request object
2.- Open a connection to the web service
3.- Post some data to the service
4.- Capture the reply
5.- Do some formatting
That simple, but there's more to it...
The web service is going to expect the post in some form, so most have a WSDL (Web Service Definition Language) you can query to build your post. SharePoints web services lay it all out for you to just cut & paste pretty much.
The web service is also going to send back the data in some form, usually XML. You can use javascript to interpret the XML string, but all browsers come with an XML parser. So you load the XML from the web service in to an XML DOM object, and now you can loop through, and extract the data. Look here for available methods: http://msdn2.microsoft.com/en-us/library/ms757828(VS.85).aspx
You're probably here because you want code. Here's fireWS.zip a web page you can run on your local machine that will query the WSDL, or you can put the source in a content query web part and run it from any page in SharePoint. Looking at its source should give you a good idea of how to query the WSDL, loop through nodes and construct the XML post.
Below the break down of the page and bear in mind that this is a demo and the code can be refactored... Originally it was a Javascript class, so all you would do was call new fireWS(constuc webservice), but I've split it out to individual functions and used global variables instead of properties.
Start off by creating a couple of global variables to share among the functions:
var sXmlDomVer='MSXML2.DOMDocument.3.0',oWsdlXml, oSoapXml, oSoapBody, oSoapOp;
The below instantiates a request object, and takes the web service url and the xml string to post. If you want to support other browsers add some checks here.
function fireWS(sWSUrl, sXml){
var oXmlHttp=false;
if(!oXmlHttp && typeof XMLHttpRequest!='undefined') {
try {oXmlHttp = new XMLHttpRequest();}
catch(e){oXmlHttp=false;}
}
if(!oXmlHttp && window.createRequest) {
try {oXmlHttp = window.createRequest();}
catch(e){oXmlHttp=false;}
}
if(!oXmlHttp){
try{oXmlHttp = window.createRequest();}
catch(e){oXmlHttp = new ActiveXObject('Microsoft.XMLHTTP');}
}
if(!oXmlHttp){alert('Sorry, you\'re browser doesn\'t support this control')}
if(!sXml){method='GET'}
else{method='POST'}
oXmlHttp.open(method, sWSUrl, false);
oXmlHttp.setRequestHeader('Content-Type','text/xml; charset=utf-8');
oXmlHttp.send(sXml);
document.getElementById('headers').innerText = oXmlHttp.statusText +' '+ oXmlHttp.getAllResponseHeaders();
if (oXmlHttp.readyState==4){
return oXmlHttp.responseText;
}
}
This function parses an XML string and returns an XMLDOM object. If you want to support other browsers add some checks here.
function xmlParse(str){
oXmlDom = new ActiveXObject(sXmlDomVer)
oXmlDom.async = false;
oXmlDom.loadXML(str);
if (oXmlDom.parseError.errorCode != 0){
var myErr = oXmlDom.parseError;
if(document.getElementById('debug').checked){alert('Error parsing xml ' + myErr.reason +'\n\n'+ str)}
}
return oXmlDom;
}
This function is used to search for a paraticular node.
function getMyNode(obj, nodeName, attribute, attributeVal){
try{objXml = obj.getElementsByTagName(nodeName);}
catch(e){}
if(objXml.length == 0){objXml = obj.getElementsByTagName(nodeName.substring(nodeName.indexOf(':')+1,nodeName.length));}
if(objXml.length == 0){return false}
if(attribute != null && objXml){
for(var i=0; i<objXml.length; i++){if(objXml[i].getAttribute(attribute) == attributeVal){return objXml[i];}}
return false;
}
return objXml;
}
This function is used to add a node to another node. Looks like I wanted to be able to define the position to add it in, then I changed my mind.
function addMyNode(oSoap, type, nodeName, parentNode, v, ns){
var newNode = oSoap.createNode(type, nodeName, ns);
try{
switch(type){
case 1:
if(v){newNode.text = v};
return parentNode.appendChild(newNode);
case 2:
if(v){newNode.text = v};
return parentNode.attributes.setNamedItem(newNode);
default:
return parentNode.appendChild(newNode);
}
}
catch(e){
if(document.getElementById('debug').checked){alert('Error creating node "'+ nodeName +'"\ntype '+ type +'\nv '+ v +'\n\n'+ e.description)}
}
}
This removes childnodes so you can run a new query.
function removeChildNodes(oXml){
for(var i=0;i<oXml.childNodes.length;i++){
oXml.removeChild(oXml.childNodes.item(i));
}
}
This is for adding table rows to the SOAP properties table.
function renderPropsTbl(sProp,oProp){
if(document.getElementById('tblConnProps')!=null){
var oTbl = document.getElementById('tblConnProps');
}
else{
var oTbl = document.createElement('table');
oTbl.id = 'tblConnProps';
document.getElementById('divConnProps').appendChild(oTbl);
}
var newRow = oTbl.insertRow(oTbl.rows.length);
newRow.id = newRow.uniqueID;
var newCell;
newCell = newRow.insertCell(0);
newCell.id = newCell.uniqueID;
newCell.innerText = sProp;
newCell = newRow.insertCell(1);
newCell.id = newCell.uniqueID;
newCell.appendChild(oProp);
}
This is for removing table rows from the SOAP properties table.
function removePropsTbl(iTR){
var tblConnProps = document.getElementById('tblConnProps');
for(var i=tblConnProps.rows.length-1;i>=iTR; i--){tblConnProps.deleteRow(i);}
}
This for finding the bindings in the WSDL, I should really figure out an intelligent way of finding out the namspac, but instead I just use wsdl.
function getWdslBinding(url){
var oProps = document.getElementById('divConnProps');
oProps.innerHTML = '';
oWsdlXml = xmlParse(fireWS(url +'?WSDL'));
var oWsdlBindings = getMyNode(oWsdlXml, 'wsdl:binding');
if(oWsdlBindings){
var oBindings = document.createElement('select');
oBindings.id = 'selBinding';
oBindings.attachEvent('onchange',getWdslOperations);
for(var i=0; i<oWsdlBindings.length; i++){
if(oWsdlBindings[i].attributes.length > 0){
var newopt = document.createElement('option');
newopt.value = oWsdlBindings[i].getAttribute('name');
newopt.text = oWsdlBindings[i].getAttribute('name');
oBindings.options.add(newopt);
}
}
renderPropsTbl('Binding Port:',oBindings);
getWdslOperations();
}
}
This needs a bit of work but it finds the operations for the selected binding, and it sorts the operations for aestetics.
function getWdslOperations(){
try{removePropsTbl(1)}
catch(e){}
var oWsdlOps = getMyNode(oWsdlXml,'wsdl:binding','name',document.getElementById('selBinding').value);
if(getMyNode(oWsdlOps,'soap12')){sSoapVer = 'soap12';sSoapNS = 'http://www.w3.org/2003/05/soap-envelope';}
else{sSoapVer = 'soap';sSoapNS = 'http://schemas.xmlsoap.org/soap/envelope/';}
oSoapXml = xmlParse('<' + sSoapVer +':Envelope xmlns:'+ sSoapVer +'="'+ sSoapNS +'"/>');
oSoapBody = addMyNode(oSoapXml, 1, sSoapVer +':Body', oSoapXml.documentElement, '', sSoapNS);
oWsdlOps = getMyNode(oWsdlOps,'wsdl:operation');
if(oWsdlOps){
var oOps = document.createElement('select');
oOps.id = 'selOps';
oOps.attachEvent('onchange',getWdslOpElements);
arrWsdlOps = new Array();
for(var i=0; i<oWsdlOps.length; i++){
if(oWsdlOps[i].attributes.length > 0){
arrWsdlOps.push(oWsdlOps[i].getAttribute('name'));
}
}
arrWsdlOps.sort();
for(var i=0; i<arrWsdlOps.length; i++){
var newopt = document.createElement('option');
newopt.value = arrWsdlOps[i]; newopt.text = arrWsdlOps[i];
oOps.options.add(newopt);
}
renderPropsTbl('Operation:',oOps);
getWdslOpElements();
}
}
This gets the elements for an operations and adds an input fields.
function getWdslOpElements(){
try{
removePropsTbl(2);
document.getElementById('result').innerText = '';
oSoapBody.removeChild(oSoapOp);
}
catch(e){}
var sOp = document.getElementById('selOps').value;
oWsdlOpElem = getMyNode(oWsdlXml,'s:element','name',sOp);
oSoapOp = addMyNode(oSoapXml, 1, sOp, oSoapBody, '', oWsdlXml.documentElement.getAttribute('targetNamespace'));
if(oWsdlOpElem.hasChildNodes()){
oWsdlOpParams = getMyNode(oWsdlOpElem,'s:element');
for(var i=0; i<oWsdlOpParams.length; i++){
if(oWsdlOpParams[i].attributes.length > 0){
var sOpParamType = oWsdlOpParams[i].getAttribute('type'), sOpParamName = oWsdlOpParams[i].getAttribute('name'), iInputType;
if(oWsdlOpParams[i].hasChildNodes()){iInputType = 1;}
else{
if(sOpParamType.indexOf('tns:')>-1){
var oTNSOpParams = getMyNode(oWsdlXml, 's:simpleType', 'name', sOpParamType.replace('tns:',''));
if(oTNSOpParams){
oTNSOpParams = getMyNode(oTNSOpParams, 's:enumeration');
iInputType = 2;
}
else{iInputType = 1;}
}
else{iInputType = 0;}
}
switch(iInputType){
case 1:
var oOpPN = document.createElement('textarea');
oOpPN.cols = 60;oOpPN.rows = 3;
sOpParamType = 'XML Schema';
break;
case 2:
var oOpPN = document.createElement('select');
for(var iT=0; iT<oTNSOpParams.length; iT++){
if(oTNSOpParams[iT].attributes.length > 0){
var newopt = document.createElement('option');
newopt.value = oTNSOpParams[iT].getAttribute('value');
newopt.text = oTNSOpParams[iT].getAttribute('value');
oOpPN.options.add(newopt);
}
}
break;
default:
var oOpPN = document.createElement('input');
oOpPN.size = 80;
}
oOpPN.id = 'soapp'+ sOpParamName;
renderPropsTbl(sOpParamName +' ('+ sOpParamType +'):',oOpPN);
var oOpParam = addMyNode(oSoapXml, 1, sOpParamName, oSoapOp, '',oWsdlXml.documentElement.getAttribute('targetNamespace'));
}
}
renderPropsTbl('',document.createElement('<INPUT TYPE="Button" NAME="buildSoap" VALUE="Fire Soap" onclick="buildSoap();" class="btn">'));
}
}
This loops through the form and builds the SOAP post.
function buildSoap(){
var soapFlds = document.getElementById('tblConnProps').getElementsByTagName('*');
for(var i=0;i<soapFlds.length;i++){
if(soapFlds[i].value != '' && soapFlds[i].id.indexOf('soapp')>-1){
if(soapFlds[i].type == 'textarea'){
try{
var oFldXml = xmlParse(soapFlds[i].value);
oFldXml.namespaceURI = oOpParam.namespaceURI;
var oOpParam = oSoapOp.selectSingleNode(soapFlds[i].id.replace('soapp',''));
removeChildNodes(oOpParam);
oOpParam.appendChild(oFldXml.documentElement);
}
catch(e){
try{
var oOpParam = oSoapOp.selectSingleNode(soapFlds[i].id.replace('soapp',''));
var oXmlDom = new ActiveXObject(sXmlDomVer)
oXmlDom.async = false;
oXmlDom.loadXML('<'+ soapFlds[i].id.replace('soapp','') +' xmlns="'+ oOpParam.namespaceURI +'">'+ soapFlds[i].value +'</'+ soapFlds[i].id.replace('soapp','') +'>');
oSoapOp.replaceChild(oXmlDom.documentElement, oOpParam);
}
catch(e){alert('Error in buildSoap(): '+ e.description);}
}
}
else{
try{
var oOpParam = oSoapOp.selectSingleNode(soapFlds[i].id.replace('soapp',''));
oOpParam.text = soapFlds[i].value;
}
catch(e){}
}
}
}
fireSoap(oSoapXml.xml,document.getElementById('result'))
}
The rest just renders the output.
function fireSoap(soap, oResDisp){
var sUrl = document.getElementById('url').value + document.getElementById('asmx').options[document.getElementById('asmx').selectedIndex].text;
var sRtnXml = fireWS(sUrl, soap);
document.getElementById('soap').innerText = oSoapXml.xml.replace(/></gi,'>\n<');;
//document.getElementById('soap').parentElement.style.display = 'block';
getMethodXml(sUrl);
if(sRtnXml.indexOf('z:row')>-1){
var row = xmlParse(sRtnXml).getElementsByTagName('z:row');
var sAtt = '<table border="1">';
if(row[0].attributes.length > 0){
sAtt += '<tr>';
for(var i=0; i < row[0].attributes.length; i++){sAtt += '<th>'+ row[0].attributes[i].name +'</th>';}
sAtt += '</tr>';
}
for(var i=0; i<row.length; i++){
if(row[i].attributes.length > 0){
sAtt += '<tr>';
for(var ii=0; ii < row[i].attributes.length; ii++){sAtt += '<td>'+ row[i].attributes[ii].value +'</td>';}
sAtt += '</tr>';
}
}
sAtt += '</table>';
oResDisp.innerHTML = sAtt;
}
oResDisp.innerText = sRtnXml.replace(/></gi,'>\n<');oResDisp.parentElement.style.display = 'block';
}
Once you start playing around with this you'll soon realize it's power and flexibility, and you could even save yourself the effort of registering more dll's on your server. The holly grail would be to create Http End Points for all your SQL data.
If "Web page security validation" is enable you will not be able to do any add/edit/delete actions, so you're limited to listing. This is also the case with serverside web service calls unless you explicitly "allowunsafeupdates".
This will only work if you download the html file (fireWS.zip) and run it locally with reduced permissions OR reduce your internet zone IE permissions and run it online fireWS.htm.
Usage Example: - Enter service URL: http://tb.ohchr.org/
- Choose web service eg: /_vti_bin/Lists.asmx
- Operation: GetListCollection
- Fire Soap
- You should now see the reply...
Now you have the list GUIDs so you can do some more stuff.
Like: - Operation: GetList
- listName: {17B611E5-4BF5-48C0-8926-E614A8126197}
- Fire Soap
Cool, we've got all the field names.
Let's try a list query... - Operation: GetListItems
- listName: {17B611E5-4BF5-48C0-8926-E614A8126197}
- query: <Query><Where><Contains><FieldRef Name="ConventionCode" /><Value Type="Text">C</Value></Contains></Where></Query>
- viewFields: <ViewFields><FieldRef Name="ID" /><FieldRef Name="Title" /><FieldRef Name="ConventionCode" /><FieldRef Name="ConventionOrder" /><FieldRef Name="Convention" /><FieldRef Name="Author" /></ViewFields>
- rowLimit: 7
- Fire Soap
As you can see it's a easy... I haven't tried all the web services as this is just a curiosity for me.
Web services: http://msdn2.microsoft.com/en-us/library/ms445292.aspx
|
|