Flex Links Moss's Rest via htmlservices (rest's get post mode)

Source: Internet
Author: User


One: Flex debug (Debug)--trace ()--moss Import

Flex Learning: 1, Flex can not use the Trace debug statement problem, the console no information output, this problem does not need to modify the parameters of the installation files,
You only need to download the latest flashplayer_12_ax_debug, and at run time, you cannot debug through a Web application.
Instead, you should press the F11 key to debug, otherwise the information will not be output.

Engineering integration
If you put Bin-debug or bin-release under Liferay tomcat, you do not have to create a new portlet, add functionality directly,
Add a Bin-debug or bin-release/index.html (index.html can be omitted);
Another way is to copy related files such as SWF into one of the Portlet's folders, so that jsp,html can communicate with SWF.
When importing Moss project, the normal project can be imported, the build path jar path changes, and the ApplicationContext is cut and pasted accordingly;
Import Liferay project, first copy the project to Portlets, theme below, and then press Liferay project to import,
Build path Jar (under your own tomcat/root).

Second: The socket + httpservices learning


Moss Background service: @QueryParam ("id") String ID This is the URL pass parameter of the pass-off HTTP;
@FormParam ("id") String ID This is the way the parameter is passed by form, @GET @POST means that the parameter is implicitly called or the call parameter is displayed, that is, the GET argument is displayed in the URL of the browser.
/**
* @author Zhangyapeng
* @function location Service browser address bar test Method--
* @data 2014.06.10
*/
@GET
@Path ("/locate")
@Produces (Mediatype.text_plain)
public string Locate2 (@QueryParam ("id") string id) {

Stringcmd = "Locate," +ID;
Flexsocket.sendmessage (CMD);
return cmd;
}

/**
* @author Zhangyapeng
* @function Location service, Liferay call
* @data 2014.06.10
*/
@POST
@Path ("/locate")
@Produces (Mediatype.application_json)
public void Locate (@QueryParam ("id") String ID) {

Ditto...
}
GET
@Path ("{Contact}")
@Produces (Mediatype.text_plain)
public string Getres (@PathParam (' contact ') string contact)
{
Return "Hello," + contact;

}

In summary, whether (the @PathParam ("contact") string) or (@QueryParam ("id") string id) or @ (Formparam ("id") string ID) is related to how the parameter is passed is the URL or form form submitted;

And here @get @POST refers to the way the results of the query are sent.

Three: Flex's httpserviece:

First declare Httpservice to declare
<fx:Declarations>
<!--place non-visual elements (such as services, value objects) here--
<smt:mypopup id= "Mypopup"/>
<mx:httpservice id= "Locateservice" method = "POST" useproxy= "false" resultformat= "text"
fault= "Onfaluthandler (event)" result= "Onstemeeventresulthandler (event)"/>
</fx:Declarations>

After that, the Send () function is triggered ...
Call Locateservice (Httpservice) by ID
Private Functiongetsmteeventbyid (id:string): void
{


Locateservice.url =baseurl + "/getsmteeventbyid";
Locateservice.method= "POST";
var params:object = new Object ();
params.id= ID;
locateservice.request= params;
Trace (Locateservice.url);
Locateservice.send ();
}

All URLs need to be written in the config file,,, Gridmanagewidget.mxml routewidget.mxml (the path analysis is problematic) Socketwidget.mxml in the respective XML, Of course, I also created a commonurl.xml,
In the change to config. config=, the property value of "":
Puzzle--search.mxml, is the system comes with, its search.xml has a lot of layers of the URL, you have to change the OH.
-----So the workaround now is to change each URL by using the total system configuration file in config. config= "" To find the property value of "".

Flex Links Moss's Rest via htmlservices (rest's get post mode)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.