Plone REST API:如何通过对plone进行REST调用来操纵plone上的用户?(Plone REST API: How do I manipulate user on plone by making REST calls on plone?)
我们想从我的java应用程序中创建plone用户,那么我该怎么做呢? 已经通过https://github.com/plone/plone.restapi ,但没有得到清晰的视图。
我想在java中使用REST客户端,它可以调用plone来创建,更新,删除,获取用户。
那么我可以获得如何从我的Java应用程序中操纵Plone用户的任何示例吗?
还有Json API,XML-RPC,Plone API(不适合我们的Java应用程序)的可用性,但再次用于用户操作它不符合我们的要求。
谢谢。
We want to create user on plone from my java application, so how do I do that? Have gone through https://github.com/plone/plone.restapi, but have not getting clear view.
I want to use REST client in java which can call on plone to create, update, delete, get user.
So can I get any example how to manipulate Plone users from my java application?
There is also availability of Json API, XML-RPC,Plone API(not suitable in our java app) but again for user manipulation it won't suits our requirements.
Thanks.
原文:https://stackoverflow.com/questions/37835483
最满意答案
修复了以下编码:
UIView *mySubView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen] bounds]]; [mySubView setBackgroundColor:[UIColor blackColor]]; mySubView.tag = TFIELDSUBVIEW_TAG; self.textField = [[UITextField alloc] initWithFrame:CGRectMake(2, 10, 300, 80)]; self.textField.borderStyle = UITextBorderStyleRoundedRect; self.textField.font = [UIFont systemFontOfSize:12]; self.textField.placeholder = [self.the_matrix objectInRow:collectionView.index column:indexPath.item]; self.textField.autocorrectionType = UITextAutocorrectionTypeNo; self.textField.keyboardType = UIKeyboardTypeDefault; self.textField.returnKeyType = UIReturnKeyDone; self.textField.clearButtonMode = UITextFieldViewModeWhileEditing; self.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; self.textField.textAlignment = NSTextAlignmentCenter; self.textFieldColumn = indexPath.item; self.textFieldRow = collectionView.index; UIButton *buttonOK = [UIButton buttonWithType:UIButtonTypeRoundedRect]; buttonOK.tag = TFIELDSUBVIEW_TAG; [buttonOK setBackgroundImage:[UIImage imageNamed:@"ok.jpg"] forState:UIControlStateNormal]; [buttonOK addTarget:self action:@selector(okClicked) forControlEvents:UIControlEventTouchUpInside]; [buttonOK setTitle:@"" forState:UIControlStateNormal]; buttonOK.backgroundColor = [UIColor grayColor]; buttonOK.frame = CGRectMake(50, 100, 50, 30); buttonOK.tintColor = [UIColor greenColor]; UIButton *buttonCANCEL = [UIButton buttonWithType:UIButtonTypeRoundedRect]; buttonCANCEL.tag = TFIELDSUBVIEW_TAG; [buttonCANCEL addTarget:self action:@selector(cancelClicked) forControlEvents:UIControlEventTouchUpInside]; [buttonCANCEL setBackgroundImage:[UIImage imageNamed:@"cancel.jpg"] forState:UIControlStateNormal]; [buttonCANCEL setTitle:@"" forState:UIControlStateNormal]; buttonCANCEL.backgroundColor = [UIColor grayColor]; buttonCANCEL.frame = CGRectMake(120, 100, 75, 30); buttonCANCEL.tintColor = [UIColor redColor]; [mySubView addSubview:buttonOK]; [mySubView addSubview:buttonCANCEL]; [mySubView addSubview:self.textField]; [self setCustomView:mySubView]; [self.view reloadInputViews];
setCustomView如下:
-(void) setCustomView:(UIView *)customView { NSUInteger z = NSNotFound; if (_customView) { z = [self.view.subviews indexOfObject:_customView]; } if (z == NSNotFound) { [self.view addSubview:customView]; } else { UIView *superview = _customView.superview; [_customView removeFromSuperview]; [superview insertSubview:customView atIndex:z]; } _customView = customView; }
Fixed with the following coding:
UIView *mySubView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen] bounds]]; [mySubView setBackgroundColor:[UIColor blackColor]]; mySubView.tag = TFIELDSUBVIEW_TAG; self.textField = [[UITextField alloc] initWithFrame:CGRectMake(2, 10, 300, 80)]; self.textField.borderStyle = UITextBorderStyleRoundedRect; self.textField.font = [UIFont systemFontOfSize:12]; self.textField.placeholder = [self.the_matrix objectInRow:collectionView.index column:indexPath.item]; self.textField.autocorrectionType = UITextAutocorrectionTypeNo; self.textField.keyboardType = UIKeyboardTypeDefault; self.textField.returnKeyType = UIReturnKeyDone; self.textField.clearButtonMode = UITextFieldViewModeWhileEditing; self.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; self.textField.textAlignment = NSTextAlignmentCenter; self.textFieldColumn = indexPath.item; self.textFieldRow = collectionView.index; UIButton *buttonOK = [UIButton buttonWithType:UIButtonTypeRoundedRect]; buttonOK.tag = TFIELDSUBVIEW_TAG; [buttonOK setBackgroundImage:[UIImage imageNamed:@"ok.jpg"] forState:UIControlStateNormal]; [buttonOK addTarget:self action:@selector(okClicked) forControlEvents:UIControlEventTouchUpInside]; [buttonOK setTitle:@"" forState:UIControlStateNormal]; buttonOK.backgroundColor = [UIColor grayColor]; buttonOK.frame = CGRectMake(50, 100, 50, 30); buttonOK.tintColor = [UIColor greenColor]; UIButton *buttonCANCEL = [UIButton buttonWithType:UIButtonTypeRoundedRect]; buttonCANCEL.tag = TFIELDSUBVIEW_TAG; [buttonCANCEL addTarget:self action:@selector(cancelClicked) forControlEvents:UIControlEventTouchUpInside]; [buttonCANCEL setBackgroundImage:[UIImage imageNamed:@"cancel.jpg"] forState:UIControlStateNormal]; [buttonCANCEL setTitle:@"" forState:UIControlStateNormal]; buttonCANCEL.backgroundColor = [UIColor grayColor]; buttonCANCEL.frame = CGRectMake(120, 100, 75, 30); buttonCANCEL.tintColor = [UIColor redColor]; [mySubView addSubview:buttonOK]; [mySubView addSubview:buttonCANCEL]; [mySubView addSubview:self.textField]; [self setCustomView:mySubView]; [self.view reloadInputViews];
setCustomView being the following:
-(void) setCustomView:(UIView *)customView { NSUInteger z = NSNotFound; if (_customView) { z = [self.view.subviews indexOfObject:_customView]; } if (z == NSNotFound) { [self.view addSubview:customView]; } else { UIView *superview = _customView.superview; [_customView removeFromSuperview]; [superview insertSubview:customView atIndex:z]; } _customView = customView; }
相关问答
更多-
您正在使用UICollectionViewController,它像UITableViewController一样,具有集合视图(或表视图)作为视图控制器的基本view属性。 这意味着它不能从视图控制器中调整大小; 它的大小是由它的超级视图控制的 - 无论是窗口,在这种情况下,它将其作为根视图控制器,或者在嵌入它时使用父视图控制器。 如果您想缩小集合视图区域以便单元格彼此邻接,则可以修改故事板中集合视图的分区插页。 在你的情况下,15左右的插图将单元格放在一起 - 这是9 * 50(450)加30 = 48 ...
-
可能是-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath缺失! The problem was that I didn't set the ViewController as childViewController in the viewCo ...
-
如果您使用的是iOS7 ,那么您可能会遇到重用错误! 我确实有同样的问题,它在iOS6.1和iOS6上iOS6.1 iOS6 ,但是一旦它在iOS7 (最终版)上启动,单元格就永远不会被重用! 我没有修复,我正在尝试创建自己的重用逻辑。 编辑: 我有一些工作,所以你需要从布局中保存你的属性(如果你使用它可能会覆盖FlowLayout )。 然后在 - (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell ...
-
显然,这是iOS 7中的预期行为setHighlighted:在支持它的所有子视图上调用。 Apparently, this is the expected behavior in iOS 7. setHighlighted: is called on all subviews that support it.
-
我在github上找到了一个很棒的解决方案。 诀窍是为单元格内容创建xib文件 https://github.com/honghaoz/Dynamic-Collection-View-Cell-With-Auto-Layout-Demo I found a great solution on github. The trick is creating xib file for cell content https://github.com/honghaoz/Dynamic-Collection-View-C ...
-
我今天遇到了这个。 这是我解决问题的方法,但必须有更好的方法。 我不应该把集合视图选择逻辑放到我的单元代码中。 将UITapGestureRecognizer添加到滚动视图。 UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scrollViewTapped:)]; [scrollView addGestureRecognizer:tapGestu ...
-
如何在IOS中从UICollectionViewCell初始化弹出窗口视图(How to initialize popover view from UICollectionViewCell in IOS)[2024-01-01]
如果您有兴趣在集合视图中获取当前所选单元格的CGRect ,则可以使用: CGRect rect = [collectionView layoutAttributesForItemAtIndexPath:indexPath].frame; 之后,您可以使用presentPopoverFromRect:inView:permittedArrowDirections:animated:从该rect显示您的popover。 是的,如果它具有与之关联的故事板标识符,您始终可以从故事板中动态加载VC: UIStor ... -
修复了以下编码: UIView *mySubView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen] bounds]]; [mySubView setBackgroundColor:[UIColor blackColor]]; mySubView.tag = TFIELDSUBVIEW_TAG; self.textField = [[UITextField alloc] initWithFrame:CGRectMake(2, ...
-
您好,也许您可以检查您的观点的限制,以确保它们是正确的? 有时,不良约束不会导致您的视图正确显示 Hi maybe you can check the constraints of your views to make sure they are correct? Sometimes bad constraints will not cause your view to show properly
-
contentView由UICollectionViewCell拥有,因此可以执行此操作 self.contentView.translatesAutoresizingMaskIntoConstraints = NO; 打破了单元格的布局。 对于您拥有的任何子视图并将其添加到内容视图中,这样做是完全合理的,但是混淆了您不属于自己的视图会带来破坏布局的风险。 The contentView is owned by the UICollectionViewCell so the action of doing ...