SharePoint 2007 lists webservice - identify revision of list item - sharepoint

Using the lists webservice I retrieve the items from a list. In the XML returned I can see the attribute ows__IsCurrentVersion="1" which I assume is the same as the file object model (i.e. a boolean to say if it is current or not).
However I do not see a way to identify what revision it is? What should that attribute be?

By 'revision' do you mean version? If so, you are probably looking for one of these attributes:
ows_owshiddenversion is an Integer (ex: 8)
ows__UIVersion is an Integer (ex: 4096)
ows__UIVersionString is a String (ex: 8.0)
*edit*
Here is some more information after testing it using a Document Library. You should also check the other comments by Hugo and Janis, as they have some good information.
ows_owshiddenversion ows__UIVersion ows__UIVersionString
1 512 1.0
2 513 1.1
3 514 1.2
4 1024 2.0
5 1025 2.1
Most likely, what you are looking for is ows_owshiddenversion.

The columns in the list you are looking for are VersionID (usually 512, 1024, etc.) and VersionLabel (usually 1.0, 2.0, 3.0) and the attributes that Kit Menke pointed out will give you that information if you are using the Web Service.
You might want to have a look at the Versions web service if you need to do more work with the web services : http://server/_vti_bin/versions.asmx

Ill just add some info. You can use UIVersion (which is version id) or UIVersionString (which is user-friendly version label)
For example
label 0.1 -> id 1
label 1.0 -> id 512
label 1.1 -> id 513
label 2.0 -> 1024
label 2.2 -> 1026.
IsCurrentVersion will be true for latest MAJOR (published) version (2.0 or 3.0, but not 3.1). Minor version number is draft version.
Some insights about versioning i wrote in my own question & answer.

Related

Need to do a cross reference in Excel

I am needing to check that our Master Schedule is reflecting all physical work that falls into our SOW(Statement of Work).
I have a sheet that does this fairly simply, but I want to make it a simple cut and paste from our Schedule export, and that way it reflects that it is looking at current data vs data from several months ago.
I can handle the date part, but I can't seem to get the logic in my head right for how I should reference the data to double-check compliance.
Each SOW Paragraph has a number assigned to it, and that is what each task would refer to.
Activity Type
Activity ID
CAM
WBS
OBS
% Complete
SOW
ASAP
49.3.4.2.3.2.030
Pam
77.4.1.2
C.11.1
20%
1.0
ASAP
C2_4.20.010.011
Shaun
77.3.1
C.5.4.2
15%
3.6.1.2
ASAP
C2_4.20.010.012
Shaun
77.3.1
C.5.4.2
0%
3.6.1.2
ASAP
69.HP.5.1.2.15.30
Mark
77.1.1
C.11.1
50%
3.2
ASAP
C2_6.1.5.15
Brett
77.2.1
C.3.2.1
100%
5.0
ASAP
C2_2.10.55
Susan
77.2.1
C.5.4.1
60%
6.0
ASAP
29.3.2.11.1.20
Eric
77.4.1
C.11.1
20%
1.0
ASAP
1Z.DIL.0025
Adam
77.1.1
C.1.1
10%
1.1.2
Say this image is an export from our schedule.
I need to make sure that those SOW numbers are lined up with the full SOW for just the ID numbers with a C2. Below would be the example result.
SOW Number
In Master Schedule?
1.0
No
1.1
No
1.1.1
Yes
1.1.2
No
1.1.3
No
3.0
No
3.2
No
3.3
No
3.5
No
3.6
No
3.6.1
No
3.6.1.2
Yes
4.0
No
5.0
Yes
5.1
No
5.2
No
6.0
Yes
The logic I'm trying to figure out with the formulas is:
If A# is in MS_Tab $G:$G, does the ID number start with a C2? If Yes, list "Yes" under "In MS?", else list "No"
I tried to do a VLOOKUP first and of course, that is incorrect since it only looks for the first instance of the search. Then I thought of doing a VLOOKUPpaired with an HLOOKUP, but that still falls into the same problem. I read I could do Index and Match, but I haven't been able to get the logic to work for me.
Note: I cannot change the ID's to make my life easier, this is using an excel export from our master schedule.

Unable to set sheet zoom% to 120 using apache POI

