When I do document preview it will logout first time? - liferay

I have liferay open office integration. My problem is when I preview any document after login first time it is logout and ask to login again. Next time it is working fine the problem persist while document preview generation and after user log first time. suppose there are 5 page of document only 2 page display other while show processing image.
Below are logs come while logout.
06:55:17,743 ERROR [ajp-bio-8009-exec-88][PollerServlet:63] No channel exists with user id 1810503
06:55:17,782 ERROR [ajp-bio-8009-exec-88][status_jsp:752] No channel exists with user id 1810503
06:55:26,360 ERROR [ajp-bio-8009-exec-95][PollerServlet:63] No channel exists with user id 1810503
06:55:26,403 ERROR [ajp-bio-8009-exec-95][status_jsp:752] No channel exists with user id 1810503
Above logs come each time when i log in.
I am using Liferay 6.2 CE GA3 + Mysql + Openoffice + xuggler.
I have seen liferay issues related with No channel exists with user id but it does not answer my question

Related

How to transfer data from page to another in node js

Hello there i am learning node.js and got stuck in a scenario.The flow is that in website user register himself and after successfully registering i will be sending him to route named create_profile which in is post request and also i want to send userId to create_profile route.In case if user close the website then if he agains open it and login then if profile is incomplete then i will be taking his userId and send to create_profile route.And after that to home page.What i was thinking to store session for user authentication in create profile page and login.This is because if login there can be tow cases : If user has successfully completed his profile then take him to home and store a global session there and second case it to take him to create profile as its incomplete then after successfully creating take him to home store global session for user authentication.But my confusion is to how to pass userId from login to create profile which is post request.Do i need to make temp session ? Please solve my issue i am confused how to solve this .
You can create a "profile_completed" coloumn in DB and set it as "false" (default), update it to "true" if user has completed the profile. While user login check if his profile is updated ,if yes send him to home else ask him to update.
You can pass user I'd to create_profile via request or get it from session storage you saved earlier

Xamarin Forms - Close view after successful login with Azure AD

I'm successfully logging in my Xamarin Forms application with Azure AD.
The problem is that when I'm logged in through the webview opened by default with :
user = await AuthenticationManager.DefaultManager.CurrentClient.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, true);
The created webview shows a message telling me that I'm logged in but I don't know how to close this view after that.
Is there an event I can use or am I doing something wrong and the webview is supposed to close itself upon complete authentication ?
EDIT :
I changed my call to :
user = await AuthenticationManager.DefaultManager.CurrentClient.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, false);
Becase I didn't give an SID being a Xamarin Forms project.
The result is that the window closes now but I get and InvalidOperationException with the message :
Invalid format of the authentication response.
Any idea about the format I should give ? I don't see what I could change to be able to get the user connected.
Just leave off the true/false on the end.
For more information on authentication, see chapter 2 of http://aka.ms/zumobook

Opening a google drive file using the google drive api while I'm NOT signed in to google drive

