I used the class "ControlZone-drag" to using jquery in Workbench.
<div class="ControlZone-drag ControlZone--drag-show" data-drag-handle="WebpartBorderHandle" role="presentation"></div>
But after deploying to community site page, the class were changed like an encrypted string.
<div class="am_s_6bae85a6" data-drag-handle="WebpartBorderHandle" role="presentation"></div>
I've been researching about this but i didn't find anything about this situation.
I just wanna get the document about the encrypted class on community site page.
Can anyone explain why the sharepoint's class name is encrypted or give me the document about this situation?
Thank you so much
Related
I am using JHipster v6.6.0 and I want to display customized error messages to users.
This question has been asked before and answered by using the class CustomParameterizedException.
But I can not find this class in the JHipster version that I am using.
Has the class been removed? And if so, what can be used instead?
The class CustomParameterizedException was removed in PR#9624 in favor of the Problem library.
Quoting the documentation on Managing Server Errors:
To handle Spring MVC REST errors, JHipster uses Zalando’s Problem Spring Web library, in order to provide rich, JSON-based error messages.
You can achieve the same custom error messages as before with less effort and more customization options.
import org.zalando.problem.Problem;
import org.zalando.problem.Status;
...
throw Problem.builder()
.withStatus(Status.BAD_REQUEST)
.with("param1", "value 1")
.with("param2", "value 2")
.build();
If you notice, this is how JHipster handles errors in base components (users, accounts, authorization).
Check the ExceptionTranslator.java class for examples and guidance. A good place to start would be handleMethodArgumentNotValid() I think, but my experience with the Problem library is very limited.
Is there a way to expose a Java rest web service in Liferay but not in a portlet, that can receive JSON request and store the data in Journal Article?
Therefore when a user logs into Liferay they will be see web content
Yes there is : JSONWebServiceActionsManagerUtil.registerJSONWebServiceAction
For instance :
Class<?> serviceImplClass;
Method serviceMethod;
Object serviceImpl;
String path = jsonWebServiceMappingResolver.resolvePath(serviceImplClass, serviceMethod);
String method = jsonWebServiceMappingResolver.resolveHttpMethod(serviceMethod);
JSONWebServiceActionsManagerUtil.registerJSONWebServiceAction("/yourwspath", serviceImpl, serviceImplClass, serviceMethod, path, method);
You should then be able to see the new web service in http://SERVER/api/jsonws
Well yes, Liferay has a full API (even JSON-based, SOAP optional, no classic REST though) that you can use. A simple Stackoverflow answer is not the right place to give a full introduction on how to work with Liferay's API, but you might want to look up Servicebuilder (which is used to create Liferay's API) and then look at JournalArticleService and related services: The Web Content Management API is called "Journal" in Liferay (for historical reasons)
Is it possible to somehow override the login method of the Secure.java class of the Secure-Module in Play! Framework, so that another version of the login form is displayed?
In my case, i want to display a mobile version of the login-form if a mobile browser is detected.
I know i should not change the Secure.java class itself, but i don't really see any other solution to this problem.
As discussed in other posts you have the request in your Play! controller. So in this request you could ask which agent is trying to view your website:
String agentInfo = request.headers.get("user-agent");
The you can determine which template will be rendered for this agent:
if (agentType.isWhatEverHeIs) {
renderTemplate("Application\mobileTemplateForBadPractise.html");
} else {
render();
}
But what I would encourage you to do is responsive webdevelopment. Create your templates as smart as possible, let the template and css and javascript do this and keep your business logic in your controller.
You could use the Twitter Bootstrap to achieve this, but there are many more! Like Skeleton.
You even got the request object inside your templates so that you can optionally render things in your template (or not) based on the agent.
Even simpler, simply create/override the secure/login.html template and use responsive design : media queries. No need to change the controller or check agent or whatever.
I'm looking at Mixu's Auth module for Kohana 3.1 but want to implement the UI into my own site templates. At the moment my site runs properly using its own template until it gets to a restricted page. At that point it loads the useradmin module's template for logins. I'd like to just load the page components into my own template and navigation.
What is the best way to go about this please? I had imagined I would be able to arrest the flow at some point within my 'application' environment without editing the 'module' environment.
EDIT:
I'm a little further along now. I've created two Controller classes:
application/classes/controller/app.php
application/classes/controller/user.php
Each extends the module class and replaces the template reference. Eg:
<?php defined('SYSPATH') or die('No direct access allowed.');
class Controller_User extends Useradmin_Controller_User {
public $template = 'smarty:maintemplate';
}
I guess this is the right approach. I'm using Smarty Templates which is compounding the issues as I need to merge different templates. I'll keep plugging away and see how I go.
I don't know about the best way, but I had a similar situation.
In the end, I copied part of the code from the module that I needed, and rolled my own implementation of the module.
Btw. Smarty is ok, but Kostache (Mustache for Kohana) rocks. More flexible and you can use the same templates for php and javascript.
I am using the webapplicationbuilder class to create a new web application and have found many articles that help with this, none however seem to specify how you designate the URL or the application, i just get "sharepoint - 123" where 123 is the port specified and "servername/:123" as the url, whereas i need "http://myserver/.
Thanks
Assuming you mean the SPWebApplicationBuilder class.
Have you tried to set the HostHeader property of your SPWebApplicationBuilder object?