eclipse plugin issue with welcome screen - eclipse

I have written a eclipse plugin which will customize the eclipse welcome screen.
Below is the xml
> <?xml version="1.0" encoding="utf-8" ?> <introContent>
> <extensionContent id="comregistrationplugin-introExtension"
> style="css/sample.css" name="Sample Extension" path="overview/#">
> <group style-id="content-group"
> id="comregistrationplugin-introLink-group">
> <link label="Registration/Signup" url="" id="comregistrationplugin-introLink" style-id="content-link">
> <text>Click here to login.</text>
> </link>
> </group> </extensionContent> </introContent>
Once I click on the link, it opens up the url specified on the link in the web browser.
The url that I use is a sso url which will open up a login page . Once the user provides the email address the user will be logged in and and the api will return a response.
I need a way to capture the response without showing the response on the users browser. For ex, once the response is received I need a way to capture the response in the plugin and show a generic success message on the users browser.
Or is there a way to read the cookie once the login succeeds ?

You might be able to find the corresponding editor, and grovel through it to find the Browser and install your own listener. But you might be better off creating your own browser instance, either through a dialog or as a separate editor, so you can control the setup. I implemented something like this for the Eclipse User Storage Service.

Related

How to get parameters of a URI deep link into a Maui Application?

I am want to create a deep link like some-app://localhost?user=123455 that when clicked opens a Maui WinUI app. When the app receives this deep link I want to be able to get the user ID off of the deep link. I was able to do this in Xamarin, but haven't figured out the Maui equivalent
I am able to register the app using (taken from this Windows doc):
<Applications>
<Application Id= ... >
<Extensions>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="alsdk">
<uap:Logo>images\icon.png</uap:Logo>
<uap:DisplayName>SDK Sample URI Scheme</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
</Extensions>
...
</Application>
But when I receive the event via the app lifecycle (https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/app-lifecycle#windows) I am not seeing the parameters of the URI.
I've encountered the same problem and I got it working thanks to this reply on the issue I created.
You can retrieve the launch arguments by using Environment.GetCommandLineArgs(); inside of OnLaunched.

What is the proper way to integrate server-side code with IBM's dialog api?

I want to integrate my web application with IBM's dialog api. Basically, I want to sometimes send the pure text result from the IBM dialog API, as I set it up in the XML, and other times, such as when the user wants a dynamic response, which might involve me querying a database to find an account balance, for example. My current thought is to include some sort of syntax in my dialog XML which I can parse to know if the response from the conversation requires me to change it. I was thinking of something like:
<input>
<grammar>
<item>What is my account balance?</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>{ACTION_GETBALANCE}</item>
</prompt>
</output>
</input>
So if I got a response like {ACTION_***} I would take my own action. Is this an appropriate way of doing this? Is there another way which might be better?
This is indeed the recommended method
see for example line 1358 on the movie application demo dialog file provided on WDC git repo
<prompt selectionType="RANDOM">
<item>"{Search_Now:"{Search_Now}", Recency:"{Recency_Preference}", Rating:"{Certification_Preference}", Genre:"{Genre_Preference}", Index:"{Current_Index}", Page:"{Page}"}"</item>
</prompt>

AEM:: Error Handling using the acs-aem-commons package

As defined here http://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html I am trying to confgure error pages for my application. Here is what I have done:
1) Created 404.jsp and default.jsp at /apps/sling/servlet/errorhandler as defined on the page.
2) Added below widget to the advanced tab:
<errorpages
jcr:primaryType="cq:Widget"
path="/apps/acs-commons/components/utilities/errorpagehandler/dialog/errorpages.infinity.json"
xtype="cqinclude"/>
3) Created /apps//config/com.adobe.acs.commons.errorpagehandler.impl.ErrorPageHandlerImpl.xml
with the following properties:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
prop.enabled="{Boolean}true"
prop.error-page.fallback-name="500"
prop.error-page.system-path="/content/error"
prop.error-page.extension="html"
ttl="{Long}300"/>
4) Created /content/myapp/en/errors using a fresh template. The template has only a parsys. Inside the /content/myapp/en/errors, I have created page 404 and 500 using the same template. In the video it is shown that when the speaker opens the pages 404.html and 500.html created under geometrixx from siteadmin he is able to see appropriate error messages. What I am not able to understand is that if my template consists of only a parsys how will the 404 and 500 pages show the error messge. From where are those messages being generated ? Am I missing something here ? Do I have to create any component ?
5) In the Page Properties of the page /content/myapp/en , I have configured /content/myapp/en/errors as the Error Page. To generate a 404 error when I try to access the URL /content/myapp/ent.html instead of /content/myapp/en.html it throws a
No resource found
Cannot serve request to /content/myapp/ent.html in /apps/sling/servlet/errorhandler/404.jsp
Not sure how do I get he nice looking pages as shown in the video.
5) How can I make the error messages authorable ?
Thanks in advance
No need to follow so many steps. The ACS commons package with the error handler is available as a package. Down load this package from This ACS commons git hub site
The name of the file is --> acs-aem-commons-content-1.9.6.zip(2.3 MB).
Then just create sling:OsgiConfig node in your /apps/myapp/config with
name --> com.adobe.acs.commons.wcm.impl.ComponentErrorHandlerImpl. Then put the below configuration into the node.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="sling:OsgiConfig"
prop.edit.enabled="{Boolean}true"
prop.edit.html="/apps/acs-commons/components/utilities/component-error-handler/edit.html"
prop.preview.enabled="{Boolean}false"
prop.preview.html="/apps/acs-commons/components/utilities/component-error-handler/preview.html"
prop.publish.enabled="{Boolean}false"
prop.publish.html="/dev/null"
/>
Below is the configure component in crxde lite
Thats all. You need not do anything else.You will get proper error pages or messages for all 500 or 404 errors
As you said in 5th step In the Page Properties of the page /content/myapp/en , you have configured /content/myapp/en/errors as the Error Page. This error pages are work for for child pages under this path /content/myapp/en . In your case it will be work for all the childs under /content/myapp/en/*.html
Ex. It will work for /content/myapp/en/{invalidurl}.html
The question was about the page error handler, the answer is provided about in: component error handler. These two different things altogether.
the CEH handles the exception in component scope where as EPH handles it in request scope
when component fails and the exception is not handled by CEH and response is written as 500, it will be handled by EPH
For point 4) The template has only a parsys.
Yes you have to configure the components and place them in the parsys as you would do for your content pages that will display in case of error pages. The error handler gives you the flexibility to modify what shows up in error pages by keeping them authorable. You can change the look and feel of error pages for each of the valid HTTP errors.
For example, whatever I create in my content/error/404.html page will show up when the actual 404 is returned by the errorhandler.
In case of an invalid URL:
For point 5) In the Page Properties of the page /content/myapp/en , I have configured /content/myapp/en/errors as the Error Page. To generate a 404 error when I try to access the URL /content/myapp/ent.html instead of /content/myapp/en.html it throws an error.
The mistake that you did here was that you are trying to access a parent page url.
One solution would be to place the custom error pages at a level higher than the content pages for your website.
You can do this more than once. As in keep separate error page for global errors, some other for myapp, some others for myapp/en and so on.
So if you have seen there is a tab in page properties where you can author the error pages root url. This can be leveraged to give different URLs as per requirement.
For example,
If you want an error page for /content/myapp/ent.html then place a separate set of error handler pages at content/myapp in addition to those at content/myapp/en.
Then goto myapp.html and in Page Properties override the error page url to content/myapp/error.
For each parent whenever you need a separate error page url author those in page properties.
So now I have two renditions of my error page: One for content/myapp and other for content/myapp/en
As shown below:
path - /content/test.html (Global)
path - /content/myapp/ent.html (Myapp):
Config node:
Sample template to show the difference:

Connecting to a REST web service with Drupal

I'm trying to connect to a REST web service with Drupal 7. Data is supplied via a url and I want to pull it into the D7 site to create and populate nodes. I'm using the feeds module to map the content and Web Service Client module to pull in the data but I'm unsure as to what to use as Data types to cut and split the data as I need it.
I have an address that looks like http://192.136.0.31:8080/places/getAll
The xml I get back when I use Chrome's Advanced Rest Client:
<ArrayOfAsset>
<Asset>
<Address1>01-02 Whatever Road</Address1>
<Address2>Whatever Town</Address2>
<City />
<Country>United Kingdom</Country>
<County>Whatevershire</County>
<HouseNumber>0001</HouseNumber>
<Id>01234ec0e-005456944567</Id>
<Latitude>58.828424</Latitude>
<LongTelephoneNumber>01543 534676</LongTelephoneNumber>
<Longitude>126.054688</Longitude>
<Name>Whatever the name is</Name>
<PostCode>WH01 7PU</PostCode>
<ShortName>Whatever</ShortName>
<Uri></Uri>
</Asset>
</ArrayOfAsset>
So, my question is how do I split/cut that data to return the parts I need in Clients module?
If there is anything else you need me to supply, let me know.
Update:
The xml exported via the web service, although looks like xml doesn't actually format the same.
The first line is is commented out in Chrome dev tools as if chrome is putting it there itself:
<!--?xml version="1.0" encoding="utf-8"?-->
Blank head tags
<head></head>
<body>
Then straight into the code above.

Unable to use Liferay Freindly URL Mapper

I was following this document from Liferay Website to work Map Firendly URL Mappings
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/adding-friendly-url-mapping-to-the-portlet
I am using Liferay version=6.1.0
During HyperLink navigation , i was getting the following url
http://localhost:8080/web/guest/what-we-do?p_p_id=sai_WAR_Saiportlet&
p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1
&_sai_WAR_Saiportlet_jspPage=%2Fhtml%2Fsai%2Fedit.jsp
To modify the above i have tried to use Friendly URL Mapper and i have done the following way
Inside liferay-portlet.xml file .
<portlet>
<portlet-name>sai</portlet-name>
<icon>/icon.png</icon>
<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>sai</friendly-url-mapping>
<friendly-url-routes>com/test/sai-friendly-url-routes.xml</friendly-url-routes>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>
/js/main.js
</footer-portlet-javascript>
<css-class-wrapper>sai-portlet</css-class-wrapper>
</portlet>
Created a new file by name sai-friendly-url-routes.xml inside
D:\liferay-plugins-sdk-6.1.0-SNAPSHOT\portlets\Sai-portlet\docroot\WEB-INF\src\com\test\sai-friendly-url-routes.xml
The content inside sai-friendly-url-routes.xml is
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE routes PUBLIC "-//Liferay//DTD Friendly URL Routes 6.1.0//EN" "http://www.liferay.com/dtd/liferay-friendly-url-routes_6_1_0.dtd">
<routes>
<route>
<pattern>/{mvcPathName}</pattern>
<generated-parameter name="mvcPath">/{mvcPathName}.jsp</generated-parameter>
</route>
</routes>
But i observed there is no change in the url
http://localhost:8080/web/guest/what-we-do?p_p_id=sai_WAR_Saiportlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_sai_WAR_Saiportlet_jspPage=%2Fhtml%2Fsai%2Fedit.jsp
Please let me know where exactly i am doing mistake .
You leave the values as they are. That is, you leave {mvcPathName} and "mvcPath" as-is.
When the friendly URL is generated, it parses mvcPath (i.e., edit.jsp or view.jsp) from the URL and then the pattern is applied, replacing .../edit.jsp with .../edit.
This example works for the edit JSP. And it works for the view page; but NOT when clicking Save ... which is something I could look into. However, if you go to edit and then click the back link, the friendly URL will show for the view JSP.
I've created a ticket to complete this example so that it also goes to a friendly URL when clicking save. I'll update this section when we've made the fix.
Thanks.