How can I set sheet zoom% to 120 using Apache POI ?
I tried with sheet.setZoom(5,4) but its outputs to 125% zoom.
Also this method accepts only integers.
Any help would be appreciated.
The API docs for the Sheet interface in Apache POI state:
setZoom(int scale) - Window zoom magnification for current view
representing percent values.
and
setZoom(int numerator, int denominator)
Deprecated.
2015-11-23 (circa POI 3.14beta1). Use setZoom(int) instead.
So try:
sheet.setZoom(120);
Or to use the deprecated method on an older version of the API:
sheet.setZoom(12, 10);
Note, 5/4=1.25 which is the reason you get zoomed to 125%

How to increase digitcount in Digital Gauge?

I'm trying to use application that was developed using .NET.
This application uses Dundas Gauges (third party included in my application).
Application uses jscript.net. I'm trying to use Digital gauge.
The problem that I have:
The number count is limited to 5. In my case I have 6 digits to display. If I provide 5 digits it works, if I provide 6 digits .. instead of displaying those numbers I see 'ERROR'
My question:
How could I increase allowed digit count? I used this code:
var digitGauge : GaugeControl = GaugeControl( form.All( "digitGauge" ) );
digitGauge.Value = 123456;
Note: I was looking for property DigitCount for variable digitGauge .. but it does not exist.
Could someone help me and correct my code?
Thanks
I am taking off this question. I decided not to use this type of gauge

SPFileVersionCollection - why versions are sorted in mixed order?

SPFileVersionCollection and SPListItemVersionCollection versioning seems inconsistent to me. Inconsistency wouldn't be a problem to me, but sort order is.
SPListItemVersionCollection
I can understand versioning of ListItems as they are stored in descending order:
SPContext.Current.ListItem.Versions.Count -> 5
SPContext.Current.ListItem.Versions[0].VersionId -> 1026 (2.2 latest version)
SPContext.Current.ListItem.Versions[1].VersionId -> 1025 (2.1)
SPContext.Current.ListItem.Versions[2].VersionId -> 1024 (2.0)
... [4].VersionId -> (oldest version)
SPFileVersionCollection
However I can't understand how version numbers are saved for a document library item:
SPContext.Current.ListItem.File.Versions.Count -> 4
SPContext.Current.ListItem.File.Versions[0].ID -> 512 (1.0 oldest one)
SPContext.Current.ListItem.File.Versions[1].ID -> 513 (1.1)
SPContext.Current.ListItem.File.Versions[2].ID -> 1025 (2.1 latest version)
SPContext.Current.ListItem.File.Versions[3].ID -> 1024 (2.0 (EDIT: IsCurrentVersion = True))
They are nor in ascending order, nor descending, but something mixed.
Is there any reason for SharePoint team to decide to store SPFile versions like that? And do they expect that I write my own method to get latest version or is there a builtin one for that?
A note: Let me point out that SPListItem.File is not null for document library items.
Thought I would output some info about SPFileVersionCollection in console app and it turns out that:
last index will hold the current (not
drafted but published) version
(SPFileVersion.IsCurrentVersion
property is TRUE for this)
0 index holds the oldest version
(last index - 1) has the last drafted version (for example 2.7) and (last index - 2) holds 2.6 etc.
SPFile.Versions.Count = 0 if you just uploaded brand new document (minor version, before publishing).
If you continue uploading new document versions and have not yet published one, then they add to SPFileVersionCollection, however none has IsCurrentVersion property set to true until you publish one.
Ahh, i had a false assumption that a last document draft version should count as the latest one. Ofcourse, the last PUBLISHED version is the latest one!
Still, beware of inconsistency.

Sub Sonic 2.2 cache? problem

I recently started playing around with SubSonic 2.2 (only 2.2 because I didn't find any Oracle t4 templates at the time). That aside, I have been noticing that I can run a query on table a and field b will have a value of 1. If I went into Sql Tools or Oracle Developer and changed field b to a value of 2, SubSonic's LoadByKey functions still returns an object with field b having a value of 1.
In case that is hard to read.
var id = "primary key";
x.LoadByKey(id);
Console.Write(x.b); -> yields 1
I can go change this value in another program and rerun the code and it is always 1 regardless.
Any ideas?
The only thing I can think is that it's an app issue, or a driver-level issue. We don't implement any kind of caching.

Resources