This has really been bugging me for some time so any help to confirm or affirm this is much appreciated! This is also the first time I actually post a question despite being developing for a long time :)
So I have a nodejs app integrating with the Google Drive API and I want users to authorize multiple Google Drive accounts and be able to view and open (and in general just interact with) all files from the accounts that they add.
I authorize my app using the highest available scope: https://www.googleapis.com/auth/drive and because I don't want users to have to sign-in again when the access_token runs out so I also include the approval_prompt: "force" and ``access_type: "offline"` when I request my access tokens.
Everything is fine - I authorize nicely, I can delete files, I can open them, I can share them, I can download them. Except for one thing:
If I e.g. authorize horse#gmail.com and then beaver#gmail.com. Then I can still delete, share, download and preview files from both accounts. But I simply cannot open documents from horse#gmail.com in google docs for editing (because beaver#gmail.com is signed in on my local machine). The best I can do is getting to a point where it shows me the document, with the right account logged in in the top right corner of the screen, but asks me to sign-in with a button. When I click the button it just refreshes and give me the same message and the same screen.
What I've tried is:
Simply redirecting the user to the file resources alternateLink from the API
Taking the alternateLink and appending my access_token to it and then redirect the user to it.
(and a ton of other random things I found various places that didn't work).
In both cases I have also tried signing out from all google accounts.
Now I checked a couple of webservices like Jollicloud and Odrive that tries something similar. However, both of them appear to force the user to login to google to access a file.
Is it really true that you can do all kinds of crazy things with the users files like deleting and downloading, but you can't open them in Google Docs own apps?
Not completely sure what kind of code I should add to show you what I've got. But here's some. This is my open action (what happens when the user clicks on a file and wants to open the file in the Google Docs/Sheet/etc.) (the orientdb stuff is because we're using the OrientDB graph database - it just fetches an account where we store the tokens). The link is the link property of the file (see below):
open: function(req,res,next){
var link = req.param("link");
var uid = req.param("uid");
orientdb.select().from('Account').where({uid: uid}).one()
.then(function(account){
var URL = link + "&access_token=" + account.tokens.access_token;
res.redirect(URL);
});
}
Here's an example file document from our database (I've replaced all compromising data with a descriptive
ODocument - Class: File id: #13:20499 v.6
name : Hummer2
service : Gdrive
kind : Google Doc
created : Nov 17, 2014
changed : Nov 17, 2014
users : [MB]
uid : mrb#flowtale.com
childID : <FILE.ID>
exportLinks : {DOCX=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=docx, Open Office doc=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=odt, Rich text=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=rtf, HTML=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=html, Plain text=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=txt, PDF=https://docs.google.com/feeds/download/documents/export/Export?id=<FILE.ID>&exportFormat=pdf}
usernames : [<ARRAY OF USERNAMES ASSOCIATED WITH THIS FILE>]
in_hasFile : User#11:0{out_hasFile:[size=2237],out_hasAccount:[size=4],username:null,email:h#h.com,password:<SOME ENCRYPTED PASSWORD>} v2244
out_belongsTo : Account#12:3{in_belongsTo:[size=6],type:Gdrive,uid:<SOME UID>,tokens:{access_token=<OUR ACCOUNT ACCESS TOKEN>, token_type=Bearer, refresh_token=<OUR ACCOUNT REFRESH TOKEN>, expiry_date=1416258913290},rootFolderID:<ROOT FOLDER ID>,email:<THE ACCOUNT EMAIL>,filesCached:2,usersCached:2,job:4,in_hasAccount:#11:0} v15
in_folderContains : File#13:20495{out_folderContains:[size=2],name:Testhest,service:Gdrive,kind:folder,created:Oct 12, 2014,changed:Oct 12, 2014,users:[1],link:https://docs.google.com/a/flowtale.com/folderview?id=<FOLDER.ID>&usp=drivesdk,uid:mrb#flowtale.com,childID:<FOLDER.ID>,exportLinks:{},usernames:[1],parents:[1],in_hasFile:#11:0,out_belongsTo:#12:3,in_folderContains:#13:13891} v36
link : https://docs.google.com/a/flowtale.com/document/d/<FILE.ID>/edit?usp=drivesdk
Looking forward to hear if anybody can help me or have experienced this before.
Thanks!
The API will allow you to do several actions in your drive account. I haven't been able to reproduce the behavior you mention with files that I haven't granted permissions to another account.
When you authenticate through the OAuth process, you will grant access to your account only to the application which created the OAuth request. You can not edit the content of a file without manually opening it through GDocs. Therefore, when the browser opens the AlternateUrl, it will require you to login to the account, in order to access the file.

If New Document/Media uploaded in liferay by admin, user has to get message after login

I am very new to liferay. Please help me implementing the below requirement.
Using Document and media portlet in liferay, If any new document is uploaded or uploaded document is modified(Version changed) by admin user, then
How can i identify that the particular document is modified or newly uploaded as i have to show a popup message to user based upon if any new files is uploaded or modified after log on.
That is not a little change request - this required bit more development. And here is more different variants:
Simple but nonperformance variant:
With UserLocalServiceUtil you can check the last user-login date
Similarly iterate over all documents and check last modification date
Create Liferay-Portlet that shows the list of documents with modification date after last user-login date
~
Here are the steps:
Use corresponding Document Listener i.e
DlFolderListener or DlFileEntryListener. You have to use hook to
add your listner in portal.properties.
For Example, you would need to workaround below property.
value.object.listener.com.liferay.portlet.documentlibrary.model.FileEntry
= com.my.custom.MyFileEntryListener
This class would be extending BaseModelListener<FileEntry>
Override and use onAfterUpdate method to notify appropriate audience
(users).
Now this can be done by setting this notification in user
preferences.
On user Login, check corresponding user preferences for this
notification and notify user. You can use hook LoginPostAction to read user preferences for notification.
Hope this helps.
Create customfield for user. Create table with service builder to store the fileEntry Id which modified.
Create DLFileEntry Listener and write
code on FileUpdate. Add DLFileEntryID in same table created in step 1. Set
custom field true for all the user.
Create LoginPostActionHook and on Check the user's flag and fetch the FileEntryId get info of that fileEntryId and display notification with all file's information. Set customfield Flag false for particular user and remove the fileentryid from table or mark them all as read.

Sharepoint 2010 - Custom Document ID Provider - Document ID generated - but /_layouts/DocIdRedir.aspx?ID=ID does not work

I use a custom document ID provider. The document id gets generated which may be seen when a new file is uploaded to one of the libraries. The Document ID column of the library displays the correct document ID as per the logic in the Document ID Provider. However, if I browse to /_layouts/DocIdRedir.aspx?ID=<<NEWID>> I get the following error message
"OPERATION COMPLETED SUCCESSFULLY" No documents with ID <> were found in this site collection.
To close this question, it was a timer job issue. There is nothing that can be done about it except change the timer execution delay.

Resources