getChanges Sharepoint rest API(getChanges Sharepoint rest API)
我正在使用Sharepoint 2013 REST api来查找根站点中发生的增量更改。 我的要求如下:
headers = {"Authorization": 'Bearer ' + access_token, "accept": "application/json", "odata": "verbose"} headers["content-type"] = "application/json;odata=verbose" body = { 'query': { '__metadata': { 'type': 'SP.ChangeQuery' },'Web': True, 'Update': True, 'Add': True, 'ChangeTokenStart':{'__metadata':{'type':'SP.ChangeToken'}, 'StringValue': '1;1;5b9752ee-f410-4cc6-9ab6-eb18c2ad802f;636252579049500000;89866182'} } } In response I am getting lot of changerequest objects. One of them is as below: { u 'odata.type': u 'SP.ChangeWeb', u 'ChangeToken': { u 'StringValue': u '1;1;5b9752ee-f410-4cc6-9ab6-eb18c2ad802f;636252779425600000;89976872' }, u 'WebId': u '6e21eadd-4155-494d-9a8e-1046865bdd4b', u 'ChangeType': 2, u 'odata.id': u 'https://<site url>/_api/SP.ChangeWeb87f1a9c6-937b-4507-973d-fc2d1b949aed', u 'SiteId': u '5b9752ee-f410-4cc6-9ab6-eb18c2ad802f', u 'odata.editLink': u 'SP.ChangeWeb87f1a9c6-937b-4507-973d-fc2d1b949aed', u 'Time': u '2017-03-16T16:19:02.56Z'
有人可以帮我理解回应吗? 我很难找到改变发生的路径。 此外,这会改变API捕获网站中子网站中发生的变化吗?
提前致谢
I am using Sharepoint 2013 REST api to find out the incremental changes that have happened in the root site. My request is like below:
headers = {"Authorization": 'Bearer ' + access_token, "accept": "application/json", "odata": "verbose"} headers["content-type"] = "application/json;odata=verbose" body = { 'query': { '__metadata': { 'type': 'SP.ChangeQuery' },'Web': True, 'Update': True, 'Add': True, 'ChangeTokenStart':{'__metadata':{'type':'SP.ChangeToken'}, 'StringValue': '1;1;5b9752ee-f410-4cc6-9ab6-eb18c2ad802f;636252579049500000;89866182'} } }
In response I am getting lot of changerequest objects. One of them is as below:
{ 'odata.type': 'SP.ChangeWeb', 'ChangeToken': { 'StringValue': '1;1;5b9752ee-f410-4cc6-9ab6-eb18c2ad802f;636252779425600000;89976872' }, 'WebId': '6e21eadd-4155-494d-9a8e-1046865bdd4b', 'ChangeType': 2, 'odata.id': 'https://<site url>/_api/SP.ChangeWeb87f1a9c6-937b-4507-973d-fc2d1b949aed', 'SiteId': '5b9752ee-f410-4cc6-9ab6-eb18c2ad802f', 'odata.editLink': 'SP.ChangeWeb87f1a9c6-937b-4507-973d-fc2d1b949aed', 'Time': '2017-03-16T16:19:02.56Z'
Can somebody help me understand the response? I am facing difficulty to find out the path where the change happened. Also, would this getchanges API capture changes that has happened in subsites within the site?
原文:https://stackoverflow.com/questions/42839995
最满意答案
为什么要删除按钮中的约束? 您可以创建按钮Y约束的IBOutlet,然后更改该Y约束值,而不是删除约束
选择要更改的LayoutConstraint,然后将其拖动到.h文件中
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *yAxisConstrain;
像这样改变你的Constrain值,
yAxisConstrain.constant = 0; //What ever the value you want. [self.view layoutIfNeeded];
Why do you remove the constrains in your Button? instead of removing constrains, you can create an IBOutlet of the Button Y Constrain & then change that Y Constrain value
Select the LayoutConstraint you want to change, then control drag it to your .h file
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *yAxisConstrain;
Change your Constrain value like this,
yAxisConstrain.constant = 0; //What ever the value you want. [self.view layoutIfNeeded];
相关问答
更多-
好的,你可以相当容易地做到这一点。 它基本上就像你用框架做的那样。 首先,您需要创建“变量”约束并将其保存到属性中。 你可以用代码做到这一点...... self.heightConstraint = [NSLayoutConstraint constraintWithItem:self.theView attribute: relatedBy: toItem: attribute: multiplier: constant:]; // set up the rest [self.view addCons ...
-
何时使用autolayout将imageView添加到UIButton(When to add imageView to UIButton when using autolayout)[2021-11-05]
但是在iOS 8上,这被多次调用! 在iOS 7上它被调用一次! 此外,在iOS 8中,ViewDidLayoutSubviews的LAST调用在放置图像方面是最准确的! 因此, 每次调用viewDidLayoutSubviews都会响应。 如果已添加图像视图,请不要再次添加 - 但必要时请重新定位。 然而,更好的方法是使用autolayout定位图像视图本身! 不是给它分配一个框架,而是给它约束。 现在,它将在剩余的时间内自动重新定位以响应视图布局。 But on iOS 8, this is calle ... -
Autolayout - UIButton的内在大小不包括标题插入(Autolayout - intrinsic size of UIButton does not include title insets)[2023-10-25]
您可以解决这个问题,而无需覆盖任何方法或设置任意的宽度约束。 您可以在Interface Builder中完成所有操作,如下所示。 内部按钮宽度是从标题宽度加上图标宽度加上左右内容边缘插入的。 如果一个按钮同时具有图像和文本,则它们以组为中心,之间不会有填充。 如果您添加了一个左边的内容插页,它是相对于文本计算的,而不是文本+图标。 如果您设置了一个负的左图像插入,图像被拉出左边,但整体按钮宽度不受影响。 如果您设置了一个负的左图像插入,实际布局使用该值的一半。 所以要获得一个-20点左边的插图,你必须在I ... -
使用AutoLayout获取viewDidAppear之前的UIButton宽度(Getting UIButton width before viewDidAppear, with AutoLayout)[2022-01-28]
您可以在函数- viewDidLayoutSubviews获取宽度。 Apple文档在这里。 You can get the width in the function - viewDidLayoutSubviews. Apple Documentation here. -
在Y轴上移动UIButton(Moving UIButton on Y Axis)[2022-05-16]
如果您使用的是自动布局,请在将新框架应用于按钮之前删除约束: [button removeConstraints:button.constraints]; [button setTranslatesAutoresizingMaskIntoConstraints:NO]; button.frame = CGRectMake(button.frame.origin.x, button.frame.origin.y + deltaY, button.frame.size.width, button.frame.s ... -
UIDynamics和Autolayout(UIDynamics and Autolayout)[2023-06-02]
这不是一个真正的动态问题。 Autolayout与任何视图动画或框架的任何手动设置都不兼容:当布局出现时,它将遵守约束条件 。 如果您以任何方式手动移动视图,更新约束以匹配其新位置/大小/等等,由您决定。 话虽如此:使用UIKit Dynamics,当动画结束时,动画师将暂停,并通知动画师的代表: https://developer.apple.com/library/ios/documentation/uikit/reference/UIDynamicAnimatorDelegate_Protocol/R ... -
AutoLayout圆形UIButton - 等效垂直和水平尺寸(AutoLayout Circular UIButton - Equivalent Vertical and Horizontal Size)[2021-12-20]
你不能使用vfl。 你必须使用这个方法...... AddConstraintForItem:属性:关系:toItem:属性:乘数:不变。 或者类似的东西。 两个项目可以相同,两个属性设置为一个宽度,一个设置为高度。 You can't use vfl for this. You have to use the method... AddConstraintForItem:attribute:relation:toItem:attribute:multiplier:constant. Or somethin ... -
为什么要删除按钮中的约束? 您可以创建按钮Y约束的IBOutlet,然后更改该Y约束值,而不是删除约束 选择要更改的LayoutConstraint,然后将其拖动到.h文件中 @property (nonatomic, weak) IBOutlet NSLayoutConstraint *yAxisConstrain; 像这样改变你的Constrain值, yAxisConstrain.constant = 0; //What ever the value you want. [self.view lay ...
-
Autolayout:UIImageView和UIButton之间的区别(Autolayout: Difference between a UIImageView and UIButton)[2022-08-14]
要让它们按比例缩放,请设置UIButton的backgroundImage属性而不是image属性。 使图像属性显示在标题旁边。 backgroundImage属性将缩放整个边界,内在大小应与您的UIImageView匹配。 希望这有助于解决您的问题。 To get them to scale the same set the backgroundImage property of the UIButton rather than the image property. The image property ... -
Autolayout仅在布局传递后设置视图框架,它是具有循环的东西,并且不会在添加视图或修改约束时调用-setNeedsLayout ,这就是为什么有时需要在特定视图上调用-setNeedsLayout 。 另一点是,如果您不使用界面构建器或以编程方式创建约束,则autolayout会自动将视图自动调整掩码转换为约束(-translatesAutoresizingMaskIntoConstraints属性)。 在这种情况下,如果您设置文本,则强制视图表示其内在内容大小,基本上是标签的大小,如果内在内容大小与 ...