[JBoss jBPM] - Re: jBPM : Couldn't be that complicated...
by viniciuscarvalho
"kukeltje" wrote : did you try to run this script for updating a 3.1 database to a 3.2 database? I'm looking into this, but afaik, this is for creating a new database (even if one already exists).
|
| I did it several times and did not encounter these errors. It's simple, if the fk's are not deleted, you cannot drop the tables..... that is mysql behaviour. Then do a truncate first or something delete the schema and create it again... not so difficult, is it? I've worked with mysql and jbpm for 4 years now... you have to be a little creative, but just a little.
Yeah I know! I do understand the errors. What I can't understand is that why the script simply can't run out-of-the-box, this is the whole point. I don't belive the scripts located at db/jbpm-jpdl-mysql.sql are intend for fresh install are they? The miss a lot of tables when compared to the one found on starters-kit.
One thing I'll do here is to mix both scripts so I don't need to rely on the alter table that seems to be problematic (I found a bug on mysql complaining about droping constraints with alter table).
So far I left this behind as we are running out of time and I've already an oracle DB setup
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032198#4032198
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032198
19Â years
[JBoss Portal] - Re: Security constraints for portlets
by tajh
Months later...
I think there is a programmatic way to do this. I have had the same issue, using JBP 2.4. You can implement a custom org.jboss.portal.theme.render.DecorationRenderer, or just subclass org.jboss.portal.theme.impl.render.DivDecorationRenderer (assuming you are using the divRenderer in your *-object.xml either specifically for that portal object or as the default renderer) and override render() and reimplement renderModeAndStateLinks() (because it's a static method in DivDecorationRenderer for some odd reason) .
I will be attempting this. The open question is whether I can find enough implementation in the RenderContext parameter to figure out who the user is and what she can access. Hopefully I can somehow get access to the RenderRequest object, and then I will be able to get all the information I need.
Hope this helps someone else.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032190#4032190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032190
19Â years
[JBoss Seam] - selectManyMenu validation error
by jonathan.shin
I created EJB3 ManyToMany entities. User has a many to many relationship with Role. A user can have zero or more roles, and a role can have zero or more users. But, I?m getting validation error (?roles: Value is not a valid option?) when I clicked the ?Save? button.
User Entity:
| @Entity
| @Table(name = "User")
| public class User implements java.io.Serializable {
| ...
| @ManyToMany
| @JoinTable(name="User_Role",
| joinColumns=@JoinColumn(name="user_id", referencedColumnName="user_id"),
| inverseJoinColumns=@JoinColumn(name="role_id", referencedColumnName="role_id")
| )
| public List<Role> getRoles() {
| return this.roles;
| }
|
| public void setRoles(List<Role> roles) {
| this.roles = roles;
| }
| }
|
|
UserHome Object:
| @Name("userHome")
| public class UserHome extends EntityHome<User> {
|
| public void setUserUserId(Integer id) {
| setId(id);
| }
|
| public Integer getUserUserId() {
| return (Integer) getId();
| }
|
| @Override
| protected User createInstance() {
| User user = new User();
| return user;
| }
| ...
| public List<Role> getRoles() {
| return getInstance() == null ? null : new ArrayList<Role>(
| getInstance().getRoles());
| }
|
| }
|
Role Entity:
| @Entity
| @Name("role")
| @Scope(SESSION)
| @Table(name = "Role")
| public class Role implements java.io.Serializable
| {
|
| private int roleId;
|
| private String name;
|
| private List<User> users;
|
| public Role()
| {
| System.out.println("Default Constructor");
| }
| ...
| @Column(name = "NAME", length = 50)
| @Length(max = 50)
| @NotNull
| public String getName()
| {
| return this.name;
| }
|
| public void setName(String name)
| {
| this.name = name;
| }
|
| @ManyToMany(mappedBy = "roles")
| public List<User> getUsers()
| {
| return this.users;
| }
|
| public void setUsers(List<User> users)
| {
| this.users = users;
| }
| }
|
Converter:
| @Name("converters")
| public class Converters
| {
|
| @Transactional
| public Converter getRoleConverter() {
| return new Converter() {
|
| @Transactional
| public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException
| {
| if (arg2 == null) {
| return null;
| }
| try {
| return ((EntityManager) Component.getInstance("entityManager")).find(Role.class, Integer.valueOf(arg2));
| } catch (NumberFormatException e) {
| throw new ConverterException("Cannot find selected Role", e);
| }
| }
|
| @Transactional
| public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) throws ConverterException
| {
| if (arg2 instanceof Role)
| {
| Role role = (Role) arg2;
| Integer tempId = (Integer) role.getRoleId();
| return tempId.toString();
| }
| else
| {
| return null;
| }
| }
|
| };
| }
| }
|
UserEdit.xhtml view:
| ...
| <h:outputLabel for="role">
| Roles
| </h:outputLabel>
| <s:decorate id="roleDecoration">
| <h:selectManyMenu id="roles" value="#{userHome.instance.roles}" size="5" converter="#{converters.roleConverter}">
| <s:selectItems value="#{roleList.resultList}" var="role" label="#{role.name}" noSelectionLabel="Please Select..." hideNoSelectionLabel="true"/>
| </h:selectManyMenu>
| </s:decorate>
| ...
| <h:commandButton id="save"
| value="Save"
| action="#{userHome.persist}"
| disabled="#{!userHome.wired}"
| rendered="#{!userHome.managed}"/>
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032188#4032188
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032188
19Â years